:root {
  /* Colors */
  --bg: #f5f5f7; --bg-alt: #e8ecf0; --surface: #fff; --surface2: #fafafa;
  --border: #e5e5ea; --border-light: rgba(0,0,0,0.06);
  --text: #1d1d1f; --text-secondary: #8e8e93; --text-tertiary: #c7c7cc; --text-muted: #484f58;
  --accent: #007aff; --accent-hover: #0066d6; --accent-light: rgba(0,122,255,0.1);
  --green: #34c759; --green-light: rgba(52,199,89,0.1);
  --red: #ff3b30; --red-light: rgba(255,59,48,0.1);
  --orange: #ff9500; --orange-light: rgba(255,149,0,0.1);
  --purple: #af52de; --purple-light: rgba(175,82,222,0.1);
  /* Spacing */
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04); --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 18px 45px rgba(0,0,0,0.14);
  --control-h-sm: 28px; --control-h-md: 34px; --control-h-lg: 40px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px; --space-6: 24px;
  --focus-ring: 0 0 0 3px rgba(0,122,255,0.14);
  /* Font */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --fs-xs: 10px; --fs-sm: 11px; --fs-base: 13px; --fs-md: 14px; --fs-lg: 16px; --fs-xl: 18px; --fs-2xl: 22px;
  /* Transition */
  --transition: 0.15s ease;
  /* Compatibility aliases */
  --c-bg: var(--bg); --c-surface: var(--surface); --c-surface-2: var(--surface2);
  --c-border: var(--border); --c-text: var(--text); --c-text-secondary: var(--text-secondary);
  --c-text-tertiary: var(--text-tertiary); --c-accent: var(--accent);
}

[data-theme="dark"] {
  --bg: #1c1c1e; --bg-alt: #2c2c2e; --surface: #2c2c2e; --surface2: #1c1c1e;
  --border: #3a3a3c; --border-light: rgba(255,255,255,0.08);
  --text: #f5f5f7; --text-secondary: #98989d; --text-tertiary: #636366; --text-muted: #48484a;
  --accent: #007aff; --accent-hover: #409cff;
  --green: #34c759; --red: #ff453a; --orange: #ff9f0a; --purple: #bf5af2;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2); --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-lg: 0 18px 45px rgba(0,0,0,0.38);
  --focus-ring: 0 0 0 3px rgba(64,156,255,0.2);
}

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

/* Dark mode */

[data-theme="dark"] { color-scheme: dark; }
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] .sidebar { background: var(--surface); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .sidebar .tab { color: var(--text-tertiary); }
[data-theme="dark"] .sidebar .tab:hover { background: rgba(255,255,255,0.08); color: var(--text); }
[data-theme="dark"] .header { background: rgba(28,28,30,0.85); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .header .title { color: var(--text); }
[data-theme="dark"] .header .status { color: var(--text-secondary); }
[data-theme="dark"] .msg.assistant { background: var(--surface); color: var(--text); border-color: #3a3a3c; }
[data-theme="dark"] .reasoning-body { background: var(--surface); color: var(--text-secondary); }
[data-theme="dark"] .thinking { background: var(--surface); border-color: #3a3a3c; }
[data-theme="dark"] .thinking .dots span { background: #636366; }
[data-theme="dark"] .input-wrap { background: rgba(28,28,30,0.85); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .dropdown { background: var(--surface); border-color: #3a3a3c; }
[data-theme="dark"] .dropdown-item { color: var(--text); }
[data-theme="dark"] .dropdown-item:hover,.dropdown-item.active { background: var(--border); }
[data-theme="dark"] .input-inner { background: var(--surface); border-color: #3a3a3c; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
[data-theme="dark"] .input-inner:focus-within { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,122,255,0.2); }
[data-theme="dark"] .input-inner input { color: var(--text); }
[data-theme="dark"] .input-inner input::placeholder { color: var(--text-tertiary); }

[data-theme="dark"] .apps-empty { color: var(--text-tertiary); }
[data-theme="dark"] .apps-empty svg { stroke: #48484a; }
[data-theme="dark"] .preview-bar { background: rgba(28,28,30,0.85); border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .preview-frame { background: var(--bg); }
[data-theme="dark"] .chat::-webkit-scrollbar-thumb { background: var(--text-muted); }
[data-theme="dark"] .suggestion { background: var(--surface) !important; border-color: #3a3a3c !important; color: var(--text); }
/* ===== Chat Welcome - Expert Grid ===== */
.expert-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; max-width:440px; margin:0 auto; text-align:left; }
.expert-card { padding:14px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg); cursor:pointer; transition:all var(--transition); }
.expert-card:hover { border-color:var(--accent); box-shadow:0 4px 12px rgba(0,122,255,0.1); transform:translateY(-1px); }
.expert-card .ec-tag { font-size:var(--fs-sm); font-weight:600; margin-bottom:2px; }
.expert-card .ec-name { font-size:var(--fs-md); font-weight:600; color:var(--text); }
.expert-card .ec-role { font-size:var(--fs-sm); color:var(--text-secondary); }

/* ===== Chat Messages ===== */
.chat { flex:1; overflow-y:auto; padding:20px 20%; display:flex; flex-direction:column; gap:4px; }
@media (max-width: 768px) { .chat { padding:16px; } }

.msg { max-width:680px; padding:12px 18px; border-radius:var(--radius-xl); font-size:var(--fs-base); line-height:1.55; word-wrap:break-word; position:relative; }
.msg.user { align-self:flex-end; background:var(--accent); color:#fff; border-bottom-right-radius:var(--radius-sm); }
.msg.assistant { align-self:flex-start; background:var(--surface); color:var(--text); border:1px solid var(--border); border-bottom-left-radius:var(--radius-sm); box-shadow:var(--shadow-sm); }
.msg.assistant p,.msg.assistant div { color:var(--text); }

.reasoning { margin:2px 0; }
.reasoning-header { cursor:pointer; font-size:var(--fs-sm); color:var(--text-secondary); padding:4px 8px; border-radius:var(--radius-sm); display:flex;align-items:center;gap:4px; user-select:none; }
.reasoning-header:hover { background:rgba(0,0,0,0.04); }
.reasoning-body { display:none; font-size:var(--fs-xs); color:var(--text-secondary); padding:6px 12px; border-left:2px solid var(--accent); margin-left:12px; line-height:1.5; }

.thinking { display:flex; align-items:center; gap:6px; padding:8px 12px; font-size:var(--fs-sm); color:var(--text-secondary); }
.thinking .dots { display:flex; gap:2px; }
.thinking .dots span { width:5px; height:5px; border-radius:50%; background:var(--accent); animation:dotPulse 1.2s infinite; }
.scroll-bottom-btn {
  position:absolute;
  left:50%;
  bottom:calc(126px + env(safe-area-inset-bottom));
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background:color-mix(in srgb, var(--surface) 94%, transparent);
  color:var(--text);
  box-shadow:0 8px 22px rgba(0,0,0,0.16), 0 1px 0 rgba(255,255,255,0.82) inset;
  transform:translate(-50%, 0);
  z-index:35;
  cursor:pointer;
  transition:opacity var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
  backdrop-filter:blur(18px) saturate(1.2);
  -webkit-backdrop-filter:blur(18px) saturate(1.2);
}
.scroll-bottom-btn:hover {
  background:var(--surface);
  box-shadow:0 10px 26px rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.9) inset;
  transform:translate(-50%, -1px);
}
.scroll-bottom-btn.is-hidden {
  opacity:0;
  pointer-events:none;
  transform:translate(-50%, 8px);
}
.scroll-bottom-btn svg {
  width:20px;
  height:20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2.1;
  stroke-linecap:round;
  stroke-linejoin:round;
}
[data-theme="dark"] .scroll-bottom-btn {
  background:rgba(44,44,46,0.9);
  border-color:rgba(255,255,255,0.1);
  color:var(--text);
  box-shadow:0 12px 28px rgba(0,0,0,0.38), 0 1px 0 rgba(255,255,255,0.06) inset;
}
.thinking .dots span:nth-child(2) { animation-delay:0.2s; }
.thinking .dots span:nth-child(3) { animation-delay:0.4s; }
@keyframes dotPulse { 0%,100%{opacity:0.3} 50%{opacity:1} }

/* Shortcuts */
.shortcut-item { width:32px;height:32px;border-radius:8px;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:16px;position:relative;transition:all 0.15s; }
.shortcut-item:hover { background:rgba(0,122,255,0.12); }
[data-theme="dark"] .shortcut-item:hover { background:rgba(0,122,255,0.15); }
.shortcut-emoji { display:inline-flex; align-items:center; justify-content:center; line-height:1; font-size:16px; }


body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Sidebar */
.sidebar {
  width: 56px;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 12px;
  gap: 5px;
  flex-shrink: 0;
  user-select: none;
  position: relative;
  isolation: isolate;
  contain: paint;
}
.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--surface);
  z-index: 0;
}
.sidebar > * {
  position: relative;
  z-index: 1;
}
.sidebar .logo {
  width: 40px;
  height: 40px;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 18px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  cursor: pointer;
  overflow:hidden;
}
.sidebar .user-logo:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
  transform: translateY(-1px);
}
.sidebar .user-logo:active {
  transform: translateY(0) scale(0.98);
}
.dock-nav {
  width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--surface2);
}
.sidebar .tab {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
  color: var(--text-secondary);
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}
.sidebar .tab:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
  transform: translateY(-1px);
}
.sidebar .tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(0,122,255,0.16);
}
.dock-settings {
  margin-top: 8px;
}
.sidebar .tab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar .tab .badge {
  position: absolute; top: 2px; right: 2px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.9);
}
.mobile-space-nav {
  display: none;
}
.mobile-space-nav__item {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 56px;
  padding: 8px 4px 7px;
  border-radius: 14px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.mobile-space-nav__item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mobile-space-nav__item span {
  font-size: 10px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0;
}
.mobile-space-nav__item:hover {
  background: var(--surface2);
  border-color: var(--border);
  color: var(--text);
}
.mobile-space-nav__item.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 10px 18px rgba(0,122,255,0.14);
}

/* Main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.desktop-workspace-nav {
  min-height: 54px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  z-index: 40;
}
.desktop-workspace-trigger {
  min-width: 112px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.desktop-workspace-trigger:hover,
.desktop-workspace-trigger[aria-expanded="true"] {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
}
.desktop-workspace-trigger svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--text-secondary);
}
.desktop-workspace-menu {
  position: absolute;
  top: calc(100% - 4px);
  left: 50%;
  width: 300px;
  transform: translateX(-50%);
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(22px);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 22px 54px rgba(0,0,0,0.14);
  display: none;
  flex-direction: column;
  gap: 3px;
}
.desktop-workspace-menu.is-open {
  display: flex;
}
.desktop-workspace-menu .mobile-space-menu__item {
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 12px;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.desktop-workspace-menu .mobile-space-menu__item svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.desktop-workspace-menu .mobile-space-menu__item.active {
  background: rgba(0,122,255,0.08);
  color: var(--accent);
}
.desktop-workspace-menu .mobile-space-menu__item.active svg {
  color: var(--accent);
}
.desktop-workspace-menu .mobile-space-menu__workspace span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.desktop-workspace-menu .mobile-space-menu__workspace strong {
  font-size: 14px;
}
.desktop-workspace-menu .mobile-space-menu__workspace em {
  color: var(--text-secondary);
  font-style: normal;
  font-size: 11px;
}
[data-theme="dark"] .desktop-workspace-nav {
  background: rgba(28,28,30,0.82);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .desktop-workspace-menu {
  background: rgba(28,28,30,0.94);
  border-color: rgba(255,255,255,0.08);
}

/* Header */
.header {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: none;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  user-select: none;
  min-height: 48px;
}
.header .title { font-size: 14px; font-weight: 600; color: var(--text); }
.header .status { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.header .dot { width: 6px; height: 6px; border-radius: 50%; background: #30d158; display: inline-block; }

/* Panels */
.panel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.panel.active { display: flex; }
#panelChat { position: relative; }
#panelThink {
  overflow:auto;
  background:var(--bg);
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  max-width:100%;
}
.think-page {
  width:min(1120px, calc(100% - 48px));
  max-width:100%;
  min-width:0;
  margin:0 auto;
  padding:34px 0 42px;
  touch-action:pan-y;
  overflow-x:hidden;
}
.think-page__header {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.think-page__kicker {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--text-secondary);
  font-size:11px;
  font-weight:750;
}
.think-page h1 {
  margin:10px 0 6px;
  color:var(--text);
  font-size:32px;
  line-height:1.15;
  letter-spacing:0;
}
.think-page p {
  margin:0;
  max-width:680px;
  color:var(--text-secondary);
  font-size:14px;
  line-height:1.6;
}
.think-page__actions {
  display:flex;
  gap:8px;
  flex-shrink:0;
}
.think-page__actions button {
  min-height:36px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.think-page__actions button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}

.thread-bar {
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px clamp(16px, 8vw, 120px) 0;
  overflow-x:auto;
  flex-shrink:0;
  scrollbar-width:none;
}
.thread-bar::-webkit-scrollbar { display:none; }
.thread-desktop-row {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
  flex:1;
}
.thread-desktop-row::-webkit-scrollbar { display:none; }
.thread-item {
  display:inline-flex;
  align-items:center;
  gap:4px;
  flex-shrink:0;
}
.thread-new,
.thread-chip {
  border:1px solid var(--border-light);
  background:color-mix(in srgb, var(--surface) 94%, transparent);
  color:var(--text-secondary);
  border-radius:999px;
  min-height:34px;
  padding:0 11px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  font:inherit;
  font-size:12px;
  font-weight:650;
  white-space:nowrap;
  cursor:pointer;
  flex-shrink:0;
}
.thread-new {
  min-width: 94px;
  justify-content:center;
}
.thread-memory {
  border:1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background:color-mix(in srgb, var(--accent) 8%, var(--surface));
  color:var(--accent);
  border-radius:999px;
  min-height:34px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font:inherit;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  flex-shrink:0;
}
.thread-home {
  border:1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
  background:color-mix(in srgb, var(--accent) 8%, var(--surface));
  color:var(--accent);
  border-radius:999px;
  min-height:34px;
  padding:0 12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font:inherit;
  font-size:12px;
  font-weight:700;
  white-space:nowrap;
  cursor:pointer;
  flex-shrink:0;
}
.thread-new:hover,
.thread-chip:hover,
.thread-memory:hover,
.thread-home:hover {
  color:var(--accent);
  border-color:color-mix(in srgb, var(--accent) 35%, var(--border));
}
.thread-chip.is-active {
  color:var(--text);
  background:var(--surface);
  border-color:color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow:0 4px 12px rgba(0,0,0,0.05);
}
.thread-chip span {
  max-width:150px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.thread-chip em {
  color:var(--text-tertiary);
  font-style:normal;
  font-size:10px;
  font-weight:600;
}
.thread-chip-close {
  width:18px;
  height:18px;
  border:1px solid transparent;
  background:transparent;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  color:var(--text-tertiary);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
  flex-shrink:0;
  transition:background var(--transition), color var(--transition), border-color var(--transition);
}
.thread-chip-close:hover {
  color:#ff3b30;
  background:rgba(255,59,48,0.1);
  border-color:rgba(255,59,48,0.16);
}
.thread-mobile-row,
.thread-menu {
  display:none;
}

/* Input wrap - ChatGPT style */
.input-wrap { padding: 8px 16px 12px; background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.06); flex-shrink: 0; position: relative; }
@media (max-width: 768px) { .input-wrap { padding: 8px 12px 12px; } }

.chat-input-container {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 8px 8px 8px 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.chat-input-container:focus-within {
  border-color: var(--accent);
  box-shadow: 0 2px 12px rgba(0,122,255,0.12);
}

.chat-input-container textarea {
  flex: 1; border: none; background: transparent;
  padding: 4px 0; font-size: 14px; font-family: inherit;
  outline: none; color: var(--text); resize: none;
  max-height: 120px; line-height: 1.5;
}
.chat-input-container textarea::placeholder { color: var(--text-tertiary); }

.chat-input-actions {
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}

.mobile-composer-model-btn {
  display:none !important;
}

.chat-attach-btn, .chat-input-actions button {
  background: none; border: none; border-radius: 8px;
  padding: 6px; cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.chat-attach-btn:hover { color: var(--accent); background: rgba(0,122,255,0.08); }
.chat-input-actions button:hover { color: var(--accent); background: rgba(0,122,255,0.08); }

#send {
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 8px; width: 34px; height: 34px;
}
#send:hover { background: var(--accent-hover); }
#send:disabled { background: #e5e5ea; color: var(--text-tertiary); cursor: not-allowed; }
#send svg { stroke: currentColor; fill: none; }

.chat-model-bar {
  display: flex; gap: 6px; justify-content: center;
  padding: 6px 0 0; font-size: 11px;
}
.chat-model-bar .tab {
  padding: 2px 8px; border-radius: 10px;
  cursor: pointer; color: var(--text-secondary); transition: all 0.15s;
  font-weight: 500;
}
.chat-model-bar .tab:hover { background: rgba(0,122,255,0.08); }
.chat-model-bar .tab.active { background: rgba(0,122,255,0.12); color: var(--accent); }
.model-sep { width: 1px; background: #e5e5ea; margin: 0 2px; }


[data-theme="dark"] .chat-input-container { background: var(--surface); border-color: #3a3a3c; box-shadow: 0 2px 6px rgba(0,0,0,0.3); }
[data-theme="dark"] .chat-input-container:focus-within { border-color: var(--accent); box-shadow: 0 2px 12px rgba(0,122,255,0.2); }
[data-theme="dark"] .chat-input-container textarea { color: var(--text); }
[data-theme="dark"] .chat-input-container textarea::placeholder { color: var(--text-tertiary); }
[data-theme="dark"] .chat-attach-btn, [data-theme="dark"] .chat-input-actions button { color: var(--text-secondary); }
[data-theme="dark"] .chat-attach-btn:hover, [data-theme="dark"] .chat-input-actions button:hover { color: var(--accent); background: rgba(0,122,255,0.12); }
[data-theme="dark"] #send { background: var(--accent); color: #fff; }
[data-theme="dark"] #send:hover { background: var(--accent-hover); }
[data-theme="dark"] #send:disabled { background: var(--border); color: var(--text-tertiary); }
[data-theme="dark"] .chat-model-bar .tab { color: var(--text-tertiary); }
[data-theme="dark"] .chat-model-bar .tab:hover { background: rgba(0,122,255,0.12); }
[data-theme="dark"] .chat-model-bar .tab.active { background: rgba(0,122,255,0.2); color: #40a9ff; }
[data-theme="dark"] .model-sep { background: var(--border); }

/* File preview */
.file-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.file-chip { display:flex;align-items:center;gap:4px;padding:3px 8px;border-radius:6px;background:rgba(0,122,255,0.1);border:1px solid rgba(0,122,255,0.2);font-size:11px;font-weight:500;color:var(--accent);max-width:min(260px,100%);overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.file-chip__icon { flex-shrink:0; }
.file-chip__name { min-width:0;overflow:hidden;text-overflow:ellipsis; }
.file-chip__meta { flex-shrink:0;color:var(--text-tertiary);font-weight:600;margin-left:2px; }
.file-chip__memory { flex-shrink:0;border:0;background:rgba(88,86,214,0.1);color:#5856d6;border-radius:999px;padding:1px 6px;font:inherit;font-size:10px;font-weight:700;cursor:pointer; }
.file-chip__memory:hover { background:rgba(88,86,214,0.18); }
.file-chip__memory.is-saved { cursor:default;color:#34c759;background:rgba(52,199,89,0.12); }
.file-chip .remove-file { cursor:pointer;font-size:10px;opacity:0.5;margin-left:2px;flex-shrink:0; }
.file-chip .remove-file:hover { opacity:1; }
.file-chip.image { background:rgba(52,199,89,0.1);border-color:rgba(52,199,89,0.2);color:var(--green); }
.file-chip.is-loading { color:#8e8e93;background:rgba(142,142,147,0.08);border-color:rgba(142,142,147,0.18); }
.file-chip.is-error { color:#ff3b30;background:rgba(255,59,48,0.08);border-color:rgba(255,59,48,0.18); }
[data-theme="dark"] .file-chip { background:rgba(0,122,255,0.15);border-color:rgba(0,122,255,0.3);color:#40a9ff; }
[data-theme="dark"] .file-chip.image { background:rgba(52,199,89,0.15);border-color:rgba(52,199,89,0.3);color:var(--green); }

/* Chat panel */
.chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
@media (max-width: 768px) { .chat { padding: 16px; } }
@media (max-width: 640px) {
  .sidebar { display: none; }
  .desktop-workspace-nav { display: none; }
  .mobile-space-nav {
    display: flex;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    z-index: 1200;
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(22px) saturate(1.15);
    -webkit-backdrop-filter: blur(22px) saturate(1.15);
    box-shadow: 0 14px 36px rgba(0,0,0,0.12);
  }
  .header { padding: 8px 12px; min-height: 40px; }
  .header .model-badge { display: none; }
  .msg { max-width: 92%; font-size: 15px; padding: 10px 14px; }
  .reasoning { font-size: 12px; }
  .input-wrap { padding: 8px 12px; }
  .input-inner { border-radius: 10px; }
  .input-inner input { font-size: 16px; padding: 10px 10px; }
  .input-inner button { padding: 10px 14px; font-size: 15px; }

  .app-card { padding: 12px; }
  .preview-bar { padding: 6px 12px; }
  .preview-bar .back { font-size: 14px; }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 48px rgba(0,0,0,0.2);
  }
  .modal-title {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .profile-panel {
    text-align: left;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    margin: 2px 0 12px;
  }
  .profile-card {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
  }
  .profile-actions {
    margin-top: 12px;
  }
  .profile-btn {
    min-height: 44px;
    border-radius: 14px;
    font-size: 13px;
  }
}
.chat::-webkit-scrollbar { width: 4px; }
.chat::-webkit-scrollbar-track { background: transparent; }
.chat::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 2px; }

.msg {
  max-width: 680px;
  padding: 14px 18px;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  animation: msgIn 0.3s ease;
  align-self: flex-start;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.copy-btn {
  background: none; border: none; cursor: pointer;
  padding: 4px; margin-left: 8px; border-radius: 4px;
  color: var(--text-secondary); display: inline-flex; align-items: center;
  vertical-align: middle; transition: all 0.15s;
}
.copy-btn:hover { background: rgba(0,0,0,0.05); color: var(--text); }
[data-theme="dark"] .copy-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.reasoning { align-self: flex-start; max-width: 680px; width: 100%; font-size: 13px; color: var(--text-secondary); animation: msgIn 0.3s ease; }
.reasoning-header { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 0; user-select: none; font-size: 12px; }
.reasoning-header:hover { color: var(--accent); }
.reasoning-label { font-weight: 500; }
.reasoning-body { background: #f0f0f5; border-radius: 8px; padding: 12px 16px; line-height: 1.6; white-space: pre-wrap; font-size: 12px; color: var(--text-tertiary); border-left: 3px solid var(--accent); margin-bottom: 4px; display: none; }

.thinking { align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.thinking .dots { display: flex; gap: 4px; }
.thinking .dots span { width: 6px; height: 6px; border-radius: 50%; background: #c7c7cc; animation: dotPulse 1.4s infinite; }
.thinking .dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking .dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,80%,100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } }

.input-wrap { padding: 12px 20%; background: rgba(255,255,255,0.85); backdrop-filter: blur(20px); border-top: 1px solid rgba(0,0,0,0.06); flex-shrink: 0; }


/* Dropdown */
.dropdown {
  display: none; position: absolute; bottom: 100%; left: 0; right: 0;
  margin-bottom: 4px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  max-height: 200px; overflow-y: auto; z-index: 100;
}
.dropdown-item {
  padding: 10px 16px; cursor: pointer; font-size: 14px; color: var(--text);
  display: flex; align-items: center; gap: 8px; transition: background 0.1s;
}
.dropdown-item:hover, .dropdown-item.active { background: #f0f0f5; }
.dropdown-item .hint { color: var(--text-secondary); font-size: 11px; margin-left: auto; }
.dropdown.composer-attach-menu {
  position:fixed;
  left:24px;
  right:auto;
  top:auto;
  bottom:96px;
  width:292px;
  height:auto;
  min-height:0;
  max-height:min(420px, 52vh);
  padding:8px;
  border-radius:18px;
  overflow:auto;
  z-index:300;
  box-shadow:0 18px 48px rgba(0,0,0,0.12);
}
.composer-menu-section + .composer-menu-section {
  margin-top:6px;
  padding-top:6px;
  border-top:1px solid var(--border-light);
}
.composer-menu-section-title {
  padding:4px 10px 8px;
  color:var(--text-tertiary);
  font-size:11px;
  font-weight:700;
  letter-spacing:.02em;
}
.composer-menu-item {
  width:100%;
  min-height:48px;
  padding:0 14px;
  display:flex;
  align-items:center;
  gap:12px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:var(--text);
  font-size:15px;
  text-align:left;
  cursor:pointer;
}
.composer-menu-item:hover {
  background:var(--surface2);
}
.composer-menu-item svg {
  width:20px;
  height:20px;
  flex:0 0 20px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.composer-menu-item span {
  flex:0 0 auto;
}
.composer-menu-item .composer-menu-hint {
  margin-left:auto;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:500;
}
.composer-menu-item.has-chevron .composer-menu-hint {
  margin-left:8px;
}
.composer-menu-item em {
  font-style:normal;
  margin-left:6px;
  color:var(--text-tertiary);
  font-size:14px;
  line-height:1;
  font-weight:600;
}
.composer-menu-divider {
  height:1px;
  margin:7px 8px;
  background:var(--border-light);
}
.composer-menu-section--recent {
  display:grid;
  gap:4px;
}
.composer-menu-section-toggle {
  width:100%;
  min-height:38px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 8px 2px;
  border:0;
  background:transparent;
  color:var(--text);
  font:inherit;
  cursor:pointer;
  text-align:left;
}
.composer-menu-section-toggle:hover {
  color:var(--text);
}
.composer-menu-section-toggle .composer-menu-section-title {
  padding:0;
  font-size:12px;
  letter-spacing:0;
}
.composer-menu-section-meta {
  margin-left:auto;
  color:var(--text-tertiary);
  font-size:11px;
  font-weight:600;
}
.composer-menu-section-toggle em {
  margin-left:0;
  color:var(--text-tertiary);
  font-style:normal;
  font-size:12px;
  line-height:1;
  transition:transform var(--transition);
}
.composer-menu-section.is-open .composer-menu-section-toggle em {
  transform:rotate(0deg);
}
.composer-menu-section:not(.is-open) .composer-menu-section-body {
  display:none;
}
.composer-menu-section-body {
  display:grid;
  gap:4px;
  padding-bottom:2px;
}
.composer-recent-file {
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 10px;
  border:0;
  border-radius:11px;
  background:transparent;
  color:var(--text);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.composer-recent-file:hover {
  background:var(--surface2);
}
.composer-recent-file__icon {
  width:28px;
  height:28px;
  flex:0 0 28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:9px;
  background:rgba(0,122,255,0.1);
  color:var(--accent);
  font-size:15px;
  font-weight:800;
}
.composer-recent-file__main {
  min-width:0;
  flex:1;
  display:block;
}
.composer-recent-file__main strong,
.composer-recent-file__main em {
  display:block;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  line-height:1.25;
}
.composer-recent-file__main strong {
  color:var(--text);
  font-size:13px;
  font-weight:700;
}
.composer-recent-file__main em {
  margin-top:3px;
  color:var(--text-tertiary);
  font-style:normal;
  font-size:11px;
  font-weight:600;
}
.composer-recent-empty {
  padding:8px 10px 10px;
  color:var(--text-tertiary);
  font-size:12px;
  line-height:1.4;
}

/* Apps panel */
.apps-panel { padding: 24px; overflow-y: auto; flex: 1; }



.apps-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; color: var(--text-tertiary); gap: 12px; }
.apps-empty svg { width: 48px; height: 48px; stroke: #d1d1d6; }
.apps-empty p { font-size: 14px; }

/* Preview panel (iframe for generated apps) */
.preview-panel { flex: 1; display: none; flex-direction: column; }
.preview-panel.active { display: flex; }
.preview-bar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.preview-bar .back { cursor: pointer; color: var(--accent); font-size: 13px; display: flex; align-items: center; gap: 4px; background:none;border:none;padding:4px;border-radius:4px; }
.preview-bar .back:hover { background: rgba(0,122,255,0.1); }
.preview-bar .url { font-size: 12px; color: var(--text-secondary); flex: 1; text-align: center; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.preview-bar .preview-actions { display: flex; gap: 4px; }
.preview-bar .preview-btn { cursor: pointer; color: var(--text-secondary); font-size: 16px; padding: 4px 6px; border-radius: 4px; transition: all 0.15s; user-select: none; }
.preview-bar .preview-btn:hover { background: rgba(0,0,0,0.04); color: var(--text); }
[data-theme="dark"] .preview-bar .preview-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.preview-frame { flex: 1; border: none; background: var(--surface); }
.preview-panel.preview-panel--embedded .preview-bar {
  min-height: 34px;
  padding: 6px 12px;
}
.preview-panel.preview-panel--embedded .preview-url {
  display: none;
}
.preview-panel.preview-panel--embedded .preview-bar .back,
.preview-panel.preview-panel--embedded .preview-bar .preview-btn {
  min-height: 28px;
  padding: 0 8px;
}
.preview-panel.preview-panel--no-chrome .preview-bar {
  display: none;
}
.preview-panel.preview-panel--no-chrome .preview-frame {
  min-height: 0;
}

/* Apps toolbar */
.apps-toolbar { padding: 12px 24px 0; display: flex; align-items: center; gap: 12px; flex-shrink: 0; flex-wrap: wrap; }
.apps-context {
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:140px;
}
.apps-context strong {
  color:var(--text);
  font-size:14px;
  line-height:1.2;
}
.apps-context span {
  color:var(--text-secondary);
  font-size:11px;
  line-height:1.2;
}
.apps-view-tabs {
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:3px;
  border:1px solid var(--border-light);
  border-radius:12px;
  background:var(--surface);
}
.apps-view-tabs button {
  border:none;
  border-radius:9px;
  background:transparent;
  color:var(--text-secondary);
  padding:6px 10px;
  font:inherit;
  font-size:12px;
  font-weight:650;
  cursor:pointer;
}
.apps-view-tabs button.active {
  background:var(--text);
  color:var(--surface);
}
.apps-search-wrap { position: relative; flex: 1; max-width: 360px; }
.apps-search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); pointer-events: none; }
#appsSearch { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px 8px 34px; font-size: 13px; font-family: inherit; outline: none; color: var(--text); transition: border-color 0.2s; }
#appsSearch:focus { border-color: var(--accent); }
#appsSearch::placeholder { color: var(--text-tertiary); }
[data-theme="dark"] #appsSearch { background: var(--surface); border-color: #3a3a3c; color: var(--text); }
[data-theme="dark"] #appsSearch:focus { border-color: var(--accent); }
[data-theme="dark"] #appsSearch::placeholder { color: var(--text-tertiary); }
.apps-count { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* App card delete */



#personaMenu::-webkit-scrollbar { width: 3px; }
#personaMenu::-webkit-scrollbar-thumb { background: #d1d1d6; border-radius: 3px; }
[data-theme="dark"] #personaMenu { background: var(--surface); border-color: #3a3a3c; box-shadow:0 8px 30px rgba(0,0,0,0.4); }
.persona-item { padding:4px 0; cursor:pointer; font-size:13px; display:flex; align-items:center; gap:8px; }
.persona-item .p-icon { width:24px; text-align:center; font-size:14px; flex-shrink:0; }
.persona-item .p-name { flex:1; font-weight:500; color:var(--text); }
.persona-item .p-title { font-size:11px; color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100px; }
.persona-item.active .p-name { color: var(--accent); }[data-theme="dark"] .persona-item .p-name { color:var(--text); }
.persona-divider { border-top:1px solid #e5e5ea; margin:6px 0; }
[data-theme="dark"] .persona-divider { border-color:#3a3a3c; }
.persona-exit { padding:8px 12px; cursor:pointer; font-size:12px; border-radius:8px; color:var(--red); text-align:center; transition:all 0.1s; }
.persona-exit:hover { background:rgba(255,59,48,0.08); }
[data-theme="dark"] .persona-exit:hover { background:rgba(255,59,48,0.1); }
[data-theme="dark"] #importModal > div { background:var(--surface) !important; }
[data-theme="dark"] #importModal input, [data-theme="dark"] #importModal textarea { background:var(--border); border-color:#3a3a3c; color:var(--text); }
[data-theme="dark"] #importModal label { color:var(--text-secondary) !important; }
[data-theme="dark"] #importModal #dropZone { border-color:#3a3a3c; }


.filter-btn { padding: 4px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; cursor: pointer; transition: all 0.2s; color: var(--text-tertiary); font-family: inherit; font-weight: 500; letter-spacing: 0.3px; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,122,255,0.04); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,122,255,0.2); }
[data-theme="dark"] .filter-btn { background: var(--surface); border-color: #3a3a3c; color: var(--text-secondary); }
[data-theme="dark"] .filter-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(0,122,255,0.08); }

/* Voice mode */
#voiceOverlay {
  display: none;
  position: absolute; inset: 0;
  background: var(--bg);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
#voiceOverlay.active { display: flex; }
[data-theme="dark"] #voiceOverlay { background: var(--bg); }
.voice-avatar { width:100px; height:100px; border-radius:50%; background:linear-gradient(135deg,#2c2c2e,#1c1c1e); display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; margin-bottom:16px; }
.voice-avatar .v-eyes { display:flex; gap:16px; }
.voice-avatar .v-eye { width:10px; height:12px; background:var(--bg); border-radius:50%; position:relative; }
.voice-avatar .v-eye::after { content:''; position:absolute; width:4px; height:4px; background:var(--bg); border-radius:50%; top:3px; left:3px; }
.voice-avatar .v-mouth { width:24px; height:3px; background:var(--bg); border-radius:2px; margin-top:6px; transition:all 0.15s; }
.voice-avatar .v-mouth.speaking { height:10px; border-radius:0 0 12px 12px; animation: vTalk 0.3s ease-in-out infinite alternate; }
@keyframes vTalk { 0% { height:5px; width:18px; } 100% { height:12px; width:22px; } }
.voice-status { font-size:13px; color:var(--text-secondary); margin-bottom:20px; }
.voice-wave { display:flex; gap:3px; align-items:center; height:24px; }
.voice-wave span { width:3px; background:var(--accent); border-radius:2px; animation: wave 0.5s ease-in-out infinite alternate; }
.voice-wave span:nth-child(1) { height:8px; animation-delay:0s; }
.voice-wave span:nth-child(2) { height:14px; animation-delay:0.1s; }
.voice-wave span:nth-child(3) { height:20px; animation-delay:0.2s; }
.voice-wave span:nth-child(4) { height:14px; animation-delay:0.3s; }
.voice-wave span:nth-child(5) { height:8px; animation-delay:0.4s; }
@keyframes wave { 0% { transform:scaleY(0.5); } 100% { transform:scaleY(1); } }
.voice-text-bubble { background:var(--accent); color:#fff; padding:12px 20px; border-radius:16px; font-size:14px; max-width:400px; text-align:center; margin-top:12px; display:none; }
.voice-close-btn { position:absolute; top:12px; right:12px; background:none; border:none; font-size:18px; cursor:pointer; color:var(--text-secondary); padding:8px; }

.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px 2px; padding: 6px 2px; }
@media (max-width:500px) { .apps-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 4px 2px; } }

/* App card - iOS home screen style */

.app-card { --app-accent:#007aff; --app-accent-soft:color-mix(in srgb, var(--app-accent) 14%, var(--surface)); --app-accent-border:color-mix(in srgb, var(--app-accent) 24%, var(--border-light)); background:transparent; border:none; cursor:pointer; display:flex; flex-direction:column; align-items:center; padding:6px 2px; gap:4px; transition:all 0.1s; position:relative; }
.app-card[data-theme="media"] { --app-accent:#ff9500; }
.app-card[data-theme="learn"] { --app-accent:#5856d6; }
.app-card[data-theme="business"] { --app-accent:#34c759; }
.app-card[data-theme="game"] { --app-accent:#ff3b30; }
.app-card[data-theme="news"] { --app-accent:#af52de; }
.app-card[data-theme="core"] { --app-accent:#007aff; }
.app-card:active { transform:scale(0.94); opacity:0.75; }
.app-card:hover .app-icon { transform:translateY(-1px) scale(1.04); }

.app-icon { width:60px; height:60px; border-radius:16px; display:flex; align-items:center; justify-content:center; flex-shrink:0; background:var(--app-accent-soft); color:var(--app-accent); border:1px solid var(--app-accent-border); box-shadow:0 8px 18px color-mix(in srgb, var(--app-accent) 10%, transparent); transition:transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s; }
.app-icon svg { width:28px; height:28px; display:block; }
.app-fallback { font-size:20px; line-height:1; }

.app-body { text-align:center; width:100%; }
.app-name { font-size:10px; font-weight:500; color:var(--c-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; text-align:center; letter-spacing:0; }

.app-indicator { position:absolute; top:3px; right:3px; width:5px; height:5px; border-radius:50%; background:var(--accent); }

/* Category header */
.cat-header { grid-column:1/-1; font-size:var(--fs-sm); font-weight:600; color:var(--text-secondary); padding:10px 2px 2px; letter-spacing:0.3px; }
.cat-header:first-child { padding-top:0; }

/* Sidebar shortcut drag */
.shortcut-item {
  width:34px;
  height:34px;
  border-radius:11px;
  cursor:grab;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
  position:relative;
  transition:background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  border:1px solid transparent;
  background:transparent;
}
.shortcut-item:hover {
  background:var(--surface2);
  border-color:var(--border);
  box-shadow:0 6px 14px rgba(0,0,0,0.06);
}
.shortcut-item:active { cursor:grabbing; transform:translateY(0) scale(0.98); }
[data-theme="dark"] .shortcut-item:hover { background:rgba(255,255,255,0.06); }

/* ===== Design Foundation ===== */
button,
.btn,
[role="button"],
a,
.clickable {
  cursor:pointer;
  transition:background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), opacity var(--transition), transform var(--transition);
}
button,
.btn,
input,
textarea,
select {
  font:inherit;
  letter-spacing:0;
}
button:disabled,
.btn:disabled,
[aria-disabled="true"] {
  cursor:not-allowed;
  opacity:0.58;
}
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline:2px solid var(--accent);
  outline-offset:2px;
}
button:active:not(:disabled),
.btn:active:not(:disabled) {
  transform:scale(0.98);
}
a:hover,
.clickable:hover {
  opacity:0.82;
}

.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:var(--control-h-md);
  padding:0 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  background:var(--surface);
  color:var(--text);
  font-size:var(--fs-base);
  font-weight:500;
  line-height:1;
  text-decoration:none;
  white-space:nowrap;
}
.btn:hover {
  border-color:color-mix(in srgb, var(--accent) 45%, var(--border));
  background:var(--surface2);
  color:var(--accent);
}
.btn-primary {
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}
.btn-primary:hover {
  border-color:var(--accent-hover);
  background:var(--accent-hover);
  color:#fff;
}
.btn-subtle {
  border-color:transparent;
  background:var(--accent-light);
  color:var(--accent);
}
.btn-danger,
.ev-cancel.danger {
  border-color:color-mix(in srgb, var(--red) 28%, var(--border));
  background:var(--red-light);
  color:var(--red);
}
.btn-icon,
.toolbar-icon-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--control-h-md);
  min-width:var(--control-h-md);
  height:var(--control-h-md);
  padding:0;
  border-radius:var(--radius-md);
}

input,
textarea,
select {
  transition:border-color var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  background:var(--surface);
  color:var(--text);
}
input::placeholder,
textarea::placeholder {
  color:var(--text-tertiary);
}
input:focus,
textarea:focus,
select:focus {
  border-color:var(--accent) !important;
  box-shadow:var(--focus-ring);
  outline:none;
}
.is-hidden {
  display:none;
}
.visually-hidden-input {
  display:none;
}

.card,
.modal,
.dropdown,
.expert-card,
.bm-card {
  background:var(--surface);
  border:1px solid var(--border);
  box-shadow:none;
}
.card {
  border-radius:var(--radius-lg);
  padding:var(--space-4);
}
.card:hover,
.expert-card:hover,
.bm-card:hover {
  border-color:color-mix(in srgb, var(--accent) 42%, var(--border));
}

.modal-overlay {
  position:fixed;
  inset:0;
  z-index:9999;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:var(--space-5);
  background:rgba(0,0,0,0.34);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  transition: opacity var(--transition);
}
.modal {
  width:min(520px, 100%);
  max-height:min(78vh, 680px);
  overflow:auto;
  border-radius:var(--radius-lg);
  padding:var(--space-5);
  color:var(--text);
  box-shadow:var(--shadow-lg);
}
.modal-title {
  margin:0 0 var(--space-4);
  font-size:var(--fs-lg);
  font-weight:700;
  color:var(--text);
}
.modal-body {
  color:var(--text-secondary);
  font-size:var(--fs-base);
  line-height:1.55;
}
.modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:var(--space-2);
  margin-top:var(--space-5);
}
.modal-actions button,
.ev-cancel {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:var(--control-h-md);
  padding:0 14px;
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  background:var(--surface);
  color:var(--text-secondary);
}
.modal-actions button:hover,
.ev-cancel:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}

.spinner {
  width:18px;
  height:18px;
  border:2px solid var(--border);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin 0.8s linear infinite;
}
@keyframes spin { to { transform:rotate(360deg); } }

[data-theme="dark"] .card,
[data-theme="dark"] .modal,
[data-theme="dark"] .dropdown,
[data-theme="dark"] .expert-card,
[data-theme="dark"] .bm-card {
  border-color:var(--border);
}

/* ===== Touch Targets (min 44px for iOS) ===== */
@media (max-width: 768px) {
  button, .btn, [role="button"], .tab, .nav-btn, .sidebar .tab {
    min-height: 44px; min-width: 44px;
  }
}

/* ===== Typography Scale ===== */
.text-xs { font-size: var(--fs-xs); } .text-sm { font-size: var(--fs-sm); }
.text-base { font-size: var(--fs-base); } .text-md { font-size: var(--fs-md); }
.text-lg { font-size: var(--fs-lg); } .text-xl { font-size: var(--fs-xl); }


/* ===== AI圈 · 书签卡片 ===== */
.bm-card { background:var(--surface); border:1px solid var(--border); border-radius:14px; padding:18px; margin-bottom:10px; transition:all var(--transition); cursor:pointer; overflow:hidden; }
.bm-card:hover { border-color:var(--accent); box-shadow:0 3px 12px rgba(0,122,255,0.08); }

.bm-card .bm-row { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.bm-card .bm-tag { display:inline-block; padding:3px 10px; border:0; border-radius:12px; font-size:11px; font-weight:500; letter-spacing:0; font-family:inherit; line-height:1.3; }
.bm-tag-list {
  display:none;
  flex-wrap:wrap;
  gap:6px;
  margin:-4px 0 10px;
}
.bm-card[data-expanded="1"] .bm-tag-list {
  display:flex;
}
.bm-tag-chip {
  min-height:24px;
  padding:2px 9px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-secondary);
  font:inherit;
  font-size:11px;
  cursor:pointer;
}
.bm-tag-chip:hover {
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-light);
}
.bm-source { display:inline-flex; align-items:center; min-height:20px; padding:2px 8px; border:1px solid var(--border); border-radius:999px; color:var(--muted); font-size:11px; line-height:1.3; background:rgba(255,255,255,0.58); }
.bm-type,
.bm-status {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:2px 8px;
  border-radius:999px;
  font-size:11px;
  line-height:1.3;
  font-weight:650;
}
.bm-type {
  background:var(--surface2);
  color:var(--text-secondary);
}
.bm-status {
  background:rgba(255,149,0,0.12);
  color:var(--orange);
}
.bm-title {
  margin-bottom:6px;
  font-size:15px;
  line-height:1.35;
  font-weight:750;
  color:var(--text);
}
.bm-meta {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:10px;
}
.bm-meta span {
  display:inline-flex;
  align-items:center;
  min-height:20px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-tertiary);
  font-size:11px;
  line-height:1.3;
}

.preference-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10, 12, 16, 0.36);
  backdrop-filter: blur(16px);
}
.preference-overlay.is-hidden {
  display: none;
}
.preference-panel {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255,255,255,0.94);
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 28px 80px rgba(0,0,0,0.22);
}
.preference-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(0,0,0,0.05);
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.preference-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.preference-title {
  font-size: 24px;
  line-height: 1.18;
  font-weight: 760;
  color: var(--text);
  margin-right: 36px;
}
.preference-subtitle {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}
.preference-group {
  margin-top: 20px;
}
.preference-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.preference-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preference-chip {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.preference-chip.is-selected {
  border-color: rgba(0,122,255,0.38);
  background: rgba(0,122,255,0.1);
  color: var(--accent);
  font-weight: 650;
}
.preference-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
.preference-secondary,
.preference-primary {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.preference-secondary {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
}
.preference-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .preference-panel {
  background: rgba(28,28,30,0.96);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .preference-close {
  background: rgba(255,255,255,0.08);
}
.bm-card .bm-time { font-size:11px; color:var(--text-tertiary); margin-left:auto; }
.bm-card .bm-act { cursor:pointer; color:var(--text-tertiary); background:transparent; border:0; font-size:13px; padding:2px 4px; border-radius:4px; opacity:0; transition:opacity 0.15s,color 0.15s,background 0.15s; font-family:inherit; line-height:1.2; }
.bm-card:hover .bm-act { opacity:1; }
.bm-card .bm-act:hover { color:var(--accent); background:rgba(0,122,255,0.08); }
.bm-card .bm-act.danger:hover { color:var(--red); background:rgba(255,59,48,0.08); }

.bm-card .bm-body { position:relative; }
.bm-card .bm-summary { font-size:var(--fs-base); color:var(--text-secondary); line-height:1.55; max-height:4.65em; overflow:hidden; cursor:pointer; }
.bm-card .bm-full { display:none; font-size:var(--fs-base); color:var(--text); line-height:1.7; margin-top:10px; padding:14px; background:var(--surface2); border-radius:10px; white-space:pre-wrap; word-wrap:break-word; }
.bm-card[data-expanded="1"] .bm-summary { display:none; }
.bm-card[data-expanded="1"] .bm-full { display:block; }

.bm-card .bm-footer { margin-top:8px; }
.bm-card .bm-hint { font-size:var(--fs-sm); color:var(--accent); cursor:pointer; display:inline; }
.bm-card .bm-closeh { font-size:var(--fs-sm); color:var(--accent); cursor:pointer; display:none; }
.bm-card[data-expanded="1"] .bm-hint { display:none; }
.bm-card[data-expanded="1"] .bm-closeh { display:inline; }
.bm-card .bm-comments { display:none; margin-top:14px; padding-top:14px; border-top:1px solid var(--border); }
.bm-card[data-expanded="1"] .bm-comments { display:block; }
.bm-card .bm-cmt { margin-bottom:8px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.bm-card .bm-cmt:last-child { border-bottom:none; margin-bottom:0; }
.bm-card .bm-cmt-author { font-size:var(--fs-sm); font-weight:600; color:var(--accent); }
.bm-card .bm-cmt-text { font-size:var(--fs-base); color:var(--text-secondary); margin-top:2px; line-height:1.5; }

.bm-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; flex:1; color:var(--text-tertiary); gap:12px; padding:40px; }
.bm-empty svg { width:48px; height:48px; stroke:var(--text-tertiary); }


/* ===== Eve Shell Polish ===== */
.main { background:var(--bg); }
.sidebar {
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  border-right:1px solid var(--border-light);
  backdrop-filter:blur(20px) saturate(1.2);
  -webkit-backdrop-filter:blur(20px) saturate(1.2);
}
.sidebar .logo {
  border-radius:9px;
  box-shadow:none;
}
.sidebar .user-logo {
  position:relative;
  flex:0 0 40px;
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.sidebar .tab {
  border:1px solid transparent;
}
.sidebar .tab:hover {
  background:var(--surface2);
  border-color:var(--border);
}
.sidebar .tab.active {
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}
.header {
  min-height:48px;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom:none;
  backdrop-filter:blur(20px) saturate(1.2);
  -webkit-backdrop-filter:blur(20px) saturate(1.2);
}
.header .title {
  font-size:14px;
  font-weight:650;
}
.header .status {
  color:var(--text-tertiary);
}
.chat {
  background:var(--bg);
}
.msg {
  border-radius:12px;
  box-shadow:none;
}
.msg.assistant {
  background:var(--surface);
  border-color:var(--border);
}
.msg.user {
  background:var(--accent);
  color:#fff;
}
.input-wrap {
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  border-top:1px solid var(--border-light);
  backdrop-filter:blur(20px) saturate(1.2);
  -webkit-backdrop-filter:blur(20px) saturate(1.2);
}
.chat-input-container {
  border-radius:14px;
  border-color:var(--border);
  box-shadow:none;
}
.chat-input-container:focus-within {
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(0,122,255,0.1);
}
.apps-toolbar,
#panelBookmark > div:first-child {
  background:var(--bg);
}
.apps-panel {
  background:var(--bg);
}
.apps-grid {
  gap:10px 4px;
}
.app-card {
  --app-accent:#007aff;
  --app-accent-soft:color-mix(in srgb, var(--app-accent) 12%, var(--surface));
  --app-accent-border:color-mix(in srgb, var(--app-accent) 20%, var(--border));
  background:var(--surface);
  border:1px solid color-mix(in srgb, var(--border) 84%, transparent);
  box-shadow:0 10px 28px rgba(0,0,0,0.05), 0 1px 0 rgba(255,255,255,0.65) inset;
  border-radius:16px;
  padding:10px 6px 8px;
  gap:6px;
  min-height:92px;
}
.app-card[data-theme="media"] { --app-accent:#ff9500; }
.app-card[data-theme="learn"] { --app-accent:#5856d6; }
.app-card[data-theme="business"] { --app-accent:#34c759; }
.app-card[data-theme="game"] { --app-accent:#ff3b30; }
.app-card[data-theme="news"] { --app-accent:#af52de; }
.app-card[data-theme="core"] { --app-accent:#007aff; }
.app-card:hover {
  border-color:color-mix(in srgb, var(--app-accent) 34%, var(--border));
  box-shadow:0 14px 34px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.72) inset;
  transform:translateY(-2px);
}
.app-card:active { transform:translateY(1px) scale(0.985); opacity:0.92; }
.app-card:hover .app-icon { transform:translateY(-1px) scale(1.02); }
.app-icon {
  width:56px;
  height:56px;
  border-radius:15px;
  border:1px solid var(--app-accent-border);
  background:var(--app-accent-soft);
  color:var(--app-accent);
  box-shadow:0 8px 18px color-mix(in srgb, var(--app-accent) 8%, transparent);
  transition:transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.app-icon svg { width:28px; height:28px; display:block; }
.app-name {
  color:var(--text);
  letter-spacing:0;
  font-size:11px;
  font-weight:600;
}
.preview-bar {
  min-height:42px;
  background:color-mix(in srgb, var(--bg) 90%, transparent);
  border-bottom:1px solid var(--border-light);
}
.preview-bar .back,
.preview-bar .preview-btn {
  border:1px solid var(--border);
  background:var(--surface);
  color:var(--text-secondary);
}
.preview-bar .back:hover,
.preview-bar .preview-btn:hover {
  border-color:var(--accent);
  background:rgba(0,122,255,0.08);
  color:var(--accent);
}
.preview-panel.preview-panel--embedded .preview-bar {
  min-height: 34px;
  padding: 6px 10px;
}
.preview-panel.preview-panel--embedded .preview-url {
  display: none;
}
.preview-panel.preview-panel--embedded .preview-bar .back,
.preview-panel.preview-panel--embedded .preview-bar .preview-btn {
  min-height: 26px;
  padding: 0 8px;
}
.preview-panel.preview-panel--no-chrome .preview-bar {
  display:none;
}
.preview-panel.preview-panel--no-chrome .preview-frame {
  min-height:0;
}
.bm-card {
  border-radius:12px;
  box-shadow:none;
}
.bm-card:hover {
  box-shadow:none;
}
.filter-btn {
  letter-spacing:0;
}

/* ===== Shell Layout Refinements ===== */
.sidebar-spacer { flex:1; }
.shortcuts {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:10px 4px;
  width:40px;
  border-top:1px solid var(--border-light);
  border-bottom:1px solid var(--border-light);
  margin:6px 0 8px;
  border-radius:14px;
  background:var(--surface2);
  overflow:hidden;
}
#userAvatar {
  display:none;
  width:100%;
  height:100%;
  border-radius:50%;
  object-fit:cover;
  position:absolute;
  inset:0;
}
#userIcon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  line-height:1;
  font-size:20px;
}
.chat-welcome {
  display:none;
  width:100%;
  max-width:820px;
  margin:auto;
  padding:34px 20px;
  text-align:left;
}
.command-kicker {
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:0 8px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text-secondary);
  font-size:11px;
  font-weight:600;
  margin-bottom:12px;
}
.welcome-title {
  font-size:24px;
  font-weight:700;
  margin-bottom:6px;
  color:var(--text);
}
.welcome-subtitle {
  font-size:13px;
  color:var(--text-secondary);
  margin-bottom:22px;
  line-height:1.6;
  max-width:620px;
}
.workspace-switcher {
  display:none;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 18px;
}
.workspace-switcher__item {
  display:inline-flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  min-height:40px;
  padding:8px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
  color:var(--text);
  font-family:inherit;
  cursor:pointer;
  transition:all var(--transition);
}
.workspace-switcher__item span {
  font-size:12px;
  font-weight:700;
  line-height:1.2;
}
.workspace-switcher__item em {
  margin-top:2px;
  font-style:normal;
  font-size:10px;
  line-height:1.2;
  color:var(--text-secondary);
}
.workspace-switcher__item:hover {
  border-color:var(--accent);
  background:var(--accent-light);
}
.workspace-switcher__item.active {
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
  box-shadow:0 10px 18px rgba(0,122,255,0.16);
}
.workspace-switcher__item.active em {
  color:rgba(255,255,255,0.8);
}
.workspace-attraction {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin:0 0 18px;
}
.workspace-attraction.eve-home-grid {
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
.workspace-attraction__item {
  min-height:138px;
  padding:13px;
  border:1px solid var(--border);
  border-radius:8px;
  background:linear-gradient(180deg, rgba(255,255,255,0.95), rgba(250,250,250,0.92));
  color:var(--text);
  font-family:inherit;
  text-align:left;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  transition:all var(--transition);
}
.workspace-attraction__item:hover {
  border-color:var(--accent);
  box-shadow:0 12px 28px rgba(0,122,255,0.12);
  transform:translateY(-1px);
}
.workspace-attraction__head {
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:10px;
}
.workspace-attraction__avatar {
  width:34px;
  height:34px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--text);
  color:var(--surface);
  font-size:14px;
  font-weight:800;
  flex-shrink:0;
}
.workspace-attraction__label {
  min-height:22px;
  padding:0 7px;
  display:inline-flex;
  align-items:center;
  border-radius:7px;
  background:var(--accent-light);
  color:var(--accent);
  font-size:10px;
  font-weight:700;
}
.workspace-attraction__item strong,
.workspace-attraction__item em,
.workspace-attraction__item small {
  display:block;
  font-style:normal;
  line-height:1.4;
}
.workspace-attraction__item strong {
  font-size:15px;
  font-weight:800;
  color:var(--text);
}
.workspace-attraction__item em {
  margin-top:5px;
  font-size:12px;
  color:var(--text-secondary);
}
.workspace-attraction__item small {
  margin-top:auto;
  padding-top:12px;
  color:var(--accent);
  font-size:12px;
  font-weight:700;
}
[data-theme="dark"] .workspace-attraction__item {
  background:linear-gradient(180deg, rgba(44,44,46,0.98), rgba(28,28,30,0.92));
}
[data-theme="dark"] .workspace-attraction__avatar {
  background:var(--text);
  color:var(--bg);
}
.welcome-note-wrap { margin-top:16px; }
.welcome-note {
  font-size:11px;
  color:var(--text-tertiary);
  max-width:400px;
  margin:0 auto;
}
.expert-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  max-width:420px;
  margin:0 auto;
  text-align:left;
}
.expert-card {
  min-height:82px;
  border-radius:12px;
}
.expert-card .ec-role {
  line-height:1.35;
  margin-top:3px;
}
.command-status-grid {
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-bottom:22px;
}
.command-status-card {
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  min-height:76px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
  font-family:inherit;
  text-align:left;
  cursor:pointer;
}
.command-status-card:hover {
  border-color:var(--accent);
  background:var(--accent-light);
}
.command-status-label {
  font-size:12px;
  font-weight:650;
  color:var(--text-secondary);
}
.command-status-card strong {
  font-size:18px;
  font-weight:650;
  color:var(--text);
  margin-top:10px;
}
.command-section {
  margin-top:18px;
}
.command-section-title {
  font-size:12px;
  font-weight:700;
  color:var(--text-secondary);
  margin-bottom:9px;
}
.command-action-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.command-action {
  display:flex;
  align-items:center;
  gap:12px;
  min-height:72px;
  padding:12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
  font-family:inherit;
  text-align:left;
  cursor:pointer;
}
.command-action:hover {
  border-color:var(--accent);
  background:var(--accent-light);
}
.command-action-icon {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:34px;
  min-width:34px;
  height:34px;
  border-radius:8px;
  background:var(--surface2);
  color:var(--accent);
  font-size:16px;
}
.command-action strong,
.command-action em {
  display:block;
  font-style:normal;
  line-height:1.35;
}
.command-action strong {
  font-size:14px;
  font-weight:700;
}
.command-action em {
  margin-top:2px;
  font-size:12px;
  color:var(--text-secondary);
}
.command-section--split {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.command-tool-row,
.command-persona-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.command-tool-row button,
.command-persona-row button {
  min-height:34px;
  padding:0 11px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text-secondary);
  font-size:12px;
  font-family:inherit;
  cursor:pointer;
}
.command-tool-row button:hover,
.command-persona-row button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}

.deepthink-host {
  display:block;
  margin:0 0 18px;
}
#panelChat.deepthink-mode .thread-bar {
  display:none;
}
#chatWelcome.deepthink-mode {
  padding-top:18px;
}
#chatWelcome.deepthink-mode .workspace-switcher,
#chatWelcome.deepthink-mode .command-status-grid,
#chatWelcome.deepthink-mode .command-section {
  display:none;
}
#chatWelcome.deepthink-mode .welcome-title {
  margin-bottom:8px;
}
.chat-welcome.chat-home-minimal {
  min-height:auto;
  display:block !important;
  text-align:left;
  padding-top:26px;
  padding-bottom:32px;
}
.chat-welcome.chat-home-minimal .command-kicker {
  display:inline-flex;
}
.chat-welcome.chat-home-minimal .welcome-subtitle {
  display:block;
  max-width:720px;
  margin-bottom:18px;
}
.chat-welcome.chat-home-minimal .welcome-title {
  max-width:760px;
  margin:0 0 6px;
  color:var(--text);
  font-size:26px;
  line-height:1.22;
  font-weight:750;
}
.chat-welcome.chat-home-minimal .workspace-switcher {
  display:none !important;
}
.chat-welcome.chat-home-minimal .workspace-attraction {
  margin-top:10px;
}
.chat-welcome.chat-thread-empty {
  display:flex !important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  min-height:48vh;
  max-width:720px;
  padding:12vh 20px 32px;
  text-align:center;
}
.chat-welcome.chat-thread-empty .command-kicker,
.chat-welcome.chat-thread-empty .workspace-switcher,
.chat-welcome.chat-thread-empty .workspace-attraction,
.chat-welcome.chat-thread-empty .command-status-grid,
.chat-welcome.chat-thread-empty .command-section {
  display:none !important;
}
.chat-welcome.chat-thread-empty .welcome-title {
  margin:0 0 8px;
  color:var(--text);
  font-size:28px;
  line-height:1.18;
  font-weight:750;
}
.chat-welcome.chat-thread-empty .welcome-subtitle {
  display:block;
  max-width:520px;
  margin:0 auto;
  color:var(--text-tertiary);
  font-size:13px;
  line-height:1.65;
}
.eve-home-card {
  min-height:124px;
}
.eve-home-card strong,
.eve-home-card em {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.eve-home-card strong {
  -webkit-line-clamp:2;
}
.eve-home-card em {
  -webkit-line-clamp:2;
}
.workspace-attraction.founder-cockpit-grid {
  grid-template-columns:repeat(6, minmax(0, 1fr));
}
.founder-cockpit-grid .eve-home-card--primary {
  grid-column:span 3;
  min-height:132px;
}
.founder-cockpit-grid .eve-home-card--compact {
  grid-column:span 2;
}
.eve-home-card--tone-action {
  border-left:3px solid #0a84ff;
}
.eve-home-card--tone-inbox {
  border-left:3px solid #34c759;
}
.eve-home-card--tone-capture {
  border-left:3px solid #ff9f0a;
}
.eve-home-card--tone-think {
  border-left:3px solid #af52de;
}
.eve-home-card--tone-project {
  border-left:3px solid #5e5ce6;
}
.eve-home-card--tone-memory {
  border-left:3px solid #64d2ff;
}
.chat-welcome.chat-home-minimal .command-status-grid {
  grid-template-columns:repeat(5, minmax(0, 1fr));
}
.chat-welcome.chat-home-minimal .command-status-card strong {
  max-width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.workspace-attraction__item--empty {
  border-style:dashed;
  background:var(--surface);
}
.workspace-attraction__item--empty strong {
  color:var(--text-secondary);
}
.deepthink-host .workspace-attraction__item,
.deepthink-host .workspace-attraction {
  margin-bottom:0;
}
.deepthink-workbench {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 260px);
  gap:14px;
  align-items:start;
  min-width:0;
  max-width:100%;
  overflow-x:hidden;
}
.deepthink-threadbar {
  grid-column:1 / -1;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  padding:10px;
}
.deepthink-threadbar__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:800;
}
.deepthink-threadbar__head button {
  border:1px solid rgba(120,120,128,0.18);
  background:rgba(255,255,255,0.84);
  color:var(--text-primary);
  border-radius:999px;
  min-height:30px;
  padding:0 12px;
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.deepthink-thread-list {
  display:flex;
  gap:8px;
  overflow-x:auto;
  overflow-y:hidden;
  max-width:100%;
  min-width:0;
  padding-bottom:2px;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
}
.deepthink-thread-item {
  display:grid;
  grid-template-columns:minmax(130px, 1fr) 28px 28px;
  align-items:center;
  gap:4px;
  min-width:220px;
  max-width:280px;
  border:1px solid rgba(120,120,128,0.15);
  border-radius:12px;
  background:var(--surface2);
  padding:5px;
}
.deepthink-thread-item.active {
  border-color:rgba(55,114,255,0.38);
  background:rgba(55,114,255,0.08);
}
.deepthink-thread-item__main {
  min-width:0;
  border:0;
  background:transparent;
  text-align:left;
  color:var(--text-primary);
  font:inherit;
  cursor:pointer;
  padding:5px 7px;
}
.deepthink-thread-item__main strong,
.deepthink-thread-item__main span {
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.deepthink-thread-item__main strong {
  font-size:13px;
  font-weight:800;
}
.deepthink-thread-item__main span {
  margin-top:2px;
  color:var(--text-tertiary);
  font-size:11px;
  font-weight:700;
}
.deepthink-thread-item__icon {
  width:28px;
  height:28px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text-tertiary);
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.deepthink-thread-item__icon:hover {
  background:rgba(120,120,128,0.12);
  color:var(--text-primary);
}
.deepthink-thread-item__icon.danger:hover {
  color:#ff3b30;
}
.deepthink-flow {
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  gap:8px;
  margin-bottom:2px;
  color:var(--text-secondary);
  font-size:11px;
  font-weight:700;
}
.deepthink-flow__step {
  min-height:24px;
  padding:0 9px;
  display:inline-flex;
  align-items:center;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
}
.deepthink-flow__step--active {
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-light);
}
.deepthink-flow__arrow {
  color:var(--text-tertiary);
}
.deepthink-workbench__hint {
  margin:0 0 10px;
  color:var(--text-secondary);
  font-size:11px;
  line-height:1.45;
}
.deepthink-panel-meta {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:0 0 10px;
}
.deepthink-panel-meta span {
  min-height:24px;
  display:inline-flex;
  align-items:center;
  padding:0 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-size:11px;
  font-weight:700;
}
.deepthink-next-step {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 12px;
  padding:11px 12px;
  border:1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius:12px;
  background:color-mix(in srgb, var(--accent-light) 46%, var(--surface));
}
.deepthink-next-step div:first-child {
  min-width:0;
}
.deepthink-next-step span {
  display:block;
  color:var(--accent);
  font-size:10px;
  font-weight:800;
  line-height:1;
  margin-bottom:5px;
}
.deepthink-next-step strong {
  display:block;
  color:var(--text);
  font-size:14px;
  font-weight:800;
  line-height:1.25;
}
.deepthink-next-step p {
  margin:4px 0 0;
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.45;
}
.deepthink-next-step__actions {
  display:flex;
  align-items:center;
  gap:7px;
  flex:0 0 auto;
}
.deepthink-next-step__actions button {
  min-height:32px;
  padding:0 10px;
  border:1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius:9px;
  background:var(--surface);
  color:var(--accent);
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.deepthink-next-step__actions button:first-child {
  background:var(--accent);
  border-color:var(--accent);
  color:#fff;
}
.deepthink-next-step__actions button:disabled {
  cursor:wait;
  opacity:0.58;
}
.deepthink-todo-result {
  min-height:38px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:0 0 10px;
  padding:7px 9px 7px 11px;
  border:1px solid color-mix(in srgb, #34c759 26%, var(--border));
  border-radius:10px;
  background:color-mix(in srgb, #34c759 9%, var(--surface));
  color:#1f8f45;
  font-size:12px;
  font-weight:750;
}
.deepthink-todo-result button {
  min-height:28px;
  padding:0 9px;
  border:1px solid color-mix(in srgb, #34c759 30%, var(--border));
  border-radius:8px;
  background:var(--surface);
  color:#1f8f45;
  font:inherit;
  font-size:11px;
  font-weight:750;
  cursor:pointer;
}
.deepthink-todo-result button:hover {
  background:color-mix(in srgb, #34c759 14%, var(--surface));
}
.deepthink-label__meta {
  margin-left:6px;
  color:var(--text-tertiary);
  font-weight:600;
}
.deepthink-editor,
.deepthink-suggestions {
  min-width:0;
  max-width:100%;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface);
}
.deepthink-editor {
  padding:14px;
}
.deepthink-suggestions {
  padding:12px;
}
.deepthink-label {
  display:block;
  margin-bottom:8px;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:700;
}
.deepthink-text-field {
  position:relative;
  min-width:0;
}
.deepthink-expand-btn {
  position:absolute;
  right:8px;
  bottom:8px;
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(120,120,128,0.2);
  border-radius:8px;
  background:rgba(255,255,255,0.86);
  color:var(--text-tertiary);
  font:inherit;
  font-size:14px;
  line-height:1;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(0,0,0,0.06);
}
.deepthink-expand-btn:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}
.deepthink-question {
  width:100%;
  min-height:72px;
  max-height:180px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  resize:vertical;
  border:1px solid var(--border);
  border-radius:8px;
  padding:12px 44px 12px 12px;
  background:var(--surface2);
  color:var(--text);
  font:inherit;
  font-size:18px;
  font-weight:700;
  line-height:1.45;
  outline:none;
}
.deepthink-question:focus,
.deepthink-block textarea:focus {
  border-color:var(--accent);
  box-shadow:var(--focus-ring);
}
.deepthink-files {
  margin:12px 0 14px;
  border:1px solid rgba(120,120,128,0.18);
  border-radius:16px;
  background:rgba(255,255,255,0.62);
  padding:10px;
}
.deepthink-files__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:700;
}
.deepthink-files__head button,
.deepthink-file-item__actions button {
  border:1px solid rgba(120,120,128,0.18);
  background:rgba(255,255,255,0.84);
  color:var(--text-primary);
  border-radius:999px;
  min-height:30px;
  padding:0 11px;
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.deepthink-file-list { display:grid; gap:8px; }
.deepthink-file-item {
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  border:1px solid rgba(120,120,128,0.14);
  border-radius:14px;
  background:rgba(248,248,250,0.92);
  padding:10px 10px 10px 12px;
}
.deepthink-file-item__main { min-width:0; }
.deepthink-file-item__main strong,
.deepthink-file-item__main span,
.deepthink-file-item__main p {
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
}
.deepthink-file-item__main strong {
  color:var(--text-primary);
  font-size:13px;
  white-space:nowrap;
}
.deepthink-file-item__main span {
  color:var(--text-tertiary);
  font-size:11px;
  font-weight:700;
  margin-top:2px;
}
.deepthink-file-item__main p {
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.45;
  margin:6px 0 0;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  white-space:normal;
}
.deepthink-file-item__actions {
  display:flex;
  align-items:center;
  gap:6px;
}
.deepthink-file-source-meta {
  padding:0 18px 10px;
  color:var(--text-tertiary);
  font-size:12px;
}
.deepthink-file-source {
  flex:1;
  min-height:0;
  margin:0 18px 14px;
  padding:14px;
  overflow:auto;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface2);
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  line-height:1.65;
}
.deepthink-file-item.is-loading { opacity:0.72; }
.deepthink-file-item.is-error {
  border-color:rgba(255,59,48,0.22);
  background:rgba(255,59,48,0.06);
}
.deepthink-file-empty {
  border:1px dashed rgba(120,120,128,0.24);
  border-radius:12px;
  padding:12px;
  color:var(--text-tertiary);
  font-size:12px;
  line-height:1.5;
}
.deepthink-blocks {
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.deepthink-empty-blocks {
  margin-top:12px;
  padding:12px;
  border:1px dashed var(--border);
  border-radius:10px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.5;
}
.deepthink-empty-blocks strong,
.deepthink-empty-blocks span {
  display:block;
}
.deepthink-empty-blocks strong {
  color:var(--text);
  font-size:13px;
  margin-bottom:4px;
}
.deepthink-empty-blocks div {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.deepthink-empty-blocks button {
  min-height:30px;
  padding:0 9px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  font-size:11px;
  font-weight:750;
  cursor:pointer;
}
.deepthink-empty-blocks button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}
.deepthink-block {
  display:grid;
  grid-template-columns:68px minmax(0, 1fr) auto;
  gap:8px;
  align-items:start;
}
.deepthink-block__tools {
  display:flex;
  flex-direction:column;
  gap:4px;
  align-items:center;
  min-width:30px;
}
.deepthink-block__tools--wide {
  min-width:64px;
  align-items:stretch;
}
.deepthink-block--question {
  grid-template-columns:68px minmax(0, 1fr);
}
.deepthink-block--question .deepthink-block__tools {
  grid-column:2;
  flex-direction:row;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-start;
  min-width:0;
}
.deepthink-block__type {
  min-height:34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:8px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-size:12px;
  font-weight:700;
}
.deepthink-block textarea {
  width:100%;
  min-height:42px;
  resize:vertical;
  border:1px solid var(--border);
  border-radius:8px;
  padding:9px 42px 9px 10px;
  background:var(--surface);
  color:var(--text);
  font:inherit;
  font-size:13px;
  line-height:1.45;
  outline:none;
}
.deepthink-block button,
.deepthink-block__tools button {
  min-width:30px;
  height:34px;
  padding:0 8px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text-tertiary);
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.deepthink-block button:hover,
.deepthink-block__tools button:hover {
  background:var(--surface2);
  color:var(--text);
}
.deepthink-block__tools--wide button {
  width:auto;
  min-width:54px;
  height:30px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-size:12px;
}
.deepthink-block__tools--wide button:hover {
  background:var(--accent-light);
  color:var(--accent);
}
.deepthink-block-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.deepthink-block-actions button,
.deepthink-suggestions button {
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
  font:inherit;
  cursor:pointer;
}
.deepthink-block-actions button {
  min-height:32px;
  padding:0 10px;
  color:var(--text-secondary);
  font-size:12px;
}
.deepthink-block-actions button:hover,
.deepthink-suggestions button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
}
.deepthink-suggestions {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.deepthink-assist-generate {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}
.deepthink-assist-generate button {
  min-height:60px;
  padding:10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.deepthink-assist-generate button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
}
.deepthink-assist-generate button:disabled,
.deepthink-assist-actions button:disabled,
.deepthink-file-item__actions button:disabled,
.deepthink-block__tools button:disabled,
.deepthink-block-actions button:disabled {
  cursor:wait;
  opacity:0.58;
  background:var(--surface2);
  color:var(--text-tertiary);
  border-color:var(--border);
}
.deepthink-assist-generate strong,
.deepthink-assist-generate span {
  display:block;
  line-height:1.35;
}
.deepthink-assist-generate strong {
  font-size:12px;
  font-weight:800;
}
.deepthink-assist-generate span {
  margin-top:4px;
  color:var(--text-secondary);
  font-size:10px;
}
.deepthink-assist-prompt {
  width:100%;
  min-height:132px;
  resize:vertical;
  border:1px solid var(--border);
  border-radius:8px;
  padding:11px 42px 11px 12px;
  background:var(--surface2);
  color:var(--text);
  font:inherit;
  font-size:12px;
  line-height:1.55;
  outline:none;
}
.deepthink-assist-prompt:focus {
  border-color:var(--accent);
  box-shadow:var(--focus-ring);
}
.deepthink-assist-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.deepthink-assist-actions button {
  min-height:32px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  cursor:pointer;
}
.deepthink-assist-actions button:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}
.deepthink-assist-generate button:disabled:hover,
.deepthink-assist-actions button:disabled:hover,
.deepthink-file-item__actions button:disabled:hover,
.deepthink-block__tools button:disabled:hover,
.deepthink-block-actions button:disabled:hover {
  border-color:var(--border);
  background:var(--surface2);
  color:var(--text-tertiary);
}
.deepthink-ai-busy {
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 10px;
  border:1px solid rgba(0,122,255,0.18);
  border-radius:10px;
  background:rgba(0,122,255,0.06);
  color:var(--text-secondary);
  font-size:12px;
}
.deepthink-ai-busy span,
.deepthink-loading-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 0 rgba(0,122,255,0.34);
  animation:deepThinkPulse 1.1s ease-in-out infinite;
  flex:0 0 8px;
}
.deepthink-ai-busy strong {
  color:var(--text);
  font-size:12px;
}
.deepthink-ai-busy em {
  margin-left:auto;
  color:var(--text-tertiary);
  font-style:normal;
  font-size:11px;
}
.deepthink-loading-dot {
  display:inline-block;
  margin-right:8px;
  vertical-align:middle;
}
@keyframes deepThinkPulse {
  0% { transform:scale(0.9); box-shadow:0 0 0 0 rgba(0,122,255,0.34); opacity:0.65; }
  70% { transform:scale(1); box-shadow:0 0 0 7px rgba(0,122,255,0); opacity:1; }
  100% { transform:scale(0.9); box-shadow:0 0 0 0 rgba(0,122,255,0); opacity:0.65; }
}
.deepthink-ai-list {
  display:flex;
  flex-direction:column;
  gap:8px;
}
.deepthink-ai-card {
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface2);
  padding:10px;
}
.deepthink-ai-card.is-loading {
  border-color:rgba(0,122,255,0.2);
  background:rgba(0,122,255,0.05);
}
.deepthink-ai-card.is-error {
  border-color:rgba(255,59,48,0.18);
}
.deepthink-ai-card__head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:7px;
}
.deepthink-ai-card__head strong {
  color:var(--text);
  font-size:12px;
  font-weight:800;
}
.deepthink-ai-card__head span {
  color:var(--text-tertiary);
  font-size:10px;
  white-space:nowrap;
}
.deepthink-ai-card__head button {
  width:24px;
  height:24px;
  min-width:24px;
  min-height:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:999px;
  background:transparent;
  color:var(--text-tertiary);
  font:inherit;
  font-size:16px;
  line-height:1;
  cursor:pointer;
  flex:0 0 24px;
}
.deepthink-ai-card__head button:hover {
  background:rgba(255,59,48,0.1);
  color:var(--red);
}
.deepthink-ai-card p {
  margin:0;
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.55;
  white-space:pre-wrap;
}
.deepthink-ai-card__actions {
  display:flex;
  gap:6px;
  margin-top:9px;
}
.deepthink-ai-card__actions button {
  min-height:28px;
  padding:0 8px;
  border-radius:8px;
  font-size:11px;
}
.deepthink-empty-ai {
  padding:10px;
  border:1px dashed var(--border);
  border-radius:10px;
  color:var(--text-tertiary);
  font-size:12px;
  line-height:1.5;
}
.deepthink-text-modal {
  position:fixed;
  inset:0;
  z-index:10020;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,0.34);
  backdrop-filter:blur(14px);
}
.deepthink-text-modal__dialog {
  width:min(920px, 100%);
  height:min(78vh, 760px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(120,120,128,0.22);
  border-radius:18px;
  background:var(--surface);
  box-shadow:0 24px 80px rgba(0,0,0,0.22);
}
.deepthink-text-modal__dialog--source {
  width:min(980px, 100%);
}
.deepthink-text-modal__head,
.deepthink-text-modal__actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
}
.deepthink-text-modal__head strong {
  color:var(--text);
  font-size:15px;
  font-weight:800;
}
.deepthink-text-modal__mode {
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:2px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface2);
}
.deepthink-text-modal__mode button {
  min-height:28px;
  padding:0 10px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:750;
  cursor:pointer;
}
.deepthink-text-modal__mode button.active {
  background:var(--surface);
  color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,0.06);
}
.deepthink-text-modal__head button,
.deepthink-text-modal__actions button {
  min-height:34px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface2);
  color:var(--text-secondary);
  font:inherit;
  font-size:13px;
  font-weight:700;
  cursor:pointer;
}
.deepthink-text-modal__head button {
  width:34px;
  padding:0;
  font-size:20px;
}
.deepthink-text-modal__head .deepthink-text-modal__mode button {
  width:auto;
  min-height:28px;
  padding:0 10px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text-secondary);
  font-size:12px;
  line-height:1;
}
.deepthink-text-modal__head .deepthink-text-modal__mode button.active {
  background:var(--surface);
  color:var(--text);
  box-shadow:0 1px 4px rgba(0,0,0,0.06);
}
.deepthink-text-modal__actions {
  justify-content:flex-end;
  border-top:1px solid var(--border);
  border-bottom:0;
}
.deepthink-text-modal__actions button {
  padding:0 14px;
}
.deepthink-text-modal__actions button[data-save="1"] {
  border-color:var(--accent);
  background:var(--accent);
  color:#fff;
}
.deepthink-text-modal textarea {
  flex:1;
  width:100%;
  min-height:0;
  resize:none;
  border:0;
  background:var(--surface);
  color:var(--text);
  outline:none;
  padding:16px;
  font:inherit;
  font-size:16px;
  line-height:1.65;
}
.deepthink-md-preview {
  display:none;
  flex:1;
  min-height:0;
  overflow:auto;
  padding:20px 22px 28px;
  background:var(--surface);
  color:var(--text);
  font-size:15px;
  line-height:1.78;
}
.deepthink-md-preview p {
  margin:0 0 12px;
}
.deepthink-md-preview h2,
.deepthink-md-preview h3,
.deepthink-md-preview h4,
.deepthink-md-preview h5 {
  margin:18px 0 8px;
  color:var(--text);
  line-height:1.35;
}
.deepthink-md-preview h2 { font-size:21px; }
.deepthink-md-preview h3 { font-size:18px; }
.deepthink-md-preview h4,
.deepthink-md-preview h5 { font-size:16px; }
.deepthink-md-preview ul {
  margin:0 0 14px 20px;
  padding:0;
}
.deepthink-md-preview li {
  margin:5px 0;
}
.deepthink-md-preview blockquote {
  margin:10px 0 14px;
  padding:8px 12px;
  border-left:3px solid var(--accent);
  background:var(--surface2);
  color:var(--text-secondary);
  border-radius:8px;
}
.deepthink-md-preview hr {
  border:0;
  border-top:1px solid var(--border);
  margin:18px 0;
}
.deepthink-md-preview table {
  width:100%;
  border-collapse:collapse;
  margin:12px 0 16px;
  font-size:14px;
}
.deepthink-md-preview th,
.deepthink-md-preview td {
  border:1px solid var(--border);
  padding:8px 10px;
  vertical-align:top;
}
.deepthink-md-preview th,
.deepthink-md-preview tr:first-child td {
  background:var(--surface2);
  color:var(--text);
  font-weight:750;
}
.deepthink-md-preview a {
  color:var(--accent);
  text-decoration:none;
  font-weight:650;
}
.deepthink-wikilink {
  display:inline-flex;
  align-items:center;
  min-height:22px;
  padding:0 7px;
  border-radius:999px;
  background:var(--accent-light);
  color:var(--accent);
  font-size:0.92em;
  font-weight:750;
}
.deepthink-taskbox {
  width:15px;
  height:15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-right:7px;
  border:1.5px solid var(--border);
  border-radius:4px;
  vertical-align:-2px;
}
.deepthink-taskbox.is-checked {
  border-color:var(--accent);
  background:var(--accent);
}
.deepthink-taskbox.is-checked::after {
  content:'';
  width:6px;
  height:9px;
  border:solid #fff;
  border-width:0 2px 2px 0;
  transform:rotate(45deg) translateY(-1px);
}
.deepthink-md-preview code {
  padding:1px 5px;
  border-radius:6px;
  background:var(--surface2);
  color:var(--text);
  font-size:0.92em;
}
.deepthink-md-preview pre {
  margin:12px 0;
  padding:12px;
  border-radius:10px;
  background:var(--surface2);
  overflow:auto;
}
.deepthink-md-empty {
  color:var(--text-tertiary);
}
.deepthink-fold-toggle {
  width:100%;
  min-height:36px;
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--surface2);
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.deepthink-fold-toggle em {
  color:var(--text-tertiary);
  font-style:normal;
  font-size:11px;
  font-weight:700;
}
.deepthink-suggestion-list {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:8px;
}
.deepthink-suggestions button {
  padding:10px;
  text-align:left;
}
.deepthink-suggestions strong,
.deepthink-suggestions span {
  display:block;
  font-style:normal;
  line-height:1.4;
}
.deepthink-suggestions strong {
  color:var(--text);
  font-size:13px;
  font-weight:750;
}
.deepthink-suggestions span {
  margin-top:4px;
  color:var(--text-secondary);
  font-size:11px;
}
.deepthink-ai-card__actions button {
  padding:0 8px;
  text-align:center;
}
[data-theme="dark"] .deepthink-editor,
[data-theme="dark"] .deepthink-suggestions,
[data-theme="dark"] .deepthink-panel-meta span,
[data-theme="dark"] .deepthink-next-step,
[data-theme="dark"] .deepthink-block-actions button,
[data-theme="dark"] .deepthink-assist-generate button,
[data-theme="dark"] .deepthink-ai-card,
[data-theme="dark"] .deepthink-suggestions button,
[data-theme="dark"] .deepthink-assist-prompt,
[data-theme="dark"] .deepthink-threadbar,
[data-theme="dark"] .deepthink-threadbar__head button,
[data-theme="dark"] .deepthink-thread-item,
[data-theme="dark"] .deepthink-files,
[data-theme="dark"] .deepthink-file-item,
[data-theme="dark"] .deepthink-files__head button,
[data-theme="dark"] .deepthink-file-item__actions button,
[data-theme="dark"] .deepthink-assist-actions button {
  background:var(--surface);
}
[data-theme="dark"] .deepthink-expand-btn {
  background:rgba(28,28,30,0.88);
  border-color:rgba(255,255,255,0.12);
  box-shadow:0 8px 20px rgba(0,0,0,0.24);
}
[data-theme="dark"] .deepthink-next-step {
  border-color:rgba(64,156,255,0.22);
}

.toolbar-icon-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:32px;
  min-width:32px;
  height:32px;
  border:1px solid var(--border);
  border-radius:8px;
  background:var(--surface);
  color:var(--text-secondary);
  font-size:14px;
  font-family:inherit;
  cursor:pointer;
}
.toolbar-icon-btn:hover {
  border-color:var(--accent);
  background:var(--accent-light);
  color:var(--accent);
}
#searchClear { display:none; }

.apps-toolbar,
.bm-toolbar {
  padding:14px 24px 0;
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink:0;
}
.apps-search-wrap,
.bm-search-wrap {
  position:relative;
  flex:1;
  max-width:380px;
}
.apps-search-wrap .search-icon,
.bm-search-wrap .search-icon {
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-secondary);
  pointer-events:none;
}
#appsSearch,
#bmSearch {
  width:100%;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:10px;
  padding:9px 12px 9px 34px;
  font-size:13px;
  font-family:inherit;
  outline:none;
  color:var(--text);
}
#appsSearch:focus,
#bmSearch:focus {
  border-color:var(--accent);
}
.apps-count,
.bm-count {
  font-size:12px;
  color:var(--text-secondary);
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
}
.apps-panel,
.bm-panel {
  flex:1;
  overflow-y:auto;
  padding:18px 24px 24px;
  min-height:0;
}
.bm-filter-bar {
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:14px;
}
.bm-filter-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  min-height:28px;
}
.bm-filter-head span {
  color:var(--text-tertiary);
  font-size:12px;
  font-weight:700;
}
.bm-filter-toggle {
  min-height:28px;
  padding:0 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.bm-filter-toggle:hover {
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-light);
}
.bm-filter-list {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.bm-filter-list.is-collapsed {
  max-height:34px;
  overflow:hidden;
}
.bm-group-title {
  margin:18px 0 8px;
  padding:0 2px;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:800;
}
.bm-group-title:first-child {
  margin-top:0;
}
.bm-group-card {
  width:100%;
  min-height:118px;
  margin-bottom:10px;
  padding:16px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:5px 12px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  text-align:left;
  font:inherit;
  cursor:pointer;
}
.bm-group-card:hover {
  border-color:var(--accent);
  box-shadow:0 3px 12px rgba(0,122,255,0.08);
}
.bm-group-card span {
  grid-column:1 / -1;
  color:var(--text-tertiary);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
}
.bm-group-card strong {
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:17px;
  line-height:1.35;
  font-weight:800;
}
.bm-group-card em {
  align-self:start;
  padding:3px 9px;
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-style:normal;
  font-size:12px;
  font-weight:750;
}
.bm-group-card p {
  grid-column:1 / -1;
  margin:4px 0 0;
  color:var(--text-secondary);
  font-size:13px;
  line-height:1.55;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.bm-group-back {
  min-height:34px;
  margin:0 0 12px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  font-size:13px;
  font-weight:750;
  cursor:pointer;
}
.bm-group-back:hover {
  border-color:var(--accent);
  color:var(--accent);
  background:var(--accent-light);
}
.bm-view-tabs {
  display:grid;
  grid-template-columns:repeat(6, minmax(0, 1fr));
  gap:8px;
  margin-bottom:14px;
}
.bm-view-tab {
  min-height:46px;
  padding:8px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  color:var(--text-secondary);
  font:inherit;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.bm-view-tab span {
  font-size:13px;
  font-weight:700;
  color:var(--text);
}
.bm-view-tab em {
  min-width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-tertiary);
  font-style:normal;
  font-size:11px;
  font-weight:700;
}
.bm-view-tab.active {
  border-color:rgba(0,122,255,0.32);
  background:rgba(0,122,255,0.08);
  color:var(--accent);
}
.bm-view-tab.active span,
.bm-view-tab.active em {
  color:var(--accent);
}
.bm-empty {
  min-height:260px;
}
.bm-empty-title {
  margin:0;
  font-size:14px;
  color:var(--text-secondary);
}
.bm-empty-subtitle {
  margin:0;
  font-size:12px;
  color:var(--text-tertiary);
}
.preview-url {
  flex:1;
  min-width:0;
  margin-left:8px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:var(--text-secondary);
  font-size:12px;
  text-align:left;
}
.preview-frame {
  flex:1;
  width:100%;
  border:none;
  background:var(--surface);
}

.shortcut-pick {
  position:fixed;
  inset:auto 0 0 0;
  z-index:1000;
  padding:20px;
  background:rgba(0,0,0,0.36);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.shortcut-pick-sheet {
  max-width:320px;
  margin:0 auto;
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--surface);
  box-shadow:0 18px 45px rgba(0,0,0,0.16);
}
.shortcut-pick-sheet h4 {
  margin:0 0 8px;
  font-size:14px;
  color:var(--text);
}
.shortcut-pick-cancel {
  justify-content:center;
  color:var(--red);
  margin-top:4px;
}

.bm-cmt-title {
  font-size:12px;
  font-weight:650;
  color:var(--text-secondary);
  margin-bottom:10px;
}
.bm-cmt-muted,
.bm-cmt-error {
  font-size:12px;
  color:var(--text-tertiary);
  margin-bottom:8px;
}
.bm-cmt-error { color:var(--red); }
.bm-cmt-time {
  font-size:10px;
  color:var(--text-tertiary);
  margin-left:8px;
  white-space:nowrap;
}
.bm-cmt-actions { margin-top:6px; }
.bm-cmt-ai {
  border:1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  border-radius:7px;
  background:var(--surface);
  color:var(--accent);
  padding:4px 8px;
  font-size:11px;
  font-family:inherit;
}
.bm-cmt-ai:hover { background:var(--accent-light); }
.bm-cmt-form {
  display:flex;
  gap:8px;
  margin-top:12px;
}
.bm-cmt-form input {
  flex:1;
  min-width:0;
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 10px;
  font-size:12px;
  font-family:inherit;
  outline:none;
  color:var(--text);
  background:var(--surface);
}
.bm-cmt-form button {
  border:1px solid var(--accent);
  border-radius:8px;
  background:var(--accent);
  color:#fff;
  padding:8px 14px;
  font-size:12px;
  font-family:inherit;
}

@media (max-width:768px) {
  .apps-toolbar,
  .bm-toolbar {
    padding:12px 14px 0;
    gap:8px;
  }
  .apps-panel,
  .bm-panel {
    padding:14px;
  }
  .bm-view-tabs {
    grid-template-columns:repeat(3, minmax(0, 1fr));
  }
  .expert-grid {
    grid-template-columns:1fr;
  }
  .command-status-grid,
  .command-action-grid,
  .command-section--split {
    grid-template-columns:1fr;
  }
  .command-status-card,
  .command-action {
    min-height:66px;
  }
  .chat-welcome {
    padding:28px 16px;
  }
  .workspace-switcher {
    gap:6px;
    margin-bottom:14px;
  }
  .workspace-switcher__item {
    min-height:36px;
    padding:7px 10px;
  }
  .preview-bar {
    padding:6px 10px;
  }
  .preview-url {
    font-size:11px;
  }
  .bm-card {
    padding:14px;
  }
  .bm-card .bm-row {
    gap:6px;
  }
  .bm-card .bm-act {
    opacity:1;
  }
}

/* ===== Chat Experience Refinements ===== */
.chat {
  padding:28px clamp(18px, 9vw, 140px) 22px;
  gap:14px;
}
.msg,
.reasoning,
.thinking {
  width:fit-content;
}
.msg {
  max-width:min(760px, 100%);
  padding:13px 16px;
  border-radius:13px;
  font-size:14px;
  letter-spacing:0;
}
.msg-content {
  display:block;
  min-width:0;
}
.msg.assistant {
  max-width:min(760px, 100%);
  background:var(--surface);
  border:1px solid var(--border-light);
  color:var(--text);
  line-height:1.72;
}
.msg.user {
  max-width:min(620px, 88%);
  border:1px solid color-mix(in srgb, var(--accent) 80%, #fff);
  line-height:1.55;
}
.persona-badge {
  display:inline-flex;
  align-items:center;
  margin-right:6px;
  color:var(--accent);
  font-size:11px;
  font-weight:650;
  line-height:1;
}
.msg-actions {
  display:inline-flex;
  align-items:center;
  gap:3px;
  margin-left:8px;
  vertical-align:middle;
}
.copy-btn {
  width:26px;
  height:26px;
  margin-left:0;
  padding:0;
  justify-content:center;
  border:1px solid transparent;
  border-radius:7px;
  color:var(--text-tertiary);
}
.msg.assistant .copy-btn {
  opacity:0;
}
.msg.assistant:hover .copy-btn,
.msg.assistant:focus-within .copy-btn {
  opacity:1;
}
.copy-btn:hover {
  border-color:var(--border);
  background:var(--surface2);
  color:var(--accent);
}
.copy-btn.done {
  color:var(--green);
  border-color:color-mix(in srgb, var(--green) 28%, transparent);
  background:rgba(52,199,89,0.1);
  font-size:13px;
  font-weight:700;
}

.reasoning {
  max-width:min(760px, 100%);
  border:1px solid var(--border-light);
  border-radius:11px;
  background:color-mix(in srgb, var(--surface) 72%, transparent);
  overflow:hidden;
}
.reasoning-header {
  padding:8px 12px;
  color:var(--text-secondary);
}
.reasoning-time {
  margin-left:auto;
  font-size:11px;
}
.reasoning-body {
  margin:0;
  border-left:0;
  border-top:1px solid var(--border-light);
  border-radius:0;
  background:var(--surface2);
  color:var(--text-secondary);
  max-height:260px;
  overflow:auto;
}
.thinking {
  min-width:76px;
  min-height:38px;
  padding:10px 14px;
  border-color:var(--border-light);
  box-shadow:none;
}

.input-wrap {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:14px clamp(16px, 9vw, 140px) 16px;
}
.file-preview,
.dropdown,
.chat-input-container,
.chat-model-bar,
#personaMenu {
  width:min(780px, 100%);
}
.file-preview {
  margin-bottom:0;
}
.chat-input-container {
  min-height:60px;
  align-items:flex-end;
  gap:7px;
  padding:8px;
  border-radius:24px;
  border-color:color-mix(in srgb, var(--border) 84%, transparent);
  background:color-mix(in srgb, var(--surface) 96%, var(--bg));
  box-shadow:0 12px 34px rgba(0,0,0,0.06), 0 1px 0 rgba(255,255,255,0.72) inset;
  transition:border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.chat-input-container:focus-within {
  border-color:color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow:0 16px 44px rgba(0,0,0,0.08), 0 0 0 3px rgba(0,122,255,0.1);
}
.chat-input-container textarea {
  flex:1;
  min-height:32px;
  padding:8px 2px;
  line-height:1.48;
  font-size:14px;
}
.voice-conversation-status {
  align-self:flex-end;
  margin:0 2px -2px 0;
  padding:9px 16px;
  border-radius:999px;
  background:var(--surface2);
  color:var(--text-secondary);
  font-size:13px;
  font-weight:600;
}
.voice-draft {
  display:none;
  flex:1;
  min-width:0;
  align-items:center;
  gap:12px;
  min-height:38px;
  padding:0 4px;
}
.voice-draft__wave {
  flex:1;
  min-width:120px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:3px;
  overflow:hidden;
}
.voice-draft__wave::before,
.voice-draft__wave::after {
  content:'';
  height:2px;
  flex:1;
  min-width:28px;
  background:radial-gradient(circle, currentColor 1px, transparent 1.5px) 0 50% / 6px 2px repeat-x;
  opacity:.38;
}
.voice-draft__wave i {
  width:3px;
  height:14px;
  border-radius:99px;
  background:currentColor;
  animation:voiceDraftPulse .72s ease-in-out infinite alternate;
}
.voice-draft__wave i:nth-child(2n) { height:21px; animation-delay:.08s; }
.voice-draft__wave i:nth-child(3n) { height:27px; animation-delay:.16s; }
.voice-draft__wave i:nth-child(4n) { height:10px; animation-delay:.24s; }
.voice-draft__text {
  display:none;
  max-width:44%;
  color:var(--text);
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.voice-draft__text:not(:empty) {
  display:block;
}
@keyframes voiceDraftPulse {
  from { transform:scaleY(.48); opacity:.55; }
  to { transform:scaleY(1); opacity:1; }
}
.chat-attach-btn,
.chat-input-actions button {
  width:38px;
  height:38px;
  padding:0;
  flex-shrink:0;
  border-radius:999px;
  border:1px solid transparent;
  background:transparent;
  color:var(--text-secondary);
  box-shadow:none;
}
.chat-attach-btn {
  background:var(--surface2);
  border-color:var(--border-light);
  color:var(--text);
}
.chat-input-actions #voiceBtn {
  background:var(--surface2);
  border-color:transparent;
  color:var(--text);
}
.chat-voice-btn {
  background:#050505 !important;
  border-color:#050505 !important;
  color:#fff !important;
}
.chat-attach-btn svg,
.chat-input-actions button svg {
  width:18px;
  height:18px;
  display:block;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#send {
  display:none;
  width:40px;
  height:40px;
  border-radius:999px;
  color:#fff;
  background:#050505;
  border:1px solid #050505;
  box-shadow:0 10px 22px rgba(0,0,0,0.16);
}
.chat-input-container.is-has-text #send {
  display:flex;
}
.chat-input-container.is-has-text #voiceBtn,
.chat-input-container.is-has-text .chat-voice-btn {
  display:none !important;
}
.chat-input-container.is-has-text .mobile-composer-model-btn {
  display:none !important;
}
.chat-input-actions .voice-cancel-btn,
.chat-input-actions .voice-confirm-btn,
.chat-input-actions .voice-end-btn {
  display:none !important;
}
.voice-cancel-btn,
.voice-confirm-btn {
  background:var(--surface2) !important;
  color:var(--text) !important;
}
.voice-end-btn {
  width:auto !important;
  min-width:96px;
  padding:0 16px !important;
  gap:6px;
  border-color:var(--accent) !important;
  background:var(--accent) !important;
  color:#fff !important;
  font-weight:700;
}
.voice-end-btn span {
  letter-spacing:1px;
}
.voice-end-btn strong {
  font:inherit;
}
.chat-input-container.is-voice-dictation textarea,
.chat-input-container.is-voice-dictation #voiceBtn,
.chat-input-container.is-voice-dictation .chat-voice-btn,
.chat-input-container.is-voice-dictation #send {
  display:none !important;
}
.chat-input-container.is-voice-dictation .voice-draft,
.chat-input-container.is-voice-dictation .voice-cancel-btn,
.chat-input-container.is-voice-dictation .voice-confirm-btn {
  display:flex !important;
}
.chat-input-container.is-voice-dictation .chat-attach-btn {
  pointer-events:none;
  color:var(--text-tertiary);
  background:transparent;
}
.chat-input-container.is-voice-conversation #send,
.chat-input-container.is-voice-conversation .chat-voice-btn {
  display:none !important;
}
.chat-input-container.is-voice-conversation #voiceBtn,
.chat-input-container.is-voice-conversation .voice-end-btn {
  display:flex !important;
}
#send:hover {
  transform:translateY(-1px);
}
#send:disabled {
  box-shadow:none;
  transform:none;
}
.chat-voice-btn { display:flex; }
.chat-model-bar {
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  padding-top:0;
  overflow-x:auto;
  scrollbar-width:none;
}
.chat-model-bar::-webkit-scrollbar {
  display:none;
}
.chat-model-bar .tab {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:auto;
  min-height:30px;
  padding:0 11px;
  white-space:nowrap;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:background var(--transition), color var(--transition), border-color var(--transition);
}
.chat-model-bar .tab.active {
  border-color:var(--border);
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow-sm);
}
.chat-input-container,
.app-card,
.toolbar-icon-btn,
.chat-model-bar .tab,
.command-tool-row button,
.command-persona-row button {
  border-radius:14px;
}
.composer-segment,
.composer-tools {
  display:inline-flex;
  align-items:center;
  gap:3px;
  min-height:34px;
  padding:2px;
  border:1px solid var(--border-light);
  border-radius:12px;
  background:color-mix(in srgb, var(--surface2) 74%, transparent);
}
.composer-tools {
  margin-left:auto;
}
.composer-tools .tab {
  min-width:36px;
}
.composer-tools .icon-tab {
  width:36px;
  padding:0;
}
.persona-tab {
  font-size:12px;
  cursor:pointer;
}
.persona-menu {
  display:none;
  position:absolute;
  bottom:100%;
  left:0;
  right:0;
  padding:8px;
  z-index:1000;
  max-height:300px;
  overflow-y:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  box-shadow:0 -4px 20px rgba(0,0,0,0.12);
}
.user-menu {
  position: fixed;
  min-width: 220px;
  max-width: 280px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, var(--bg)) 0%, color-mix(in srgb, var(--surface) 92%, var(--bg)) 100%);
  box-shadow: 0 18px 48px rgba(0,0,0,0.18);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 1000;
  color: var(--text);
}
.user-menu__user {
  padding: 8px 10px 10px;
}
.user-menu__name {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.user-menu__email {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu__divider {
  height: 1px;
  margin: 6px 4px;
  background: var(--border-light);
}
.user-menu__section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-menu__label {
  padding: 4px 10px 2px;
  font-size: 10px;
  letter-spacing: 0.2px;
  color: var(--text-tertiary);
  text-transform: none;
}
.user-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-align: left;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), color var(--transition);
}
.user-menu__item:hover {
  background: color-mix(in srgb, var(--accent-light) 48%, transparent);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
  transform: translateY(-1px);
}
.user-menu__item.is-danger {
  color: var(--red);
}
.user-menu__item.is-danger:hover {
  background: rgba(255,59,48,0.08);
  border-color: rgba(255,59,48,0.18);
}
.user-menu__codes {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.user-menu__code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface2) 84%, transparent);
  border: 1px solid transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 650;
  color: var(--orange);
  cursor: pointer;
}
.user-menu__code:hover {
  border-color: color-mix(in srgb, var(--orange) 18%, transparent);
  background: color-mix(in srgb, var(--orange-light) 72%, var(--surface2));
}
.user-menu__more {
  padding: 2px 10px 0;
  font-size: 10px;
  color: var(--text-tertiary);
}
.user-menu__copy {
  color: var(--text-tertiary);
  font-size: 11px;
  flex-shrink: 0;
}
[data-theme="dark"] .user-menu {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #000) 0%, color-mix(in srgb, var(--surface) 92%, #000) 100%);
  box-shadow: 0 24px 60px rgba(0,0,0,0.42);
}
[data-theme="dark"] .user-menu__item:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .user-menu__item.is-danger:hover {
  background: rgba(255,59,48,0.1);
  border-color: rgba(255,59,48,0.16);
}
[data-theme="dark"] .user-menu__code {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .user-menu__code:hover {
  background: rgba(255,149,0,0.1);
  border-color: rgba(255,149,0,0.16);
}
.profile-panel {
  text-align: center;
  color: var(--text);
}
.profile-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface2) 82%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name {
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
}
.profile-email {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-tertiary);
}
.profile-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface2) 72%, transparent);
}
.profile-card__title {
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: left;
  margin-bottom: 10px;
  letter-spacing: 0.2px;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.profile-stat {
  text-align: left;
}
.profile-stat__label {
  font-size: 11px;
  color: var(--text-tertiary);
}
.profile-stat__value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 650;
  color: var(--text);
}
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.profile-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.profile-btn:hover {
  transform: translateY(-1px);
}
.profile-btn.primary {
  background: color-mix(in srgb, var(--accent-light) 78%, var(--surface));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
}
.profile-btn.secondary {
  background: color-mix(in srgb, var(--orange-light) 76%, var(--surface));
  color: var(--orange);
  border-color: color-mix(in srgb, var(--orange) 16%, transparent);
}
.profile-btn.ghost {
  background: var(--surface);
  color: var(--text-secondary);
  border-color: var(--border);
}
[data-theme="dark"] .profile-card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .profile-btn.primary {
  background: rgba(0,122,255,0.12);
}
[data-theme="dark"] .profile-btn.secondary {
  background: rgba(255,149,0,0.12);
}
[data-theme="dark"] .profile-btn.ghost {
  background: rgba(255,255,255,0.03);
  color: var(--text-secondary);
}
.model-sep {
  align-self:center;
  height:14px;
  flex:0 0 1px;
}

[data-theme="dark"] .chat-input-container {
  background:color-mix(in srgb, var(--surface) 92%, #000);
  border-color:var(--border);
  box-shadow:0 16px 40px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.05) inset;
}
html[data-theme="dark"] .chat-input-container {
  background:#242427 !important;
  border-color:#3a3a3c !important;
  box-shadow:0 16px 40px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.05) inset !important;
}
[data-theme="dark"] .composer-segment,
[data-theme="dark"] .composer-tools {
  background:rgba(255,255,255,0.035);
  border-color:var(--border-light);
}
[data-theme="dark"] .app-card {
  background:color-mix(in srgb, var(--surface) 94%, #000);
  border-color:rgba(255,255,255,0.08);
  box-shadow:0 12px 30px rgba(0,0,0,0.32), 0 1px 0 rgba(255,255,255,0.04) inset;
}
[data-theme="dark"] .app-card:hover {
  border-color:color-mix(in srgb, var(--app-accent) 34%, rgba(255,255,255,0.08));
  box-shadow:0 16px 36px rgba(0,0,0,0.36), 0 1px 0 rgba(255,255,255,0.05) inset;
}
[data-theme="dark"] .app-icon {
  box-shadow:0 8px 18px rgba(0,0,0,0.18);
}
[data-theme="dark"] .chat-attach-btn,
[data-theme="dark"] .chat-input-actions button {
  background:transparent;
  border-color:transparent;
  color:var(--text-secondary);
  box-shadow:none;
}
[data-theme="dark"] .chat-attach-btn {
  background:rgba(255,255,255,0.06);
  border-color:var(--border-light);
  color:var(--text);
}
[data-theme="dark"] #send {
  background:#f4f4f5;
  border-color:#f4f4f5;
  color:#111;
  box-shadow:0 10px 22px rgba(0,0,0,0.28);
}
[data-theme="dark"] .chat-voice-btn {
  background:#f4f4f5 !important;
  border-color:#f4f4f5 !important;
  color:#111 !important;
}
[data-theme="dark"] .chat-model-bar .tab.active {
  background:rgba(255,255,255,0.08);
  border-color:var(--border);
  color:var(--text);
}
[data-theme="dark"] .msg.assistant {
  border-color:var(--border-light);
}
[data-theme="dark"] .reasoning {
  background:color-mix(in srgb, var(--surface) 76%, transparent);
  border-color:var(--border-light);
}
[data-theme="dark"] .reasoning-body {
  background:var(--surface2);
}

@media (max-width:640px) {
  body {
    width:100%;
    height:100dvh;
    overflow:hidden;
  }
  .thread-bar {
    padding:8px 12px 0;
    gap:0;
  }
  .thread-desktop-row {
    display:none;
  }
  .thread-mobile-row {
    display:flex;
    align-items:center;
    gap:6px;
    width:100%;
  }
  .thread-mobile-trigger {
    flex:1;
    min-width:0;
    min-height:42px;
    padding:7px 12px;
    border:1px solid var(--border-light);
    border-radius:14px;
    background:var(--surface);
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    justify-content:center;
    gap:2px;
    font:inherit;
    color:var(--text);
    cursor:pointer;
  }
  .thread-mobile-trigger__meta {
    font-size:10px;
    color:var(--text-tertiary);
    line-height:1;
  }
  .thread-mobile-trigger strong {
    font-size:13px;
    font-weight:700;
    line-height:1.1;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .thread-mobile-trigger em {
    font-style:normal;
    font-size:10px;
    color:var(--text-secondary);
    line-height:1;
  }
  .thread-mobile-new,
  .thread-mobile-more {
    width:42px;
    height:42px;
    border:1px solid var(--border-light);
    border-radius:14px;
    background:var(--surface);
    color:var(--text);
    font:inherit;
    font-weight:700;
    cursor:pointer;
    flex-shrink:0;
  }
  .thread-mobile-more {
    font-size:20px;
    line-height:1;
  }
  .thread-menu {
    display:none;
    position:fixed;
    left:12px;
    right:12px;
    top: calc(108px + env(safe-area-inset-top));
    z-index:1280;
    padding:12px;
    border-radius:18px;
    background:rgba(255,255,255,0.94);
    backdrop-filter:blur(22px);
    border:1px solid rgba(0,0,0,0.06);
    box-shadow:0 18px 42px rgba(0,0,0,0.12);
    flex-direction:column;
    gap:4px;
    max-height:min(56vh, 430px);
    overflow:auto;
  }
  .thread-menu.is-open {
    display:flex;
  }
  .thread-menu__top-actions {
    display:flex;
    gap:8px;
    padding:0 4px 6px;
  }
  .thread-menu__save {
    flex:1;
    min-height:36px;
    border:1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
    border-radius:12px;
    background:color-mix(in srgb, var(--accent) 8%, var(--surface));
    color:var(--accent);
    font:inherit;
    font-size:13px;
    font-weight:700;
    cursor:pointer;
  }
  .thread-menu__save--ghost {
    background:var(--surface);
    color:var(--text-secondary);
  }
  .thread-menu__label {
    padding:4px 8px 8px;
    color:var(--text-tertiary);
    font-size:12px;
    line-height:1;
  }
  .thread-menu__item {
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px;
    border-radius:14px;
    background:transparent;
  }
  .thread-menu__item.is-active {
    background:var(--surface2);
  }
  .thread-menu__item--new {
    min-height:40px;
    border:0;
    color:var(--accent);
    justify-content:flex-start;
    font:inherit;
    font-weight:700;
    cursor:pointer;
  }
  .thread-menu__main {
    flex:1;
    min-width:0;
    border:0;
    background:transparent;
    color:var(--text);
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:2px;
    font:inherit;
    cursor:pointer;
    padding:0;
    text-align:left;
  }
  .thread-menu__main span {
    font-size:14px;
    font-weight:700;
    line-height:1.15;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:100%;
  }
  .thread-menu__main em {
    font-style:normal;
    font-size:11px;
    color:var(--text-secondary);
    line-height:1;
  }
  .thread-menu__action {
    width:34px;
    height:34px;
    border:1px solid var(--border-light);
    border-radius:10px;
    background:var(--surface);
    color:var(--text-secondary);
    font:inherit;
    font-size:12px;
    font-weight:700;
    cursor:pointer;
    flex-shrink:0;
  }
  .thread-menu__action--danger {
    color:#ff3b30;
  }
  .thread-menu__action:hover {
    border-color:color-mix(in srgb, var(--accent) 35%, var(--border));
    color:var(--accent);
  }
  .thread-menu__action--danger:hover {
    border-color:rgba(255,59,48,0.22);
    color:#ff3b30;
    background:rgba(255,59,48,0.08);
  }
  .thread-chip span {
    max-width:116px;
  }
  .thread-chip-close {
    width:16px;
    height:16px;
    font-size:12px;
  }
  .chat {
    padding:10px 12px 16px;
    gap:10px;
  }
  .chat-welcome {
    padding:18px 4px 24px;
  }
  .chat-welcome.chat-home-minimal {
    padding-top:12px;
  }
  .chat-welcome.chat-home-minimal .welcome-subtitle {
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
    margin-bottom:12px;
  }
  .chat-welcome.chat-thread-empty {
    min-height:calc(100dvh - 236px);
    justify-content:center;
  }
  .command-kicker {
    min-height:22px;
    padding:0 7px;
    font-size:10px;
    margin-bottom:10px;
  }
  .welcome-title {
    font-size:21px;
    line-height:1.2;
    margin-bottom:4px;
  }
  .welcome-subtitle {
    font-size:12px;
    line-height:1.55;
    margin-bottom:18px;
  }
  .workspace-attraction {
    grid-template-columns:1fr;
    gap:8px;
    margin-bottom:16px;
  }
  .workspace-attraction.eve-home-grid {
    grid-template-columns:1fr;
  }
  .workspace-attraction.founder-cockpit-grid {
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
  .founder-cockpit-grid .eve-home-card--primary,
  .founder-cockpit-grid .eve-home-card--compact:first-child {
    grid-column:1 / -1;
  }
  .founder-cockpit-grid .eve-home-card--compact {
    grid-column:auto;
  }
  .workspace-attraction__item {
    min-height:92px;
    padding:11px 12px;
  }
  .workspace-attraction__head {
    margin-bottom:7px;
  }
  .workspace-attraction__avatar {
    width:30px;
    height:30px;
    font-size:13px;
  }
  .workspace-attraction__item strong {
    font-size:14px;
  }
  .workspace-attraction__item em {
    font-size:11px;
    margin-top:3px;
    display:-webkit-box;
    -webkit-line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .workspace-attraction__item small {
    padding-top:8px;
    font-size:11px;
  }
  .command-status-grid {
    display:flex;
    overflow-x:auto;
    grid-template-columns:none;
    gap:8px;
    margin:0 -12px 14px;
    padding:0 12px 2px;
    scrollbar-width:none;
  }
  .command-status-grid::-webkit-scrollbar {
    display:none;
  }
  .chat-welcome.chat-home-minimal .command-status-grid {
    grid-template-columns:none;
  }
  .command-status-card {
    flex:0 0 108px;
    min-height:62px;
    padding:10px 11px;
    border-radius:10px;
  }
  .command-status-card strong {
    font-size:17px;
    margin-top:8px;
  }
  .command-section {
    margin-top:14px;
  }
  .command-section--split {
    display:block;
  }
  .command-section-title {
    margin-bottom:8px;
  }
  .command-action-grid {
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }
  .command-action {
    min-height:64px;
    padding:10px 11px;
    border-radius:10px;
    gap:10px;
  }
  .command-action-icon {
    width:30px;
    min-width:30px;
    height:30px;
    border-radius:7px;
    font-size:14px;
  }
  .command-action strong {
    font-size:13px;
  }
  .command-action em {
    font-size:11px;
    display:-webkit-box;
    -webkit-line-clamp:1;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .command-tool-row,
  .command-persona-row {
    flex-wrap:nowrap;
    overflow-x:auto;
    margin:0 -4px;
    padding:0 4px 2px;
    scrollbar-width:none;
  }
  .command-tool-row::-webkit-scrollbar,
  .command-persona-row::-webkit-scrollbar {
    display:none;
  }
  .command-tool-row button,
  .command-persona-row button {
    flex:0 0 auto;
    min-height:32px;
    padding:0 10px;
    font-size:11px;
    border-radius:10px;
  }
  .think-page {
    width:calc(100% - 24px);
    max-width:calc(100% - 24px);
    overflow-x:hidden;
    padding:18px 0 28px;
  }
  .think-page__header {
    flex-direction:column;
    gap:12px;
    margin-bottom:12px;
  }
  .think-page h1 {
    font-size:24px;
    margin:8px 0 4px;
  }
  .think-page p {
    font-size:12px;
    line-height:1.5;
  }
  .think-page__actions {
    width:100%;
  }
  .think-page__actions button {
    flex:1;
    min-height:34px;
    font-size:11px;
  }
  .deepthink-workbench {
    grid-template-columns:minmax(0, 1fr);
    gap:10px;
    max-width:100%;
    overflow-x:hidden;
  }
  .deepthink-threadbar {
    border-radius:12px;
    padding:8px;
    max-width:100%;
    overflow:hidden;
  }
  .deepthink-thread-list {
    max-width:100%;
    overflow-x:auto;
  }
  .deepthink-thread-item {
    min-width:190px;
    grid-template-columns:minmax(112px, 1fr) 26px 26px;
  }
  .deepthink-flow {
    gap:6px;
    margin-bottom:0;
    flex-wrap:wrap;
    line-height:1.2;
  }
  .deepthink-flow__step {
    min-height:22px;
    padding:0 8px;
    font-size:10px;
  }
  .deepthink-workbench__hint {
    margin-bottom:8px;
    font-size:10px;
  }
  .deepthink-panel-meta {
    margin-bottom:8px;
  }
  .deepthink-panel-meta span {
    min-height:22px;
    font-size:10px;
  }
  .deepthink-next-step {
    align-items:flex-start;
    flex-direction:column;
    gap:9px;
    padding:10px;
  }
  .deepthink-next-step__actions {
    width:100%;
  }
  .deepthink-next-step__actions button {
    flex:1;
    min-height:30px;
    font-size:11px;
  }
  .deepthink-todo-result {
    min-height:34px;
    font-size:11px;
  }
  .deepthink-todo-result button {
    min-height:26px;
    font-size:10px;
  }
  .deepthink-editor,
  .deepthink-suggestions {
    border-radius:10px;
    padding:11px;
  }
  .deepthink-suggestions {
    max-height:none;
  }
  .deepthink-assist-generate {
    grid-template-columns:1fr 1fr;
    gap:7px;
  }
  .deepthink-assist-generate button {
    min-height:54px;
    padding:8px;
  }
  .deepthink-assist-generate strong {
    font-size:11px;
  }
  .deepthink-assist-generate span {
    font-size:10px;
  }
  .deepthink-assist-prompt {
    min-height:112px;
    padding:10px 11px;
    font-size:12px;
  }
  .deepthink-assist-actions button {
    min-height:30px;
    font-size:11px;
  }
  .deepthink-question {
    min-height:66px;
    max-height:138px;
    padding:10px;
    font-size:16px;
  }
  .deepthink-question {
    padding-right:42px;
  }
  .deepthink-expand-btn {
    width:26px;
    height:26px;
    right:7px;
    bottom:7px;
  }
  .deepthink-text-modal {
    align-items:stretch;
    padding:0;
  }
  .deepthink-text-modal__dialog {
    height:100dvh;
    border:0;
    border-radius:0;
  }
  .deepthink-text-modal__head {
    position:relative;
    flex-wrap:wrap;
    align-items:flex-start;
    padding:12px 12px 10px;
  }
  .deepthink-text-modal__head strong {
    width:calc(100% - 46px);
    min-height:34px;
    display:flex;
    align-items:center;
    font-size:14px;
    line-height:1.35;
  }
  .deepthink-text-modal__head > button[data-close="1"] {
    position:absolute;
    top:12px;
    right:12px;
  }
  .deepthink-text-modal__mode {
    order:2;
    width:100%;
    margin-left:0;
    display:flex;
  }
  .deepthink-text-modal__head .deepthink-text-modal__mode button {
    flex:1;
    min-height:32px;
  }
  .deepthink-text-modal textarea {
    padding:14px;
    font-size:16px;
  }
  .deepthink-md-preview {
    padding:14px 14px 22px;
    font-size:15px;
    overflow:auto;
  }
  .deepthink-md-preview table {
    min-width:520px;
  }
  .deepthink-text-modal__actions {
    padding:10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .deepthink-text-modal__actions button {
    flex:1;
    min-height:42px;
  }
  .deepthink-files {
    margin:10px 0 12px;
    border-radius:12px;
    padding:8px;
  }
  .deepthink-file-item {
    grid-template-columns:1fr;
    gap:8px;
  }
  .deepthink-file-item__actions {
    justify-content:flex-end;
  }
  .deepthink-block {
    grid-template-columns:minmax(0, 1fr);
    gap:6px;
  }
  .deepthink-block__tools {
    grid-column:1;
    flex-direction:row;
    flex-wrap:nowrap;
    align-items:flex-start;
    min-width:0;
    overflow-x:auto;
    padding-bottom:2px;
    scrollbar-width:none;
  }
  .deepthink-block__tools::-webkit-scrollbar {
    display:none;
  }
  .deepthink-block__type {
    justify-self:start;
    min-height:32px;
    padding:0 10px;
    font-size:11px;
  }
  .deepthink-block textarea {
    min-height:40px;
    padding:8px 9px;
    font-size:12px;
  }
  .deepthink-block button,
  .deepthink-block__tools button {
    flex:0 0 auto;
    width:auto;
    min-width:28px;
    height:32px;
  }
  .deepthink-block__tools--wide button {
    flex:0 0 auto;
    min-width:46px;
    height:30px;
    padding:0 8px;
  }
  .deepthink-ai-list {
    max-height:42vh;
    overflow:auto;
    padding-right:2px;
  }
  .deepthink-ai-card p {
    max-height:132px;
    overflow:auto;
  }
  .msg {
    max-width:100%;
    padding:11px 13px;
    font-size:14px;
    border-radius:12px;
  }
  .msg.user {
    max-width:92%;
  }
  .msg.assistant .copy-btn {
    opacity:1;
  }
  .input-wrap {
    padding:8px 8px 10px;
    gap:6px;
  }
  .scroll-bottom-btn {
    width:36px;
    height:36px;
    bottom:calc(76px + env(safe-area-inset-bottom));
  }
  .chat-input-container {
    min-height:52px;
    border-radius:26px;
    padding:6px;
    gap:5px;
  }
  .chat-input-container textarea {
    font-size:16px;
    min-height:28px;
    padding:7px 0;
  }
  .chat-attach-btn,
  .chat-input-actions button,
  #send {
    width:38px;
    height:38px;
    border-radius:999px;
  }
  .chat-input-actions {
    gap:3px;
  }
  .chat-input-actions .mobile-composer-model-btn {
    display:inline-flex !important;
    align-items:center;
    justify-content:center;
    width:auto;
    max-width:116px;
    min-width:62px;
    height:36px;
    padding:0 9px 0 11px;
    gap:3px;
    border-radius:999px;
    border:1px solid var(--border-light);
    background:var(--surface2);
    color:var(--text);
    font-size:12px;
    font-weight:700;
    box-shadow:none;
  }
  .mobile-composer-model-btn span {
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
  .mobile-composer-model-btn svg {
    width:13px !important;
    height:13px !important;
    flex:0 0 13px;
  }
  .chat-voice-btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:36px;
    height:36px;
    padding:0;
    flex-shrink:0;
    border-radius:999px;
    border:1px solid #050505;
    background:#050505;
    color:#fff;
    box-shadow:none;
  }
  #send {
    width:40px;
    height:40px;
  }
  .dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
    top: auto;
    margin-bottom: 0;
    max-height: 42vh;
    border-radius: 16px;
    z-index: 300;
  }
  .dropdown.composer-attach-menu {
    left: 24px;
    right: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: min(292px, calc(100vw - 48px));
    max-height: 48vh;
    border-radius: 18px;
    padding: 8px;
  }
  .composer-menu-section-title {
    padding:4px 8px 8px;
  }
  .composer-menu-item {
    min-height:50px;
    font-size:15px;
  }
  .chat-model-bar {
    display:none;
  }
  .chat-model-bar .tab,
  .composer-segment,
  .composer-tools,
  .chat-model-bar .model-sep {
    display:none;
  }
  .mobile-space-nav {
    left: 6px;
    right: 6px;
    top: calc(6px + env(safe-area-inset-top));
    bottom: auto;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255,255,255,0.68);
    backdrop-filter: blur(18px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.04);
    justify-content: space-between;
    align-items: center;
  }
  .mobile-space-nav__menu,
  .mobile-space-nav__profile {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: none;
    color: rgba(34,34,38,0.92);
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    overflow:hidden;
  }
  .mobile-space-nav__menu svg,
  .mobile-space-nav__profile svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-space-nav__profile img {
    display:none;
    width:100%;
    height:100%;
    object-fit:cover;
  }
  .mobile-space-nav__title {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:4px;
    height:36px;
    padding:0;
    border:0;
    background:transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0;
    flex: 1;
    text-align: center;
    min-width: 0;
    cursor:pointer;
  }
  .mobile-space-nav__title svg {
    width:14px;
    height:14px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;
    opacity:.52;
  }
  .mobile-space-menu {
    position: fixed;
    left: 12px;
    right: auto;
    top: calc(60px + env(safe-area-inset-top));
    z-index: 1300;
    width: min(318px, calc(100vw - 24px));
    padding: 8px;
    border-radius: 18px;
    background: rgba(255,255,255,0.84);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 16px 32px rgba(0,0,0,0.08);
    display:none;
    flex-direction:column;
    gap: 4px;
    max-height: calc(100dvh - 80px - env(safe-area-inset-top));
    overflow:auto;
  }
  .mobile-space-menu.is-open {
    display:flex;
  }
  .mobile-model-menu {
    position: fixed;
    left: 78px;
    top: calc(58px + env(safe-area-inset-top));
    z-index: 1310;
    width: min(292px, calc(100vw - 96px));
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 18px 42px rgba(0,0,0,0.12);
    display:none;
    flex-direction:column;
    gap: 3px;
    max-height: calc(100dvh - 80px - env(safe-area-inset-top));
    overflow:auto;
  }
  .mobile-model-menu.is-open {
    display:flex;
  }
  .mobile-workspace-menu {
    position: fixed;
    left: 50%;
    top: calc(58px + env(safe-area-inset-top));
    z-index: 1310;
    width: min(292px, calc(100vw - 48px));
    transform: translateX(-50%);
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(22px);
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: 0 18px 42px rgba(0,0,0,0.12);
    display:none;
    flex-direction:column;
    gap: 3px;
    max-height: calc(100dvh - 80px - env(safe-area-inset-top));
    overflow:auto;
  }
  .mobile-workspace-menu.is-open {
    display:flex;
  }
  .mobile-model-menu__label {
    padding:8px 12px 6px;
    color:var(--text-tertiary);
    font-size:13px;
    line-height:1;
  }
  .mobile-model-menu__item {
    width:100%;
    min-height:62px;
    padding:8px 12px;
    display:flex;
    align-items:center;
    gap:12px;
    border:0;
    border-radius:12px;
    background:transparent;
    color:var(--text);
    text-align:left;
    cursor:pointer;
  }
  .mobile-model-menu__item:hover,
  .mobile-model-menu__item.active {
    background:var(--surface2);
  }
  .mobile-model-menu__item.is-disabled {
    opacity:0.52;
  }
  .mobile-model-menu__item span {
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:3px;
  }
  .mobile-model-menu__item strong {
    font-size:15px;
    font-weight:600;
  }
  .mobile-model-menu__item em {
    font-style:normal;
    font-size:13px;
    color:var(--text-tertiary);
  }
  .mobile-model-menu__item--plain {
    min-height:48px;
    border-top:1px solid var(--border-light);
    border-radius:0;
    margin-top:5px;
  }
  .mobile-model-menu__check {
    width:20px;
    height:20px;
    fill:none;
    stroke:currentColor;
    stroke-width:2.2;
    stroke-linecap:round;
    stroke-linejoin:round;
    opacity:0;
  }
  .mobile-model-menu__item.active .mobile-model-menu__check {
    opacity:1;
  }
  .user-menu--mobile {
    min-width: 240px;
    max-width: min(300px, calc(100vw - 24px));
    right: 12px;
    left: auto;
    border-radius: 18px;
  }
  .mobile-space-menu__item {
    width:100%;
    min-height: 52px;
    border:none;
    border-radius: 12px;
    background: transparent;
    display:flex;
    align-items:center;
    gap: 12px;
    padding: 8px 12px;
    color: var(--text);
    font: inherit;
    text-align:left;
    cursor:pointer;
  }
  .mobile-space-menu__item svg {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
    flex-shrink:0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-space-menu__item span {
    flex:1;
    min-width:0;
    display:flex;
    flex-direction:column;
    gap:2px;
  }
  .mobile-space-menu__item strong {
    font-size:14px;
    line-height:1.25;
    font-weight:600;
    color:var(--text);
  }
  .mobile-space-menu__item em {
    font-style:normal;
    font-size:12px;
    line-height:1.25;
    color:var(--text-tertiary);
  }
  .mobile-space-menu__item:hover {
    background: rgba(0,0,0,0.04);
  }
  .mobile-space-menu__item.active {
    background: rgba(0,122,255,0.08);
    color: var(--accent);
  }
  .mobile-space-menu__item.active svg {
    color: var(--accent);
  }
  .mobile-space-menu__divider {
    height:1px;
    margin:4px 8px 2px;
    background:var(--border-light);
  }
  .mobile-space-menu__label {
    padding:8px 12px 6px;
    font-size:11px;
    font-weight:600;
    color:var(--text-tertiary);
    text-transform:uppercase;
    letter-spacing:0;
  }
  .mobile-space-menu__workspace span {
    display:flex;
    flex-direction:column;
    gap:2px;
  }
  .mobile-space-menu__workspace strong {
    font-size:14px;
  }
  .mobile-space-menu__workspace em {
    font-size:11px;
  }
  [data-theme="dark"] .mobile-space-nav {
    background: rgba(28,28,30,0.78);
    border-color: rgba(255,255,255,0.06);
  }
  [data-theme="dark"] .mobile-space-nav__menu,
  [data-theme="dark"] .mobile-space-nav__profile {
    background: rgba(44,44,46,0.72);
    border-color: rgba(255,255,255,0.06);
  }
  [data-theme="dark"] .mobile-space-menu {
    background: rgba(44,44,46,0.92);
    border-color: rgba(255,255,255,0.06);
  }
  [data-theme="dark"] .mobile-space-menu__divider {
    background: rgba(255,255,255,0.08);
  }
  [data-theme="dark"] .mobile-model-menu {
    background: rgba(44,44,46,0.92);
    border-color: rgba(255,255,255,0.08);
  }
  [data-theme="dark"] .mobile-workspace-menu {
    background: rgba(44,44,46,0.92);
    border-color: rgba(255,255,255,0.08);
  }
  [data-theme="dark"] .mobile-model-menu__item:hover,
  [data-theme="dark"] .mobile-model-menu__item.active {
    background: rgba(255,255,255,0.08);
  }
  [data-theme="dark"] .mobile-space-menu__item {
    color: var(--text);
  }
  [data-theme="dark"] .mobile-space-menu__item svg {
    color: var(--text-secondary);
  }
  [data-theme="dark"] .mobile-space-menu__item.active {
    background: rgba(64,156,255,0.16);
  }
  .main {
    padding-top: calc(56px + env(safe-area-inset-top));
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    width:100%;
    min-width:0;
  }
  .panel,
  .preview-panel {
    min-height:0;
  }
  .preview-panel.active {
    min-height:0;
  }
  .preview-panel.preview-panel--embedded .preview-bar {
    position:sticky;
    top:0;
    z-index:5;
  }
  .preview-frame {
    width:100%;
    min-height:0;
  }
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    width: 100%;
    max-height: 86vh;
    border-radius: 20px 20px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    box-shadow: 0 -18px 48px rgba(0,0,0,0.2);
  }
  .modal-title {
    font-size: 15px;
    margin-bottom: 12px;
  }
  .profile-panel {
    text-align: left;
  }
  .profile-avatar {
    width: 72px;
    height: 72px;
    margin: 2px 0 12px;
  }
  .profile-card {
    margin-top: 12px;
    padding: 12px;
    border-radius: 14px;
  }
  .profile-actions {
    margin-top: 12px;
  }
  .profile-btn {
    min-height: 44px;
    border-radius: 14px;
    font-size: 13px;
  }
  .profile-modal .profile-panel {
    text-align: left;
  }
}

/* Desktop Chat / Think layout pass */
@media (min-width:769px) {
  .chat {
    padding:28px max(32px, calc((100% - 920px) / 2)) 22px;
  }
  .input-wrap {
    padding:14px max(32px, calc((100% - 820px) / 2)) 16px;
  }
  .file-preview,
  .dropdown,
  .chat-input-container,
  .chat-model-bar,
  #personaMenu {
    width:min(820px, 100%);
  }
  .think-page {
    width:min(1220px, calc(100% - 72px));
  }
  .deepthink-workbench {
    grid-template-columns:minmax(0, 1fr) minmax(320px, 340px);
    gap:16px;
  }
  .deepthink-question {
    max-height:148px;
  }
  .deepthink-suggestions {
    position:sticky;
    top:18px;
    max-height:calc(100vh - 96px);
    overflow-y:auto;
  }
  .deepthink-ai-card p {
    max-height:220px;
    overflow:auto;
  }
}

@media (min-width:1440px) {
  .chat {
    padding-left:max(48px, calc((100% - 980px) / 2));
    padding-right:max(48px, calc((100% - 980px) / 2));
  }
  .think-page {
    width:min(1320px, calc(100% - 96px));
  }
  .deepthink-workbench {
    grid-template-columns:minmax(0, 1fr) 360px;
    gap:18px;
  }
}
