*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

:root {
  --bg-page: #191510;
  --bg-app: #141210;
  --bg-sidebar: #1c1916;
  --bg-input: #1a1715;
  --bg-menu: #211d19;
  --bg-hover: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-hi: #f5f0e6;
  --text: #d8d1c5;
  --text-dim: #a09889;
  --text-faint: #746d60;
  --accent: #e0812f;
  --accent-soft: rgba(224, 129, 47, 0.13);
  --bubble-user: #262119;
  --code-bg: #100e0b;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
}

:root[data-theme="midnight"] {
  --bg-page: #0f1218;
  --bg-app: #11141a;
  --bg-sidebar: #151922;
  --bg-input: #151a22;
  --bg-menu: #1a2029;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text-hi: #eef1f6;
  --text: #d3d8e2;
  --text-dim: #98a1b3;
  --text-faint: #6b7484;
  --accent: #e6a558;
  --accent-soft: rgba(230, 165, 88, 0.13);
  --bubble-user: #1d2432;
  --code-bg: #0b0e13;
}

:root[data-theme="light"] {
  --bg-page: #f7f3ec;
  --bg-app: #f7f3ec;
  --bg-sidebar: #efe9df;
  --bg-input: #fdfbf7;
  --bg-menu: #ffffff;
  --bg-hover: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.09);
  --border-strong: rgba(0, 0, 0, 0.17);
  --text-hi: #241d12;
  --text: #3d3529;
  --text-dim: #6f6555;
  --text-faint: #9a8f7d;
  --accent: #c96a16;
  --accent-soft: rgba(201, 106, 22, 0.12);
  --bubble-user: #ece5d8;
  --code-bg: #171310;
}

[data-theme="light"] .kbd { background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .sidebar-scroll::-webkit-scrollbar-thumb,
[data-theme="light"] .thread::-webkit-scrollbar-thumb,
[data-theme="light"] .palette-list::-webkit-scrollbar-thumb,
[data-theme="light"] .project-view::-webkit-scrollbar-thumb,
[data-theme="light"] .think-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.18); }
[data-theme="light"] .chat-action:hover { background: rgba(0, 0, 0, 0.06); }
[data-theme="light"] .attach-remove:hover { background: rgba(0, 0, 0, 0.07); }
[data-theme="light"] .composer { box-shadow: 0 18px 44px rgba(60, 44, 20, 0.1); }
[data-theme="light"] .model-menu { box-shadow: 0 18px 44px rgba(60, 44, 20, 0.14); }
[data-theme="light"] .palette,
[data-theme="light"] .settings-modal { box-shadow: 0 34px 80px rgba(60, 44, 20, 0.18); }
[data-theme="light"] .chip,
[data-theme="light"] .qa-btn,
[data-theme="light"] .attach-chip,
[data-theme="light"] .doc-card,
[data-theme="light"] .bubble-file,
[data-theme="light"] .web-status,
[data-theme="light"] .think-panel,
[data-theme="light"] .project-crumb { background: rgba(0, 0, 0, 0.025); }
[data-theme="light"] .codeblock-head { background: rgba(255, 255, 255, 0.045); }
[data-theme="light"] .overlay { background: rgba(64, 52, 34, 0.3); }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--bg-app);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(224, 129, 47, 0.32); color: #fff; }

button { font-family: inherit; }
svg { display: block; }

.app {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  background: var(--bg-app);
  overflow: hidden;
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s;
}

.app.sidebar-hidden .sidebar { width: 0; border-right-color: transparent; }

.app.sidebar-rail .sidebar,
.app.sidebar-rail .sidebar-inner { width: 64px; min-width: 64px; }
.app.sidebar-rail .logo-name,
.app.sidebar-rail .kbd,
.app.sidebar-rail .nav-item > span:not(.kbd),
.app.sidebar-rail .sidebar-scroll { display: none; }
.app.sidebar-rail .sidebar-top {
  flex-direction: column;
  gap: 12px;
  padding: 16px 0 10px;
}
.app.sidebar-rail .sidebar-top .icon-btn { margin-left: 0; }
.app.sidebar-rail .sidebar-nav {
  flex: 1;
  min-height: 0;
  padding: 4px 0;
  align-items: center;
  gap: 4px;
}
.app.sidebar-rail .nav-item {
  width: 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  border-radius: 12px;
}
.app.sidebar-rail .nav-item svg { width: 17px; height: 17px; }
.app.sidebar-rail .sidebar-bottom {
  display: flex;
  justify-content: center;
  padding: 10px 0;
}
.app.sidebar-rail .sidebar-bottom .nav-item { width: 40px; height: 40px; justify-content: center; padding: 0; }

.sidebar-inner {
  width: 272px;
  min-width: 272px;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 14px 12px;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(160deg, #f09a48, #d8741d);
  color: #fff7ea;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.logo-mark svg { width: 19px; height: 19px; }

.logo-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-hi);
  letter-spacing: 0.01em;
}

.icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-faint);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 16px; height: 16px; }

.sidebar-top .icon-btn { margin-left: auto; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item svg { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.nav-item .new-chat-dot { width: 17px; height: 17px; color: unset; }
.nav-item--dim { color: var(--text-dim); font-size: 12.5px; }
.nav-item--dim:hover { color: var(--text); }

.kbd {
  margin-left: auto;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5px 6px;
  white-space: nowrap;
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px 14px;
  scrollbar-gutter: stable;
}

.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

.chat-group + .chat-group { margin-top: 18px; }

.group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 5px 8px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.15s;
}
.group-header:hover { color: var(--text-dim); }
.group-header svg { width: 13px; height: 13px; transition: transform 0.25s; }
.chat-group.collapsed .group-header svg { transform: rotate(-90deg); }

.group-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.3s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chat-group.collapsed .group-body { grid-template-rows: 0fr; }
.group-body > ul {
  overflow: hidden;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-item {
  display: block;
  width: 100%;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chat-item:hover { background: var(--bg-hover); color: var(--text); }
.chat-item.active { background: var(--bg-hover); color: var(--text-hi); }

.sidebar-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 10px;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-app);
}

.main-top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px 8px;
}

.expand-btn { display: none; }
.app.sidebar-hidden .expand-btn { display: grid; margin-right: auto; }

.stage {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  padding: 0 32px 36px;
}

.stage-inner {
  width: min(768px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 7vh;
}

.greeting {
  margin: 0 0 26px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.24;
  letter-spacing: 0.002em;
}
.greeting-name { display: block; color: #c9bfac; }
.greeting-question { display: block; color: var(--text-hi); }

.composer {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 14px 16px 12px;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s;
}
.composer:focus-within { border-color: var(--border-strong); }

.composer-snake {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  pointer-events: none;
  opacity: 0.8;
  transition: opacity 0.25s;
  overflow: visible;
}
.composer:focus-within .composer-snake { opacity: 1; }

.composer-snake rect {
  fill: none;
  stroke-linecap: round;
  animation: snake-run 5s linear infinite;
}

@keyframes snake-run {
  to { stroke-dashoffset: 100; }
}

.composer textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  padding: 2px 4px;
  background: none;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  caret-color: var(--accent);
}
.composer textarea::placeholder { color: var(--text-faint); }

.composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.round-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.round-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.round-btn svg { width: 14px; height: 14px; }

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip svg { width: 14px; height: 14px; }
.chip.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(224, 129, 47, 0.35);
}

.model-select { position: relative; margin-left: auto; }

.model-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.model-btn:hover { background: var(--bg-hover); color: var(--text); }
.model-btn svg { width: 13px; height: 13px; transition: transform 0.2s; }
.model-select.open .model-btn svg { transform: rotate(180deg); }

.model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  min-width: 176px;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.16s, transform 0.16s;
  z-index: 10;
}
.model-select.open .model-menu {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.13s;
}
.model-option:hover { background: var(--bg-hover); }

.send-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, #f2a355, #d97a1f);
  color: #3b230b;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 6px 16px rgba(224, 129, 47, 0.3);
  transition: transform 0.15s, opacity 0.2s, filter 0.2s;
}
.send-btn svg { width: 15px; height: 15px; }
.send-btn:disabled { cursor: default; }
.send-btn:not(:disabled):hover { transform: translateY(-1px); }
.send-btn:not(:disabled):active { transform: scale(0.95); }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.qa-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.qa-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.qa-btn:active { transform: scale(0.98); }
.qa-btn svg { width: 14px; height: 14px; }

.thread { display: none; }

.stage.chatting .stage-inner { justify-content: flex-end; padding-bottom: 0; padding-top: 8px; }
.stage.chatting .hero,
.stage.chatting .quick-actions { display: none; }
.stage.chatting .composer { margin-bottom: 4px; }

.stage.chatting .thread {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 4px 22px;
}

.thread::-webkit-scrollbar { width: 5px; }
.thread::-webkit-scrollbar-track { background: transparent; }
.thread::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.msg { display: flex; animation: msg-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.msg.user { justify-content: flex-end; }
.msg.user .bubble {
  max-width: 80%;
  padding: 10px 14px;
  background: var(--bubble-user);
  border: 1px solid var(--border);
  border-radius: 18px 18px 6px 18px;
  color: var(--text-hi);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.msg.ai { gap: 10px; }
.ai-badge {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  background: linear-gradient(160deg, #f09a48, #d8741d);
  color: #fff7ea;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.ai-badge svg { width: 16px; height: 16px; }

.ai-text {
  max-width: 88%;
  padding-top: 3px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.ai-text.typing { display: flex; align-items: center; gap: 4px; padding-top: 9px; }
.ai-text.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: dot 1.1s infinite ease-in-out;
}
.ai-text.typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-text.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot {
  0%, 70%, 100% { opacity: 0.25; transform: translateY(0); }
  35%           { opacity: 1; transform: translateY(-2.5px); }
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: start center;
  padding-top: 14vh;
  background: rgba(12, 9, 5, 0.55);
  backdrop-filter: blur(5px);
  animation: fade-in 0.15s ease both;
}
.overlay[hidden] { display: none; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.palette {
  width: min(540px, 92vw);
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.55);
  animation: palette-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes palette-in {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.palette-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
}
.palette-head svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
.palette-head input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 14px;
  caret-color: var(--accent);
}
.palette-head input::placeholder { color: var(--text-faint); }

.palette-list {
  max-height: min(320px, calc(100dvh - 14vh - 120px));
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
}
.palette-list::-webkit-scrollbar { width: 5px; }
.palette-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.palette-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.palette-item:hover { background: var(--bg-hover); color: var(--text-hi); }

.palette-empty {
  padding: 18px 10px;
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
}

.chat-row {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 9px;
}
.chat-row .chat-item { flex: 1; min-width: 0; }
.chat-row:hover { background: var(--bg-hover); }
.chat-row:hover .chat-item { background: none; color: var(--text); }
.chat-row.active { background: var(--bg-hover); }
.chat-row.active .chat-item { background: none; color: var(--text-hi); }

.chat-action {
  display: none;
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
  place-items: center;
  margin-right: 4px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.13s, background 0.13s;
}
.chat-row:hover .chat-action { display: grid; }
.chat-action:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
.chat-action.on { display: grid; color: var(--accent); }
.chat-action.danger:hover { color: #e06555; }
.chat-action.confirm { display: grid; color: #e06555; background: rgba(224, 101, 85, 0.14); }
.chat-action svg { width: 13px; height: 13px; }

.chat-empty {
  padding: 6px 8px 8px;
  color: var(--text-faint);
  font-size: 12px;
  list-style: none;
}

.attach-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 4px 2px;
}

.attach-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 230px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  color: var(--text-dim);
}
.attach-chip img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 6px;
}
.attach-chip > svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-faint); }
.attach-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.attach-size { color: var(--text-faint); font-size: 11px; flex-shrink: 0; }

.attach-remove {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 5px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 0.13s, background 0.13s;
}
.attach-remove:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-hi); }
.attach-remove svg { width: 11px; height: 11px; }

.chip-icon { display: grid; place-items: center; }
.chip-icon svg { width: 14px; height: 14px; }
.chip-caret { width: 12px !important; height: 12px !important; opacity: 0.7; transition: transform 0.2s; }
.effort-select.open .chip-caret { transform: rotate(180deg); }
.effort-btn { gap: 5px; }
.effort-select { margin-left: 0; }
.effort-select .model-menu { left: 0; right: auto; }

.model-btn .chip-icon svg { width: 14px; height: 14px; }

.model-menu { min-width: 236px; }

.model-option { text-align: left; }
.mo-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.mo-icon svg { width: 14px; height: 14px; }
.mo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mo-name { color: var(--text-hi); font-size: 12.5px; }
.mo-desc { color: var(--text-faint); font-size: 11px; }
.mo-check { width: 13px; height: 13px; color: var(--accent); visibility: hidden; flex-shrink: 0; }
.model-option.selected .mo-check { visibility: visible; }

.send-btn.stop {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-hi);
  box-shadow: none;
  border: 1px solid var(--border-strong);
}
.send-btn.stop svg { width: 21px; height: 21px; }
.send-btn.stop .stop-ring {
  transform-origin: center;
  animation: stop-spin 1.1s linear infinite;
}
@keyframes stop-spin { to { transform: rotate(360deg); } }
.send-btn.stop:hover {
  color: #e06555;
  border-color: rgba(224, 101, 85, 0.5);
  background: rgba(224, 101, 85, 0.08);
}
[data-reduce-motion] .send-btn.stop .stop-ring { animation: none; stroke-dasharray: none; }
@media (prefers-reduced-motion: reduce) {
  .send-btn.stop .stop-ring { animation: none; stroke-dasharray: none; }
}

.bubble-images {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.bubble-images img {
  max-width: 190px;
  max-height: 150px;
  border-radius: 9px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.bubble-images:last-child { margin-bottom: 0; }

.bubble-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.bubble-files:last-child { margin-bottom: 0; }
.bubble-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.bubble-file svg { width: 13px; height: 13px; }

.ai-text.typing-state {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 6px;
}
.typing-label {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-right: 3px;
  animation: pulse-label 1.6s ease-in-out infinite;
}
@keyframes pulse-label {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}
.tdot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: var(--text-dim);
  animation: dot 1.1s infinite ease-in-out;
}
.tdot:nth-child(3) { animation-delay: 0.15s; }
.tdot:nth-child(4) { animation-delay: 0.3s; }

.ai-badge.error {
  background: rgba(224, 101, 85, 0.18);
  color: #e06555;
  font-weight: 700;
  font-size: 13px;
}
.ai-error { color: #d99287; }

.web-status {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-dim);
  font-size: 12px;
  animation: pulse-label 1.4s ease-in-out infinite;
}
.web-status svg { width: 13px; height: 13px; color: var(--accent); }

.ai-text.md { white-space: normal; }
.ai-text.md > *:first-child { margin-top: 0; }
.ai-text.md > *:last-child { margin-bottom: 0; }
.ai-text.md p { margin: 0 0 10px; }
.ai-text.md h1, .ai-text.md h2, .ai-text.md h3, .ai-text.md h4 {
  margin: 18px 0 8px;
  color: var(--text-hi);
  font-weight: 600;
  line-height: 1.3;
}
.ai-text.md h1 { font-size: 19px; }
.ai-text.md h2 { font-size: 16.5px; }
.ai-text.md h3 { font-size: 14.5px; }
.ai-text.md h4 { font-size: 13.5px; }
.ai-text.md ul, .ai-text.md ol { margin: 0 0 10px; padding-left: 22px; }
.ai-text.md li { margin: 3px 0; }
.ai-text.md li::marker { color: var(--text-faint); }
.ai-text.md a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(224, 129, 47, 0.35); }
.ai-text.md a:hover { border-bottom-color: var(--accent); }
.ai-text.md strong { color: var(--text-hi); font-weight: 600; }
.ai-text.md blockquote {
  margin: 10px 0;
  padding: 6px 14px;
  border-left: 2.5px solid var(--accent);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
}
.ai-text.md hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.ai-text.md table {
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 12.5px;
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.ai-text.md th, .ai-text.md td {
  border: 1px solid var(--border);
  padding: 6px 11px;
  text-align: left;
}
.ai-text.md th { background: rgba(255, 255, 255, 0.03); color: var(--text-hi); font-weight: 600; }

.ai-text.md :not(pre) > code {
  padding: 1.5px 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12px;
  color: #ecc794;
}

.codeblock {
  margin: 12px 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--code-bg);
}
.codeblock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 13px;
  background: rgba(255, 255, 255, 0.025);
  border-bottom: 1px solid var(--border);
}
.codeblock-lang {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: var(--text-faint);
}
.code-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-faint);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.code-copy:hover { background: var(--bg-hover); color: var(--text); }
.code-copy.done { color: #8fc97a; }
.code-copy svg { width: 12px; height: 12px; }

.codeblock pre {
  margin: 0;
  padding: 0;
  background: none;
  border: none;
}
.codeblock pre code {
  display: block;
  padding: 13px 15px;
  overflow-x: auto;
  background: none;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: #ddd5c7;
}
.codeblock pre code::-webkit-scrollbar { height: 6px; }
.codeblock pre code::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.hljs-comment, .hljs-quote { color: #7d7365; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-type { color: #e89a5d; }
.hljs-string, .hljs-attr, .hljs-template-string { color: #c9b483; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #d4a06a; }
.hljs-title, .hljs-title.function_, .hljs-function .hljs-title { color: #f0c987; }
.hljs-title.class_, .hljs-name { color: #e8b16d; }
.hljs-variable, .hljs-template-variable, .hljs-property { color: #ddd5c7; }
.hljs-params { color: #c5bcab; }
.hljs-tag { color: #b8ae9c; }
.hljs-attribute { color: #c9b483; }
.hljs-regexp, .hljs-link { color: #c98f5f; }
.hljs-meta, .hljs-doctag { color: #94897a; }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }
.hljs-section { color: #f0c987; font-weight: 600; }
.hljs-bullet { color: #d4a06a; }
.hljs-addition { color: #8fc97a; background: rgba(143, 201, 122, 0.08); }
.hljs-deletion { color: #e06555; background: rgba(224, 101, 85, 0.08); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-icon { display: inline-flex; flex-shrink: 0; }
.toast-icon svg { width: 14px; height: 14px; }
.toast-icon.ok { color: #8fc97a; }
.toast-icon.err { color: #e06555; }
.toast-icon.info { color: var(--accent); }

.group-header-row {
  display: flex;
  align-items: center;
}
.group-header-row .group-header { flex: 1; }

.group-add {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.13s, color 0.13s;
}
.group-header-row:hover .group-add,
.group-add:focus-visible { opacity: 1; }
.group-add:hover { background: var(--bg-hover); color: var(--text); }
.group-add svg { width: 13px; height: 13px; }

.proj-row .chat-item svg {
  width: 13.5px;
  height: 13.5px;
  flex-shrink: 0;
  color: var(--text-faint);
}

.chat-item {
  display: flex;
  align-items: center;
  gap: 7px;
}
.chat-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-item .chat-proj-ico {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  color: var(--text-faint);
}

.project-view {
  width: min(768px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 5vh 4px 48px;
  scrollbar-gutter: stable;
}
.project-view::-webkit-scrollbar { width: 5px; }
.project-view::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.stage.project-open .stage-inner { display: none; }

.library-view {
  width: min(880px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 5vh 4px 48px;
  scrollbar-gutter: stable;
}
.library-view::-webkit-scrollbar { width: 5px; }
.library-view::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.stage.library-open .stage-inner { display: none; }

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}
.library-title {
  margin: 0 0 2px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  color: var(--text-hi);
}
.library-sub { margin: 0; font-size: 12px; color: var(--text-faint); }

.library-filters {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.015);
}
.library-filters button {
  padding: 5px 13px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.library-filters button:hover { color: var(--text); }
.library-filters button.active { background: var(--bg-hover); color: var(--text-hi); }

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

.lib-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  color: inherit;
  font-family: var(--font-ui);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.lib-card:hover { border-color: var(--border-strong); background: var(--bg-hover); transform: translateY(-2px); }

.lib-card--image img {
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: cover;
  display: block;
  background: var(--code-bg);
}
.lib-expired {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: var(--code-bg);
  color: var(--text-faint);
  font-size: 11.5px;
}
.lib-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px 10px;
}
.lib-name {
  font-size: 12px;
  color: var(--text-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lib-chat {
  font-size: 10.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-card--file {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
}
.lib-card--file:hover { transform: none; }
.lib-card--file > svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--accent); }
.lib-card--file .lib-name {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
}
.lib-file-meta { flex-shrink: 0; font-size: 11px; color: var(--text-faint); }
.lib-row-end { display: flex; align-items: center; gap: 8px; flex-shrink: 0; max-width: 40%; }
.lib-row-end .doc-badge { margin-top: 0; }

.lib-empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
}

.project-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.project-title {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  padding: 4px 6px;
  border-radius: 8px;
  color: var(--text-hi);
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 0.002em;
  transition: background 0.15s;
}
.project-title:hover { background: rgba(255, 255, 255, 0.025); }
.project-title:focus { background: rgba(255, 255, 255, 0.04); }
.project-title::placeholder { color: var(--text-faint); }

.project-delete:hover { color: #e06555; }

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.project-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 16px;
}
[data-theme="light"] .project-card { background: rgba(0, 0, 0, 0.02); }
.project-card--instructions textarea { flex: 1; min-height: 150px; }
.project-card--chats { grid-column: 1 / -1; }

.count-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 7px;
  background: rgba(120, 120, 120, 0.12);
  border-radius: 999px;
  font-size: 10px;
  color: var(--text-dim);
  text-transform: none;
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .project-grid { grid-template-columns: 1fr; }
}

.project-section { margin-bottom: 28px; }

.project-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.project-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.project-label-row .project-label { margin: 0; }

.ghost-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.ghost-btn svg { width: 12px; height: 12px; }

#projectInstructions {
  display: block;
  width: 100%;
  min-height: 84px;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  resize: vertical;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 1.6;
  caret-color: var(--accent);
  transition: border-color 0.2s;
}
#projectInstructions:focus { border-color: var(--border-strong); }
#projectInstructions::placeholder { color: var(--text-faint); }

.doc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
  padding-top: 8px;
}
.doc-list:empty {
  display: block;
  padding-top: 0;
}
.doc-list:empty::after {
  content: "No documents yet — add files Taurus should know about.";
  color: var(--text-faint);
  font-size: 12.5px;
}

.doc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 104px;
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.15s, background 0.15s;
}
.doc-card:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.doc-card-name {
  font-size: 12.5px;
  color: var(--text-hi);
  line-height: 1.35;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.doc-card-meta { font-size: 11px; color: var(--text-faint); }
.doc-badge {
  margin-top: auto;
  align-self: flex-start;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.doc-remove {
  position: absolute;
  top: -7px;
  left: -7px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 0;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.doc-remove svg { display: block; width: 12px; height: 12px; }
.doc-card:hover .doc-remove,
.doc-remove:focus-visible { opacity: 1; }
.doc-remove:hover { color: #e06555; border-color: rgba(224, 101, 85, 0.5); }

.project-chats {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.project-chats:empty { display: none; }
.project-chats li + li { border-top: 1px solid var(--border); }

.project-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.13s;
}
.project-chat-btn:hover { background: var(--bg-hover); }
.project-chat-btn .pc-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-chat-btn .pc-date {
  flex-shrink: 0;
  color: var(--text-faint);
  font-size: 11.5px;
}

.project-chats-empty {
  color: var(--text-faint);
  font-size: 12.5px;
}

.project-crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 11px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.project-crumb:hover { color: var(--text); border-color: var(--border-strong); }
.project-crumb svg { width: 13px; height: 13px; color: var(--text-faint); }
.project-crumb[hidden] { display: none; }

.composer-bar.image-mode .model-select:not(.effort-select),
.composer-bar.image-mode .effort-select,
.composer-bar.image-mode #webSearchBtn,
.composer-bar.image-mode #attachBtn { display: none; }
.composer-bar.image-mode .send-btn { margin-left: auto; }

.gen-image {
  margin: 0;
  max-width: 400px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--code-bg);
}
.gen-image img {
  display: block;
  width: 100%;
  height: auto;
}
.gen-image figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.gen-image-prompt {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-faint);
  font-size: 11.5px;
}
.gen-image-open {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 7px;
  color: var(--text-faint);
  transition: background 0.13s, color 0.13s;
}
.gen-image-open:hover { background: var(--bg-hover); color: var(--text); }
.gen-image-open svg { width: 13px; height: 13px; }

.gen-image-expired {
  padding: 22px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
}

.ai-col {
  flex: 1;
  min-width: 0;
  max-width: 88%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-col .ai-text { max-width: 100%; }

.think-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
  overflow: hidden;
}

.think-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 12px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: color 0.15s;
}
.think-head:hover { color: var(--text-dim); }
.think-head svg { width: 14px; height: 14px; flex-shrink: 0; }
.think-label { flex: 1; text-align: left; }
.think-panel.live .think-label {
  background: linear-gradient(90deg, var(--text-faint) 25%, var(--text-hi) 50%, var(--text-faint) 75%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: think-shimmer 1.8s linear infinite;
}
@keyframes think-shimmer {
  to { background-position: -200% 0; }
}
.think-caret { transition: transform 0.25s; }
.think-panel.open .think-caret { transform: rotate(180deg); }

.think-body {
  display: none;
  max-height: 220px;
  overflow-y: auto;
  padding: 2px 12px 11px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  border-top: 1px dashed transparent;
}
.think-panel.open .think-body { display: block; }
.think-body::-webkit-scrollbar { width: 4px; }
.think-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.workspace {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-sidebar);
  border-left: 1px solid transparent;
  transition: width 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s;
}
.app.workspace-open .workspace {
  width: min(48%, 780px);
  border-left-color: var(--border);
}

.ws-inner {
  min-width: min(360px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ws-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.ws-tabs {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ws-tabs::-webkit-scrollbar { display: none; }

.ws-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 5px 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11.5px;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  cursor: pointer;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.ws-tab:hover { color: var(--text); border-color: var(--border-strong); }
.ws-tab.active { background: var(--bg-hover); color: var(--text-hi); border-color: var(--border-strong); }

.ws-tab-del {
  display: none;
  place-items: center;
  width: 14px;
  height: 14px;
  border: none;
  background: none;
  border-radius: 4px;
  color: var(--text-faint);
  cursor: pointer;
  padding: 0;
}
.ws-tab:hover .ws-tab-del { display: grid; }
.ws-tab-del:hover { color: #e06555; }
.ws-tab-del.confirm { display: grid; color: #fff; background: #c14b3c; }
.ws-tab-del svg { width: 9px; height: 9px; }

.ws-tab-new-input {
  width: 130px;
  padding: 5px 9px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: none;
  color: var(--text-hi);
  font-size: 11.5px;
  font-family: ui-monospace, Consolas, monospace;
  caret-color: var(--accent);
}

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

.ws-mode {
  display: flex;
  margin-right: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ws-mode button {
  padding: 4.5px 10px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 11.5px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.ws-mode button.active { background: var(--bg-hover); color: var(--text-hi); }

.ws-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

#wsEditor {
  flex: 1;
  min-height: 0;
  width: 100%;
  resize: none;
  border: none;
  outline: none;
  background: var(--code-bg);
  color: #ddd5c7;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  padding: 14px 16px;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
#wsEditor::-webkit-scrollbar { width: 6px; height: 6px; }
#wsEditor::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }

.ws-preview-wrap {
  flex: 1;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: #fff;
}
#wsPreview { flex: 1; width: 100%; border: none; background: #fff; }

.workspace.preview #wsEditor { display: none; }
.workspace.preview .ws-preview-wrap { display: flex; }

.ws-console {
  display: none;
  max-height: 132px;
  overflow-y: auto;
  padding: 8px 13px;
  background: var(--code-bg);
  border-top: 1px solid var(--border);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  color: #c5bcab;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
.ws-console.has { display: block; }
.ws-console .c-err { color: #e06555; }
.ws-console .c-warn { color: #e0a35c; }

.ws-empty {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 30px;
  color: var(--text-faint);
  font-size: 12.5px;
  text-align: center;
  line-height: 1.7;
}

.code-actions { display: flex; align-items: center; gap: 2px; }

.run-out {
  padding: 9px 15px;
  background: var(--code-bg);
  border-top: 1px solid var(--border);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: #c5bcab;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  max-height: 220px;
  overflow-y: auto;
}
.run-out .c-err { color: #e06555; }
.run-out .c-warn { color: #e0a35c; }
.run-out .c-dim { color: var(--text-faint); font-style: italic; }

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.file-card > svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--accent); }
.file-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.file-card-name {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-card-meta { font-size: 11px; color: var(--text-faint); }
.file-card-open {
  flex-shrink: 0;
  padding: 5px 11px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 11.5px;
  cursor: pointer;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
}
.file-card-open:hover { background: var(--bg-hover); color: var(--text-hi); border-color: var(--border-strong); }
[data-theme="light"] .file-card { background: rgba(0, 0, 0, 0.02); }

.bubble-video { margin-bottom: 8px; }
.bubble-video:last-child { margin-bottom: 0; }
.bubble-video-strip { display: flex; gap: 4px; flex-wrap: wrap; }
.bubble-video-strip img {
  height: 52px;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform 0.12s, border-color 0.12s;
}
.bubble-video-strip img:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.bubble-video-name {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.bubble-video-name svg { width: 13px; height: 13px; }

.attach-chip.clickable { cursor: pointer; }
.attach-chip.clickable:hover { border-color: var(--border-strong); }

.frame-overlay { place-items: center; padding: 4vh 16px; }

.frame-viewer {
  width: min(860px, 96vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.55);
  animation: palette-in 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.frame-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.frame-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--text-hi);
}

.frame-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  min-height: 0;
}
#frameMainImg {
  max-width: 100%;
  max-height: 56vh;
  display: block;
}

.frame-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.55);
  color: #eee;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  backdrop-filter: blur(3px);
}
.frame-nav:hover { background: rgba(30, 30, 30, 0.8); }
.frame-nav:active { transform: translateY(-50%) scale(0.93); }
.frame-nav svg { width: 17px; height: 17px; }
#framePrevBtn { left: 12px; }
#frameNextBtn { right: 12px; }

.frame-caption {
  padding: 8px 14px 4px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.frame-strip {
  display: flex;
  gap: 6px;
  padding: 8px 14px 14px;
  overflow-x: auto;
}
.frame-strip::-webkit-scrollbar { height: 5px; }
.frame-strip::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 99px; }
.frame-strip img {
  height: 48px;
  border-radius: 6px;
  border: 2px solid transparent;
  outline: 1px solid var(--border);
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.frame-strip img:hover { opacity: 1; }
.frame-strip img.active {
  opacity: 1;
  border-color: var(--accent);
  outline-color: transparent;
}

@media (max-width: 1100px) {
  .app.workspace-open .workspace {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: min(92vw, 640px);
    z-index: 30;
    box-shadow: -30px 0 60px rgba(0, 0, 0, 0.35);
  }
}

.msg.user { flex-direction: column; align-items: flex-end; }

.msg-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg:hover .msg-actions { opacity: 1; }

.msg-act {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  background: none;
  border: none;
  border-radius: 7px;
  color: var(--text-faint);
  font-size: 11px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.13s, color 0.13s;
}
.msg-act:hover { background: var(--bg-hover); color: var(--text); }
.msg-act svg { width: 12.5px; height: 12.5px; }

.ai-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  opacity: 0;
  transition: opacity 0.15s;
}
.msg:hover .ai-foot { opacity: 1; }

.msg-meta {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ai-foot .msg-actions { margin: 0; opacity: 1; }

.bubble-edit {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble-edit textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px 13px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  outline: none;
  resize: vertical;
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 13.5px;
  line-height: 1.55;
  caret-color: var(--accent);
}
.bubble-edit-row {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
}
.bubble-edit-row .ghost-btn { padding: 6px 13px; }
.bubble-edit-row .send-mini {
  padding: 6px 14px;
  background: linear-gradient(180deg, #f2a355, #d97a1f);
  border: none;
  border-radius: 9px;
  color: #3b230b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s;
}
.bubble-edit-row .send-mini:hover { transform: translateY(-1px); }

.ws-diff {
  flex: 1;
  min-height: 0;
  display: none;
  overflow: auto;
  background: var(--code-bg);
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 10px 0 20px;
}
.workspace.diffview #wsEditor { display: none; }
.workspace.diffview .ws-diff { display: block; }
.workspace.preview .ws-diff { display: none; }

.diff-line {
  display: flex;
  padding: 0 14px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #b9b1a3;
}
.diff-line .dg {
  flex-shrink: 0;
  width: 28px;
  text-align: center;
  user-select: none;
  color: var(--text-faint);
}
.diff-line.add { background: rgba(122, 201, 122, 0.09); color: #a8d8a0; }
.diff-line.add .dg { color: #8fc97a; }
.diff-line.del { background: rgba(224, 101, 85, 0.09); color: #dfa199; }
.diff-line.del .dg { color: #e06555; }
.diff-skip {
  padding: 3px 14px 3px 42px;
  color: var(--text-faint);
  font-size: 11px;
  font-style: italic;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
  margin: 4px 0;
}
.diff-summary {
  padding: 4px 14px 10px 14px;
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-ui);
}
.diff-summary .da { color: #8fc97a; }
.diff-summary .dd { color: #e06555; }

.usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 12.5px;
}
.usage-row + .usage-row { border-top: 1px solid var(--border); }
.usage-model {
  flex: 1;
  min-width: 0;
  color: var(--text-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-detail { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }
.usage-cost { color: var(--text); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-row.total { border-top: 1px solid var(--border-strong); }
.usage-row.total .usage-model { color: var(--text-hi); font-weight: 600; }
.usage-row.total .usage-cost { color: var(--accent); }
.usage-empty { padding: 8px 0; color: var(--text-faint); font-size: 12.5px; }

.settings-modal {
  width: min(760px, 94vw);
  height: min(540px, 88dvh);
  display: flex;
  flex-direction: column;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.55);
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.settings-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  color: var(--text-hi);
}

.settings-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
  padding: 0;
}

.settings-tabs {
  width: 176px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-sidebar) 55%, transparent);
}
.settings-tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  background: none;
  border: none;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}
.settings-tabs button svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-faint); transition: color 0.14s; }
.settings-tabs button:hover { background: var(--bg-hover); color: var(--text); }
.settings-tabs button.active { background: var(--accent-soft); color: var(--text-hi); }
.settings-tabs button.active svg { color: var(--accent); }

.settings-panes {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 18px 24px 24px;
}
.settings-panes::-webkit-scrollbar { width: 5px; }
.settings-panes::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 99px; }

.settings-pane { display: none; }
.settings-pane.active { display: block; animation: pane-in 0.22s cubic-bezier(0.2, 0.7, 0.2, 1) both; }

@keyframes pane-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.pane-title {
  margin: 2px 0 3px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: 0.005em;
  color: var(--text-hi);
}
.pane-sub {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-faint);
}

.setting-group {
  padding: 2px 14px;
  background: rgba(255, 255, 255, 0.016);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.setting-group + .setting-group { margin-top: 12px; }
[data-theme="light"] .setting-group { background: rgba(0, 0, 0, 0.018); }
.setting-group.danger-group {
  border-color: rgba(224, 101, 85, 0.28);
  background: rgba(224, 101, 85, 0.05);
}

.account-row { padding: 14px 0; }
.account-avatar {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(160deg, #f09a48, #d8741d);
  color: #fff7ea;
  font-size: 16px;
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (max-width: 620px) {
  .settings-tabs { width: 56px; padding: 12px 8px; }
  .settings-tabs button { justify-content: center; padding: 10px 0; }
  .settings-tabs button span { display: none; }
  .settings-panes { padding: 16px 16px 20px; }
  .setting-input { width: 130px; }
  .theme-grid,
  .style-grid { grid-template-columns: 1fr 1fr; }
  .tpl-grid { grid-template-columns: 1fr; }
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
}
.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.setting-name { font-size: 13px; color: var(--text-hi); }
.setting-desc { font-size: 11.5px; color: var(--text-faint); }

.setting-input {
  width: 170px;
  padding: 7px 11px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text-hi);
  font-family: var(--font-ui);
  font-size: 13px;
  caret-color: var(--accent);
  transition: border-color 0.15s;
}
.setting-input:focus { border-color: var(--border-strong); }

.switch {
  position: relative;
  width: 36px;
  height: 21px;
  flex-shrink: 0;
  background: rgba(120, 120, 120, 0.25);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(15px); }

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-card {
  position: relative;
  padding: 0;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.theme-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.theme-card.selected { border-color: var(--accent); }

.theme-preview {
  height: 58px;
  display: flex;
  align-items: flex-end;
  padding: 8px;
}
.theme-preview-bar {
  width: 100%;
  height: 18px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
}
.theme-dot { width: 7px; height: 7px; border-radius: 50%; }
.theme-line { flex: 1; height: 3.5px; border-radius: 99px; opacity: 0.5; }

.theme-card-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 0 8px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.theme-card.selected .theme-card-name { color: var(--text-hi); }
.theme-card-name svg { width: 12px; height: 12px; color: var(--accent); display: none; }
.theme-card.selected .theme-card-name svg { display: block; }

.style-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.style-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: border-color 0.15s, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.style-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.style-card.selected { border-color: var(--accent); }

.style-mock {
  display: flex;
  gap: 5px;
  height: 74px;
  padding: 8px;
  background: var(--bg-app);
}
.sm-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 22%;
  padding: 5px 4px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
}
.sm-side i { display: block; height: 4px; border-radius: 99px; background: var(--text-faint); opacity: 0.55; }
.sm-side i:first-child { background: var(--accent); opacity: 0.9; }
.sm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 5px 2px 0;
}
.sm-line { display: block; height: 4px; width: 78%; border-radius: 99px; background: var(--text-faint); opacity: 0.4; }
.sm-line.short { width: 46%; }
.sm-composer {
  display: block;
  height: 15px;
  margin-top: 3px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
}

.style-mock--classic .sm-side { border-radius: 5px; }
.style-mock--classic .sm-composer { border-radius: 6px; }

.style-mock--compact { gap: 3px; padding: 6px; }
.style-mock--compact .sm-side { width: 19%; gap: 3px; border-radius: 3px; padding: 4px 3px; }
.style-mock--compact .sm-side i { height: 3px; }
.style-mock--compact .sm-main { gap: 3px; }
.style-mock--compact .sm-line { height: 3px; }
.style-mock--compact .sm-composer { height: 11px; border-radius: 4px; }

.style-mock--soft { gap: 6px; }
.style-mock--soft .sm-side { border-radius: 10px; }
.style-mock--soft .sm-composer { border-radius: 99px; }

.style-mock--sharp .sm-side { border-radius: 2px; border-color: var(--border-strong); }
.style-mock--sharp .sm-composer { border-radius: 2px; border-color: var(--border-strong); }

.style-mock--glass {
  background-color: var(--bg-app);
  background-image:
    radial-gradient(120% 130% at 10% -20%, var(--accent-soft), transparent 62%),
    radial-gradient(90% 110% at 105% 120%, var(--accent-soft), transparent 65%);
}
.style-mock--glass .sm-side {
  background: color-mix(in srgb, var(--bg-sidebar) 45%, transparent);
  border-color: var(--border-strong);
  border-radius: 6px;
}
.style-mock--glass .sm-composer {
  background: color-mix(in srgb, var(--bg-input) 45%, transparent);
  border-radius: 7px;
}

.style-mock--frame { background: var(--bg-sidebar); gap: 4px; }
.style-mock--frame .sm-side { background: transparent; border-color: transparent; }
.style-mock--frame .sm-main {
  background: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
}
.style-mock--frame .sm-composer { border-radius: 5px; }

.style-mock--zen .sm-side { background: transparent; border-color: transparent; }
.style-mock--zen .sm-side i { opacity: 0.3; }
.style-mock--zen .sm-side i:first-child { opacity: 0.75; }
.style-mock--zen .sm-composer {
  height: 9px;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-strong);
  border-radius: 0;
}

.style-mock--bold .sm-side { border-width: 1.5px; border-radius: 4px; }
.style-mock--bold .sm-side i { height: 5px; }
.style-mock--bold .sm-line { height: 5px; opacity: 0.55; }
.style-mock--bold .sm-composer {
  height: 16px;
  border: 1.5px solid color-mix(in srgb, var(--accent) 60%, transparent);
  border-radius: 6px;
}

.style-card-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 1px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.style-card.selected .style-card-name { color: var(--text-hi); }
.style-card-name svg { width: 12px; height: 12px; color: var(--accent); display: none; }
.style-card.selected .style-card-name svg { display: block; }
.style-card-desc {
  padding: 2px 10px 9px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-faint);
}

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

.tpl-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  font-family: var(--font-ui);
  transition: border-color 0.15s, transform 0.18s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tpl-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.tpl-card.selected { border-color: var(--accent); }

.tpl-mock {
  display: flex;
  gap: 5px;
  height: 92px;
  padding: 8px;
  background: var(--bg-app);
}
.tm-dot {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--accent);
  opacity: 0.9;
}
.tm-line {
  display: block;
  height: 4px;
  width: 76%;
  border-radius: 99px;
  background: var(--text-faint);
  opacity: 0.4;
}
.tm-line.short { width: 45%; }
.tm-composer {
  display: block;
  height: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}
.tm-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  padding: 4px 2px 0;
}

.tpl-mock--classic .tm-side {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 24%;
  padding: 6px 5px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.tpl-mock--classic .tm-side i {
  display: block;
  height: 4px;
  border-radius: 99px;
  background: var(--text-faint);
  opacity: 0.5;
}
.tpl-mock--classic .tm-side .tm-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  opacity: 0.9;
}

.tpl-mock--deck { flex-direction: column; gap: 6px; }
.tpl-mock--deck .tm-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 17px;
  padding: 0 6px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: 5px;
}
.tpl-mock--deck .tm-bar i {
  display: block;
  width: 14px;
  height: 3.5px;
  border-radius: 99px;
  background: var(--text-faint);
  opacity: 0.5;
}
.tpl-mock--deck .tm-bar .tm-dot {
  width: 6px;
  height: 6px;
  border-radius: 2.5px;
  background: var(--accent);
  opacity: 0.9;
}
.tpl-mock--deck .tm-bar .tm-gap { flex: 1; background: none; }
.tpl-mock--deck .tm-body { padding: 0 12%; }

.tpl-mock--hub {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.tpl-mock--hub .tm-title {
  display: block;
  width: 34%;
  height: 5px;
  border-radius: 99px;
  background: var(--text-dim);
  opacity: 0.7;
}
.tpl-mock--hub .tm-composer { width: 64%; }
.tpl-mock--hub .tm-cards { display: flex; gap: 4px; width: 64%; }
.tpl-mock--hub .tm-cards i {
  flex: 1;
  height: 13px;
  border-radius: 4px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
}

.tpl-mock--studio {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
}
.tpl-mock--studio .tm-no {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.tpl-mock--studio .tm-serif {
  display: block;
  width: 58%;
  height: 7px;
  border-radius: 3px;
  background: var(--text);
  opacity: 0.75;
}
.tpl-mock--studio .tm-line { width: 88%; }
.tpl-mock--studio .tm-line.short { width: 52%; }

.tpl-card-name {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 1px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.tpl-card.selected .tpl-card-name { color: var(--text-hi); }
.tpl-card-name svg { width: 12px; height: 12px; color: var(--accent); display: none; }
.tpl-card.selected .tpl-card-name svg { display: block; }
.tpl-card-desc {
  padding: 2px 10px 9px;
  text-align: center;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-faint);
}

[data-style="compact"] .sidebar { width: 240px; }
[data-style="compact"] .sidebar-inner { width: 240px; min-width: 240px; }
[data-style="compact"] .app.sidebar-rail .sidebar,
[data-style="compact"] .app.sidebar-rail .sidebar-inner { width: 64px; min-width: 64px; }
[data-style="compact"] .sidebar-top { padding: 12px 12px 8px; }
[data-style="compact"] .nav-item { padding: 5px 8px; font-size: 12.5px; border-radius: 8px; }
[data-style="compact"] .chat-item { padding: 4px 7px; font-size: 12px; border-radius: 7px; }
[data-style="compact"] .chat-row { border-radius: 7px; }
[data-style="compact"] .chat-group + .chat-group { margin-top: 12px; }
[data-style="compact"] .main-top { padding: 10px 16px 4px; }
[data-style="compact"] .greeting { font-size: clamp(24px, 2.5vw, 30px); margin-bottom: 18px; }
[data-style="compact"] .composer { border-radius: 14px; padding: 10px 12px 9px; }
[data-style="compact"] .composer textarea { font-size: 13px; min-height: 36px; }
[data-style="compact"] .composer-bar { margin-top: 7px; gap: 6px; }
[data-style="compact"] .chip { padding: 4.5px 9px; font-size: 11.5px; }
[data-style="compact"] .round-btn { width: 25px; height: 25px; }
[data-style="compact"] .send-btn { width: 30px; height: 30px; border-radius: 9px; }
[data-style="compact"] .qa-btn { padding: 5px 9px; border-radius: 8px; font-size: 11.5px; }
[data-style="compact"] .msg.user .bubble { border-radius: 12px 12px 4px 12px; padding: 8px 12px; font-size: 13px; }
[data-style="compact"] .ai-text { font-size: 13px; line-height: 1.55; }
[data-style="compact"] .stage.chatting .thread { gap: 12px; }
[data-style="compact"] .ai-badge { width: 21px; height: 21px; }
[data-style="compact"] .ai-badge svg { width: 14px; height: 14px; }
[data-style="compact"] .codeblock { border-radius: 10px; margin: 9px 0; }
[data-style="compact"] .think-panel { border-radius: 9px; }
[data-style="compact"] .stage { padding: 0 24px 24px; }

[data-style="soft"] .sidebar {
  margin: 12px 0 12px 12px;
  height: calc(100% - 24px);
  border: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 20px;
}
[data-style="soft"] .app.sidebar-hidden .sidebar { margin-left: 0; border-color: transparent; }
[data-style="soft"] .nav-item { border-radius: 12px; padding: 8px 10px; }
[data-style="soft"] .chat-item { border-radius: 11px; }
[data-style="soft"] .chat-row { border-radius: 11px; }
[data-style="soft"] .icon-btn { border-radius: 12px; }
[data-style="soft"] .composer {
  border-radius: 26px;
  padding: 16px 18px 13px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}
[data-style="soft"] .composer textarea { padding: 2px 6px; }
[data-style="soft"] .send-btn { border-radius: 999px; }
[data-style="soft"] .qa-btn { border-radius: 999px; padding: 8px 14px; }
[data-style="soft"] .msg.user .bubble { border-radius: 20px 20px 8px 20px; padding: 11px 16px; }
[data-style="soft"] .ai-badge { border-radius: 50%; }
[data-style="soft"] .stage.chatting .thread { gap: 22px; }
[data-style="soft"] .codeblock { border-radius: 18px; }
[data-style="soft"] .think-panel { border-radius: 16px; }
[data-style="soft"] .model-menu { border-radius: 18px; }
[data-style="soft"] .palette { border-radius: 22px; }
[data-style="soft"] .settings-modal { border-radius: 24px; }
[data-style="soft"] .project-card,
[data-style="soft"] .doc-card,
[data-style="soft"] .lib-card { border-radius: 20px; }
[data-style="soft"] .file-card { border-radius: 18px; }
[data-style="soft"] .toast { border-radius: 999px; padding: 9px 18px; }
[data-style="soft"] .gen-image { border-radius: 20px; }

@media (max-width: 960px) {
  [data-style="soft"] .sidebar {
    margin: 0;
    height: 100%;
    border-radius: 0 20px 20px 0;
  }
}

[data-style="sharp"] .sidebar { border-right-color: var(--border-strong); }
[data-style="sharp"] .nav-item,
[data-style="sharp"] .icon-btn { border-radius: 4px; }
[data-style="sharp"] .chat-item,
[data-style="sharp"] .chat-row { border-radius: 3px; }
[data-style="sharp"] .kbd { border-radius: 3px; }
[data-style="sharp"] .composer {
  border-radius: 8px;
  border-color: var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}
[data-style="sharp"] .composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
[data-style="sharp"] .chip,
[data-style="sharp"] .round-btn,
[data-style="sharp"] .qa-btn { border-radius: 5px; }
[data-style="sharp"] .send-btn { border-radius: 6px; }
[data-style="sharp"] .model-btn { border-radius: 4px; }
[data-style="sharp"] .model-menu { border-radius: 8px; }
[data-style="sharp"] .model-option { border-radius: 4px; }
[data-style="sharp"] .msg.user .bubble { border-radius: 8px 8px 2px 8px; }
[data-style="sharp"] .ai-badge { border-radius: 5px; }
[data-style="sharp"] .codeblock { border-radius: 7px; }
[data-style="sharp"] .think-panel { border-radius: 6px; }
[data-style="sharp"] .palette,
[data-style="sharp"] .settings-modal { border-radius: 12px; }
[data-style="sharp"] .project-card,
[data-style="sharp"] .doc-card,
[data-style="sharp"] .lib-card,
[data-style="sharp"] .file-card { border-radius: 7px; }
[data-style="sharp"] .toast { border-radius: 7px; }
[data-style="sharp"] .gen-image { border-radius: 8px; }
[data-style="sharp"] .greeting { letter-spacing: -0.012em; }

[data-style="glass"] .app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52% 48% at 12% -8%, var(--accent-soft) 0%, transparent 70%),
    radial-gradient(60% 56% at 104% 112%, var(--accent-soft) 0%, transparent 72%);
}
[data-style="glass"] .main { background: transparent; }
[data-style="glass"] .sidebar {
  background: color-mix(in srgb, var(--bg-sidebar) 52%, transparent);
  -webkit-backdrop-filter: blur(26px) saturate(1.25);
  backdrop-filter: blur(26px) saturate(1.25);
}
[data-style="glass"] .composer {
  background: color-mix(in srgb, var(--bg-input) 55%, transparent);
  border-color: var(--border-strong);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.3);
}
[data-style="glass"] .msg.user .bubble {
  background: color-mix(in srgb, var(--bubble-user) 62%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
[data-style="glass"] .think-panel { background: color-mix(in srgb, var(--bg-input) 45%, transparent); }
[data-style="glass"] .model-menu,
[data-style="glass"] .palette,
[data-style="glass"] .settings-modal,
[data-style="glass"] .toast {
  background: color-mix(in srgb, var(--bg-menu) 72%, transparent);
  -webkit-backdrop-filter: blur(30px) saturate(1.2);
  backdrop-filter: blur(30px) saturate(1.2);
}

[data-style="frame"] .app { background: var(--bg-sidebar); }
[data-style="frame"] .sidebar { background: transparent; border-right-color: transparent; }
[data-style="frame"] .main {
  margin: 14px 14px 14px 6px;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
  transition: margin 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
[data-style="frame"] .app.sidebar-hidden .main { margin-left: 14px; }

@media (max-width: 960px) {
  [data-style="frame"] .sidebar {
    background: var(--bg-sidebar);
    border-right-color: var(--border);
  }
  [data-style="frame"] .main { margin: 10px; }
}

@media (max-width: 620px) {
  [data-style="frame"] .main { margin: 7px; border-radius: 14px; }
}

[data-style="zen"] .sidebar { background: transparent; border-right-color: transparent; }
[data-style="zen"] .composer {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-strong);
  border-radius: 0;
  box-shadow: none;
  padding: 6px 2px 10px;
  transition: border-color 0.25s;
}
[data-style="zen"] .composer:focus-within { border-bottom-color: color-mix(in srgb, var(--accent) 70%, var(--border-strong)); }
[data-style="zen"] .composer-snake { display: none; }
[data-style="zen"] .chip,
[data-style="zen"] .round-btn,
[data-style="zen"] .qa-btn { background: transparent; border-color: transparent; }
[data-style="zen"] .chip:hover,
[data-style="zen"] .round-btn:hover,
[data-style="zen"] .qa-btn:hover { background: var(--bg-hover); border-color: transparent; }
[data-style="zen"] .chip.active { background: var(--accent-soft); border-color: transparent; }
[data-style="zen"] .send-btn { border-radius: 999px; }
[data-style="zen"] .greeting { font-size: clamp(30px, 3.4vw, 44px); margin-bottom: 30px; }
[data-style="zen"] .msg.user .bubble {
  max-width: 86%;
  background: transparent;
  border: none;
  border-left: 2px solid var(--accent);
  border-radius: 0;
  padding: 2px 0 2px 14px;
}
[data-style="zen"] .msg.ai { gap: 0; }
[data-style="zen"] .ai-badge { display: none; }
[data-style="zen"] .ai-text { max-width: 100%; }
[data-style="zen"] .stage.chatting .thread { gap: 26px; }
[data-style="zen"] .codeblock { border-radius: 12px; }
[data-style="zen"] .think-panel { border-radius: 10px; }

@media (max-width: 960px) {
  [data-style="zen"] .sidebar { background: var(--bg-sidebar); }
}

[data-style="bold"] .sidebar { border-right-color: var(--border-strong); }
[data-style="bold"] .nav-item { font-weight: 600; }
[data-style="bold"] .greeting {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: clamp(29px, 3.1vw, 39px);
  letter-spacing: -0.035em;
  line-height: 1.14;
}
[data-style="bold"] .composer { border: 2px solid var(--border-strong); border-radius: 18px; }
[data-style="bold"] .composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35), 0 0 0 4px var(--accent-soft);
}
[data-style="bold"] .composer-snake { display: none; }
[data-style="bold"] .send-btn { width: 40px; height: 40px; border-radius: 14px; }
[data-style="bold"] .send-btn svg { width: 17px; height: 17px; }
[data-style="bold"] .chip,
[data-style="bold"] .qa-btn { border-width: 1.5px; font-weight: 600; }
[data-style="bold"] .qa-btn { padding: 8px 13px; }
[data-style="bold"] .round-btn { border-width: 1.5px; }
[data-style="bold"] .msg.user .bubble {
  background: var(--accent-soft);
  border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 16px 16px 5px 16px;
  font-weight: 500;
}
[data-style="bold"] .ai-badge { width: 28px; height: 28px; border-radius: 9px; }
[data-style="bold"] .ai-badge svg { width: 18px; height: 18px; }
[data-style="bold"] .codeblock { border: 1.5px solid var(--border-strong); border-radius: 14px; }
[data-style="bold"] .think-panel { border-width: 1.5px; }
[data-style="bold"] .model-menu { border-width: 1.5px; }
[data-style="bold"] .palette,
[data-style="bold"] .settings-modal { border-width: 1.5px; }
[data-style="bold"] .toast { border-width: 1.5px; font-weight: 600; }

.danger-btn {
  padding: 7px 14px;
  background: rgba(224, 101, 85, 0.1);
  border: 1px solid rgba(224, 101, 85, 0.3);
  border-radius: 9px;
  color: #e06555;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.danger-btn:hover { background: rgba(224, 101, 85, 0.18); border-color: rgba(224, 101, 85, 0.5); }
.danger-btn.confirm { background: #c14b3c; border-color: #c14b3c; color: #fff; }

.settings-foot {
  padding: 10px 0 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-faint);
}

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

.admin-list { display: flex; flex-direction: column; }

.admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  animation: row-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes row-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: none; }
}
.admin-row + .admin-row { border-top: 1px solid var(--border); }
.admin-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.admin-name {
  font-size: 13px;
  color: var(--text-hi);
  display: flex;
  align-items: center;
  gap: 6px;
}
.admin-email {
  font-size: 11.5px;
  color: var(--text-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.status-pill.ok { background: rgba(143, 201, 122, 0.14); color: #8fc97a; }
.status-pill.pending { background: rgba(224, 163, 92, 0.14); color: #e0a35c; }
.status-pill.admin { background: var(--accent-soft); color: var(--accent); }

.admin-empty { padding: 14px 0; color: var(--text-faint); font-size: 12.5px; }

.you-badge {
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text-faint);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.admin-action {
  flex-shrink: 0;
  padding: 5px 12px;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.admin-action:hover { background: color-mix(in srgb, var(--accent) 24%, transparent); }
.admin-action:disabled { opacity: 0.5; cursor: default; }
.admin-action.revoke {
  background: transparent;
  border-color: var(--border);
  color: var(--text-dim);
}
.admin-action.revoke:hover { border-color: rgba(224, 101, 85, 0.5); color: #e06555; background: rgba(224, 101, 85, 0.08); }

.admin-audit { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.admin-audit-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.admin-audit-title svg { width: 12px; height: 12px; }
.audit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--text-dim);
  animation: row-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.audit-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.audit-dot.ok { background: #8fc97a; }
.audit-dot.warn { background: #e0a35c; }
.audit-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-text b { color: var(--text); font-weight: 600; }
.audit-when { flex-shrink: 0; font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.ghost-btn:active, .admin-action:active, .icon-btn:active, .danger-btn:active { transform: scale(0.96); }
.ghost-btn, .admin-action, .icon-btn, .danger-btn { will-change: transform; }

[data-reduce-motion] .composer-snake { display: none; }
[data-reduce-motion] .msg { animation: none; }
[data-reduce-motion] .tdot,
[data-reduce-motion] .typing-label,
[data-reduce-motion] .web-status { animation: none; }
[data-reduce-motion] .think-panel.live .think-label { animation: none; background: none; color: var(--text-dim); -webkit-background-clip: initial; background-clip: initial; }
[data-reduce-motion] .settings-modal,
[data-reduce-motion] .settings-pane.active,
[data-reduce-motion] .admin-row,
[data-reduce-motion] .audit-row,
[data-reduce-motion] .palette,
[data-reduce-motion] .overlay { animation: none; }
[data-reduce-motion] .toast { transition: opacity 0.2s; transform: translateX(-50%); }
[data-reduce-motion] .toast.show { transform: translateX(-50%); }
[data-reduce-motion] .theme-card:hover { transform: none; }

@media (max-width: 960px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 20;
    box-shadow: 30px 0 60px rgba(0, 0, 0, 0.35);
  }
}

@media (max-width: 620px) {
  .stage { padding: 0 14px 16px; }
  .greeting { font-size: 27px; }
  .composer-bar { flex-wrap: wrap; row-gap: 8px; }
  .msg.user .bubble { max-width: 92%; }
  .ai-text { max-width: 100%; }
}

.home-recents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.home-recents-label {
  grid-column: 1 / -1;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.recent-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid var(--border);
  border-radius: 13px;
  cursor: pointer;
  font-family: var(--font-ui);
  text-align: left;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.recent-card:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.recent-card-title {
  width: 100%;
  font-size: 12.5px;
  color: var(--text-hi);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-card-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-faint);
}
[data-theme="light"] .recent-card { background: rgba(0, 0, 0, 0.02); }
[data-reduce-motion] .recent-card:hover,
[data-reduce-motion] .tpl-card:hover { transform: none; }

.home-proj-card .recent-card-title { display: flex; align-items: center; gap: 7px; }
.proj-card-ico { width: 14px; height: 14px; flex-shrink: 0; color: var(--accent); }
.home-proj-card--new { border-style: dashed; background: transparent; }
.home-proj-card--new .recent-card-title { color: var(--text); }
.home-proj-card--new:hover .recent-card-title { color: var(--text-hi); }

@media (max-width: 420px) {
  .home-recents { grid-template-columns: 1fr; }
}

[data-template="deck"] .app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 0;
  grid-template-rows: auto minmax(0, 1fr);
}
[data-template="deck"] .sidebar {
  grid-row: 1;
  grid-column: 1 / -1;
  width: auto;
  height: 56px;
  margin: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  transition: height 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.35s;
}
[data-template="deck"] .main {
  grid-row: 2;
  grid-column: 1;
}
[data-template="deck"] .workspace {
  grid-row: 2;
  grid-column: 2;
}

@media (min-width: 1101px) {
  [data-template="deck"] .app {
    transition: grid-template-columns 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
  }
  [data-template="deck"] .app.workspace-open { grid-template-columns: minmax(0, 1fr) min(48%, 780px); }
  [data-template="deck"] .workspace { width: auto; transition: border-color 0.35s; }
  [data-template="deck"] .app.workspace-open .workspace { width: auto; }
}
[data-template="deck"] .app.sidebar-hidden .sidebar {
  width: auto;
  height: 0;
  border-bottom-color: transparent;
}
[data-template="deck"] .sidebar-inner {
  width: 100%;
  min-width: 0;
  height: 56px;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding-right: 10px;
}
[data-template="deck"] .sidebar-top { padding: 0 8px 0 16px; gap: 9px; min-width: 0; flex-shrink: 1; }
[data-template="deck"] .sidebar-top .icon-btn { margin-left: 6px; }
[data-template="deck"] .sidebar-nav {
  flex-direction: row;
  align-items: center;
  padding: 0;
  gap: 2px;
}
[data-template="deck"] .nav-item { width: auto; padding: 7px 11px; }
[data-template="deck"] .kbd,
[data-template="deck"] .sidebar-scroll { display: none; }
[data-template="deck"] .sidebar-bottom {
  margin-left: auto;
  border-top: none;
  padding: 0;
}

[data-template="deck"] .app.sidebar-rail .sidebar { width: auto; height: 56px; }
[data-template="deck"] .app.sidebar-rail .sidebar-inner {
  width: 100%;
  min-width: 0;
  height: 56px;
  flex-direction: row;
}
[data-template="deck"] .app.sidebar-rail .sidebar-top {
  flex-direction: row;
  gap: 9px;
  padding: 0 8px 0 16px;
}
[data-template="deck"] .app.sidebar-rail .sidebar-top .icon-btn { margin-left: 6px; }
[data-template="deck"] .app.sidebar-rail .sidebar-nav {
  flex: none;
  flex-direction: row;
  align-items: center;
  padding: 0;
  gap: 2px;
}
[data-template="deck"] .app.sidebar-rail .nav-item {
  width: auto;
  height: auto;
  justify-content: flex-start;
  padding: 7px 11px;
}
[data-template="deck"] .app.sidebar-rail .logo-name,
[data-template="deck"] .app.sidebar-rail .nav-item > span:not(.kbd) { display: inline; }
[data-template="deck"] .app.sidebar-rail .sidebar-bottom {
  justify-content: flex-end;
  padding: 0;
}
[data-template="deck"] .app.sidebar-rail .sidebar-bottom .nav-item {
  width: auto;
  height: auto;
  justify-content: flex-start;
  padding: 7px 11px;
}

[data-template="deck"] .home-recents { grid-template-columns: repeat(4, 1fr); }

[data-template="deck"][data-style="frame"] .main { margin: 0 14px 14px; }
[data-template="deck"][data-style="frame"] .app.sidebar-hidden .main { margin: 14px; }
[data-template="deck"][data-style="soft"] .sidebar { height: 56px; }

@media (max-width: 960px) {
  [data-template="deck"] .sidebar {
    position: relative;
    height: 56px;
    box-shadow: none;
  }
  [data-template="deck"] .app.sidebar-hidden .sidebar { height: 0; }
  [data-template="deck"] .nav-item > span:not(.kbd) { display: none; }
  [data-template="deck"] .nav-item { padding: 7px 9px; }
  [data-template="deck"] .home-recents { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  [data-template="deck"] .logo-name { display: none; }
}

[data-template="hub"] .stage-inner { padding-bottom: 3vh; }
[data-template="hub"] .greeting {
  text-align: center;
  margin-bottom: 30px;
  font-size: clamp(30px, 3.2vw, 42px);
}
[data-template="hub"] .quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
[data-template="hub"] .qa-btn {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 14px;
}
[data-template="hub"] .qa-btn svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}
[data-template="hub"] .home-recents { margin-top: 22px; }

@media (max-width: 900px) {
  [data-template="hub"] .quick-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  [data-template="hub"] .home-recents { grid-template-columns: 1fr; }
}

[data-template="studio"] .stage-inner { width: min(700px, 100%); }
[data-template="studio"] .greeting-name {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
[data-template="studio"] .stage.chatting .thread {
  counter-reset: q;
  gap: 14px;
  padding-bottom: 28px;
}
[data-template="studio"] .msg.user {
  counter-increment: q;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 14px;
}
[data-template="studio"] .msg.user:first-child { margin-top: 0; }
[data-template="studio"] .msg.user:not(:first-child) {
  border-top: 1px solid var(--border);
  padding-top: 26px;
}
[data-template="studio"] .msg.user .bubble {
  width: 100%;
  max-width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.35;
  font-weight: 400;
  color: var(--text-hi);
}
[data-template="studio"] .msg.user .bubble::before {
  content: "№ " counter(q, decimal-leading-zero);
  display: block;
  margin-bottom: 7px;
  font-family: var(--font-ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
}
[data-template="studio"] .msg.ai { gap: 0; }
[data-template="studio"] .ai-badge { display: none; }
[data-template="studio"] .ai-text {
  max-width: 100%;
  font-size: 14px;
  line-height: 1.75;
}

@media (max-width: 620px) {
  [data-template="studio"] .msg.user .bubble { font-size: 18px; }
}

.stage.chatting .home-recents { display: none; }

.mic-btn.listening {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  animation: mic-pulse 1.6s ease-out infinite;
}
@keyframes mic-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(224, 129, 47, 0.45); }
  70%  { box-shadow: 0 0 0 9px rgba(224, 129, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 129, 47, 0); }
}
[data-reduce-motion] .mic-btn.listening { animation: none; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  background: rgba(10, 8, 6, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: drop-fade 0.15s ease both;
}
@keyframes drop-fade { from { opacity: 0; } }
[data-theme="light"] .drop-overlay { background: rgba(64, 52, 34, 0.35); }
.drop-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 34px 54px;
  background: var(--bg-menu);
  border: 1.5px dashed var(--accent);
  border-radius: 22px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5);
  animation: drop-pop 0.18s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes drop-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.drop-card svg { width: 30px; height: 30px; color: var(--accent); margin-bottom: 4px; }
.drop-title { font-size: 15px; font-weight: 600; color: var(--text-hi); }
.drop-sub { font-size: 12px; color: var(--text-faint); }

.jump-bottom {
  align-self: center;
  width: 36px;
  height: 36px;
  margin: -48px 0 12px;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 0;
  background: var(--bg-menu);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s, background 0.15s, color 0.15s;
}
.jump-bottom:hover { transform: translateY(-2px); background: var(--bg-hover); color: var(--text-hi); }
.jump-bottom svg { width: 16px; height: 16px; }
[data-reduce-motion] .jump-bottom:hover { transform: none; }

.ws-pick.armed {
  color: var(--accent);
  background: var(--accent-soft);
  animation: mic-pulse 1.6s ease-out infinite;
}
[data-reduce-motion] .ws-pick.armed { animation: none; }

.attach-chip.pick-chip {
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  background: var(--accent-soft);
}
.attach-chip.pick-chip > svg { color: var(--accent); }
.attach-chip.pick-chip .attach-name {
  font-family: ui-monospace, "Cascadia Mono", Menlo, monospace;
  font-size: 11px;
  color: var(--text-hi);
}

.file-card.edit-card > svg { color: #8fc97a; }
.file-card.delete-card > svg { color: #e06555; }
.file-card.delete-card .file-card-name { text-decoration: line-through; opacity: 0.75; }

.fix-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 10px 13px;
  background: rgba(224, 163, 92, 0.08);
  border: 1px solid rgba(224, 163, 92, 0.35);
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text);
  animation: msg-in 0.3s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.fix-notice > svg { width: 17px; height: 17px; flex-shrink: 0; color: #e0a35c; }
.fix-notice > span { flex: 1; min-width: 0; line-height: 1.5; }
.fix-notice .ghost-btn { flex-shrink: 0; border-color: rgba(224, 163, 92, 0.4); color: #e0a35c; }
.fix-notice .ghost-btn:hover { background: rgba(224, 163, 92, 0.12); color: #f0b76e; }
