:root {
  color-scheme: light;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --panel: #f0f1ef;
  --line: #d9ddd8;
  --line-strong: #c9cec8;
  --text: #191b1d;
  --muted: #68706c;
  --faint: #8a928d;
  --accent: #42596b;
  --accent-soft: #e7edf1;
  --success: #1f7a4d;
  --warn: #956b1e;
  --error: #b24343;
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --aida-page-bg: #081817;
  --aida-panel-bg: #0f1617;
  --aida-text: #f5fffc;
  --aida-muted: #d5e3df;
  --aida-accent: #34c06a;
  --aida-accent-strong: #22a45c;
  --aida-button-bg: #0f7a49;
  --aida-button-hover-bg: #0f7a49;
  --aida-button-border: rgba(232, 255, 237, .22);
  --aida-button-hover-border: rgba(213, 255, 247, .44);
  --aida-button-dots: rgba(238, 255, 241, .35);
  --aida-button-dots-opacity: .35;
  --aida-button-dots-hover-opacity: .34;
  --aida-button-dots-size: 7px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; background: var(--bg); color: var(--text); }
body { font: 14px/1.45 var(--font); letter-spacing: 0; }
button, textarea, select, input { font: inherit; }
button { cursor: pointer; }
svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }

.login-screen {
  --login-bg: var(--aida-page-bg);
  --login-panel: rgba(4, 10, 10, 0.94);
  --login-panel-soft: rgba(4, 10, 10, .92);
  --login-line: rgba(236, 255, 241, .52);
  --login-line-soft: rgba(48, 214, 109, .18);
  --login-text: var(--aida-text);
  --login-muted: var(--aida-muted);
  --login-dim: #82a19a;
  --login-accent: var(--aida-accent);
  --login-accent-strong: var(--aida-accent-strong);
  --login-card-bg: var(--aida-panel-bg);
  --login-button-bg: var(--aida-button-bg);
  --login-button-hover-bg: var(--aida-button-hover-bg);
  --login-button-border: var(--aida-button-border);
  --login-button-hover-border: var(--aida-button-hover-border);
  --login-button-dots: var(--aida-button-dots);
  --login-button-dots-opacity: var(--aida-button-dots-opacity);
  --login-button-dots-hover-opacity: var(--aida-button-dots-hover-opacity);
  --login-button-dots-size: var(--aida-button-dots-size);
  min-height: 100vh;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(ellipse 25% 30% at 53% 39%, rgba(58, 218, 111, .30), rgba(47, 151, 82, .10) 42%, rgba(17, 18, 22, 0) 76%),
    radial-gradient(ellipse 30% 40% at 43% 64%, rgba(51, 199, 101, .18), rgba(38, 126, 74, .10) 42%, rgba(17, 18, 22, 0) 78%),
    radial-gradient(ellipse 58% 44% at 50% 50%, rgba(41, 154, 86, .11) 0%, rgba(30, 75, 50, .07) 36%, rgba(17, 18, 22, 0) 78%),
    linear-gradient(120deg, rgba(68, 255, 135, .055), rgba(17, 18, 22, 0) 28%, rgba(77, 93, 77, .035) 68%, rgba(17, 18, 22, 0)),
    linear-gradient(180deg, #14151a 0%, var(--login-bg) 54%, #0d0e12 100%);
  color: var(--login-text);
}

.login-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(circle, rgba(238, 255, 242, .2) .38px, transparent .62px),
    radial-gradient(circle, rgba(49, 232, 121, .08) .34px, transparent .58px);
  background-position: center, 3.5px 3.5px;
  background-size: 7px 7px, 7px 7px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, rgba(0, 0, 0, .82) 58%, rgba(0, 0, 0, .28) 88%, transparent 100%);
  mask-image: radial-gradient(ellipse at center, #000 0%, rgba(0, 0, 0, .82) 58%, rgba(0, 0, 0, .28) 88%, transparent 100%);
  opacity: .95;
  mix-blend-mode: normal;
}

.login-grid-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    radial-gradient(circle, rgba(226, 255, 232, .32) .38px, transparent .62px),
    radial-gradient(circle, rgba(49, 232, 121, .2) .34px, transparent .58px);
  background-position: center, 3.5px 3.5px;
  background-size: 7px 7px, 7px 7px;
  -webkit-mask-image:
    radial-gradient(ellipse 30% 13% at 58% 39%, #000 0%, rgba(0, 0, 0, .58) 42%, transparent 78%),
    radial-gradient(ellipse 38% 15% at 43% 64%, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 76%);
  mask-image:
    radial-gradient(ellipse 30% 13% at 58% 39%, #000 0%, rgba(0, 0, 0, .58) 42%, transparent 78%),
    radial-gradient(ellipse 38% 15% at 43% 64%, #000 0%, rgba(0, 0, 0, .5) 40%, transparent 76%);
  mask-composite: add;
  opacity: .62;
  pointer-events: none;
}

.login-screen::before,
.login-screen::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.login-screen::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 10, 13, .36) 0%, transparent 24%, transparent 76%, rgba(9, 10, 13, .36) 100%),
    linear-gradient(180deg, rgba(9, 10, 13, .18) 0%, transparent 28%, transparent 76%, rgba(9, 10, 13, .44) 100%);
}

.login-screen::after {
  width: 980px;
  height: 420px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 0%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse 38% 20% at 58% 34%, rgba(67, 226, 121, .18), rgba(67, 226, 121, .07) 46%, transparent 78%),
    radial-gradient(ellipse 46% 23% at 42% 68%, rgba(48, 198, 100, .14), rgba(48, 198, 100, .055) 46%, transparent 78%);
  filter: blur(76px);
  opacity: .96;
}

.login-glow {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(38px);
}

.login-glow-main {
  width: 900px;
  height: 300px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 16%);
  background:
    linear-gradient(118deg, transparent 0%, rgba(55, 210, 109, .12) 36%, rgba(55, 210, 109, .055) 55%, transparent 78%);
  filter: blur(54px);
}

.login-glow-side {
  display: none;
}

.login-card {
  width: min(clamp(480px, 37.5vw, 670px), calc(100vw - 48px));
  min-height: 292px;
  position: relative;
  z-index: 2;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(var(--login-card-bg), var(--login-card-bg)) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, .4), rgba(229, 255, 234, .18) 32%, rgba(51, 211, 104, .28) 58%, rgba(255, 255, 255, .12) 100%) border-box;
  padding: 38px 42px 31px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .035) inset,
    0 0 22px rgba(206, 255, 218, .08),
    0 28px 90px rgba(0, 0, 0, .68);
  backdrop-filter: blur(4px);
}

.login-card::before,
.login-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.login-card::before {
  width: 210px;
  height: 3px;
  right: 112px;
  top: -2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .96), rgba(172, 255, 191, .74), transparent);
  box-shadow: 0 0 19px rgba(185, 255, 202, .42);
  filter: blur(.5px);
}

.login-card::after {
  width: 116px;
  height: 3px;
  left: 42px;
  bottom: -2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(238, 255, 242, .84), rgba(50, 226, 111, .44), transparent);
  box-shadow: 0 0 17px rgba(190, 255, 204, .32);
  filter: blur(.6px);
}

.login-card-shine {
  display: none;
}

.login-card > *:not(.login-card-shine) {
  position: relative;
  z-index: 2;
}

.login-card h1 {
  margin: 0;
  color: var(--login-accent);
  font-size: clamp(30px, 3vw, 35px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: .01em;
  text-shadow: 0 0 15px rgba(18, 247, 207, .34);
}

.login-subtitle {
  margin: 18px 0 0;
  color: var(--login-text);
  font-size: 15px;
  font-weight: 600;
}

.telegram-login-slot {
  min-height: 58px;
  margin-top: 30px;
  display: flex;
  align-items: center;
}

.telegram-login-button {
  width: 100%;
  min-height: 58px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--login-button-border);
  border-radius: 10px;
  background: var(--login-button-bg);
  color: #f3fffc;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .1) inset,
    0 -18px 42px rgba(0, 0, 0, .18) inset,
    0 0 18px rgba(232, 255, 237, .045);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .64);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.telegram-login-button::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--login-button-hover-bg);
  opacity: 0;
  transition: opacity .22s ease;
  pointer-events: none;
}

.telegram-login-button::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, var(--login-button-dots) .42px, transparent .68px);
  background-position: center;
  background-size: var(--login-button-dots-size) var(--login-button-dots-size);
  opacity: var(--login-button-dots-opacity);
  pointer-events: none;
  transition: opacity .22s ease;
}

.telegram-login-button span {
  position: relative;
  z-index: 1;
}

.telegram-login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--login-button-hover-border);
  background: var(--login-button-bg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .17) inset,
    0 -18px 42px rgba(0, 0, 0, .16) inset,
    0 0 36px rgba(46, 226, 105, .32);
}

.telegram-login-button:hover:not(:disabled)::before {
  opacity: 1;
}

.telegram-login-button:hover:not(:disabled)::after {
  opacity: var(--login-button-dots-hover-opacity);
}

.telegram-login-button:focus-visible {
  outline: 2px solid rgba(130, 255, 164, .9);
  outline-offset: 3px;
}

.telegram-login-button:disabled {
  cursor: wait;
  opacity: 1;
}

.login-divider {
  height: 1px;
  margin: 25px 0 20px;
  background: linear-gradient(90deg, transparent, rgba(223, 255, 249, .18), transparent);
}

.login-status {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--login-muted);
  font-size: 15px;
}

.login-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--login-accent);
  box-shadow: 0 0 16px rgba(52, 242, 138, .92);
}

.login-status.error {
  color: #ffb4b4;
}

.login-status.error .login-status-dot {
  background: #ff6b6b;
  box-shadow: 0 0 16px rgba(255, 90, 90, .78);
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--line);
  background: #fbfbfa;
  padding: 14px 12px;
}

.sidebar-top,
.brand-row,
.section-head,
.workspace-header,
.drawer-head,
.composer-bottom {
  display: flex;
  align-items: center;
}

.sidebar-top,
.section-head,
.workspace-header,
.drawer-head { justify-content: space-between; gap: 12px; }
.brand-row { min-width: 0; gap: 10px; }
.brand-row strong { display: block; font-weight: 700; }
.brand-row span:not(.brand-mark) { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--text);
  color: white;
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}

.icon-button,
.quiet-button,
.primary-button,
.new-button,
.text-button,
.mode-tab,
.file-button,
.select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.icon-button {
  width: 38px;
  display: grid;
  place-items: center;
  padding: 0;
}

.quiet-button { padding: 0 14px; }
.primary-button {
  min-width: 150px;
  padding: 0 16px;
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 650;
}
.quiet-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.primary-button:disabled { opacity: .55; cursor: not-allowed; }
.new-button, .file-button {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  text-decoration: none;
}
.file-button { width: auto; min-width: 136px; position: relative; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.text-button { border: 0; min-height: 24px; padding: 0; background: transparent; color: var(--muted); }
.field {
  min-height: 36px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.section-label {
  margin: 0 0 8px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nav-list { display: grid; gap: 6px; }
.project-row,
.history-row {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  padding: 9px;
  text-align: left;
}
.project-row:hover,
.history-row:hover,
.project-row.active,
.history-row.active { background: var(--accent-soft); border-color: var(--line); }
.project-row strong,
.history-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-row span,
.history-row span { color: var(--muted); font-size: 12px; }
.history-row { grid-template-columns: 30px minmax(0, 1fr); align-items: center; }
.history-thumb {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--surface);
  font-size: 10px;
  font-weight: 700;
}
.history-section { min-height: 0; overflow: auto; }
.project-create {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.project-create div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.project-create .quiet-button {
  min-height: 32px;
  padding: 0 10px;
}

.workspace { min-width: 0; display: grid; grid-template-rows: 60px auto minmax(0, 1fr); min-height: 100vh; }
.workspace-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  padding: 0 20px;
}
.workspace-title { min-width: 0; }
.workspace-title h1 { margin: 0; font-size: 18px; line-height: 1.2; }
.workspace-title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.mobile-only { display: none; }

.composer-wrap {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 14px 20px;
}
.composer {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.mode-row {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.mode-tab { padding: 0 14px; min-height: 34px; }
.mode-tab.active { background: var(--panel); border-color: var(--line-strong); font-weight: 650; }
.prompt-box { display: grid; gap: 8px; padding: 14px; }
.prompt-box span { color: var(--muted); font-size: 12px; font-weight: 650; }
textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}
.settings-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) repeat(4, minmax(120px, .75fr));
  gap: 10px;
  padding: 0 14px 14px;
}
.settings-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.settings-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.composer-bottom {
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.select { padding: 0 12px; min-width: 220px; }
.select.compact { min-width: 0; width: 100%; }
.usage-panel {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
}
.usage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.usage-metric {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfbfa;
  padding: 7px 9px;
  min-width: 0;
}
.usage-metric span,
.usage-note,
.usage-notice span {
  color: var(--muted);
  font-size: 12px;
}
.usage-metric span,
.usage-metric strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.usage-metric strong { margin-top: 2px; font-size: 13px; }
.usage-metric.exhausted { border-color: #edcdcd; background: #f8ecec; }
.usage-metric.exhausted strong { color: var(--error); }
.usage-note { margin: 0; }
.usage-note.error { color: var(--error); }
.usage-notices { display: grid; gap: 6px; }
.usage-notice {
  margin: 0;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: var(--panel);
}
.usage-notice strong { font-size: 12px; }
.usage-notice.warning { border-color: #ead9b6; background: #f8f2e5; }
.usage-notice.warning strong { color: var(--warn); }
.usage-notice.error { border-color: #edcdcd; background: #f8ecec; }
.usage-notice.error strong,
.usage-notice.error span { color: var(--error); }
.reference-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}
.reference-chip {
  max-width: 100%;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  padding: 4px 6px 4px 10px;
  font-size: 12px;
}
.reference-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(25, 27, 29, .08);
  color: var(--text);
  line-height: 1;
}
.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 12px;
}
.upload-chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-message { margin: -2px 14px 12px; color: var(--muted); font-size: 12px; }
.form-message.error { color: var(--error); }

.stream {
  min-height: 0;
  overflow: auto;
  padding: 22px 20px 32px;
}
.task-panel {
  max-width: 980px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px;
}
.task-panel h2 { margin: 10px 0 4px; font-size: 18px; }
.task-panel p { margin: 0; color: var(--muted); }
.preview-box {
  margin-top: 14px;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.preview-box img,
.preview-box video { width: 100%; max-height: 520px; object-fit: contain; display: block; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--panel);
  font-size: 12px;
  font-weight: 650;
}
.status.success { color: var(--success); background: #edf6f0; border-color: #cde6d7; }
.status.processing,
.status.pending { color: var(--warn); background: #f8f2e5; border-color: #ead9b6; }
.status.failed,
.status.blocked { color: var(--error); background: #f8ecec; border-color: #edcdcd; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100vh;
  z-index: 40;
  background: var(--surface);
  border-left: 1px solid var(--line);
  transform: translateX(100%);
  transition: transform .18s ease;
}
.drawer.open { transform: translateX(0); }
.drawer-head { height: 58px; border-bottom: 1px solid var(--line); padding: 0 14px; }
.drawer-body { padding: 14px; display: grid; gap: 10px; }
.detail-row {
  display: grid;
  grid-template-columns: 115px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 9px;
}
.detail-row span:first-child { color: var(--muted); font-size: 12px; }
.detail-row span:last-child { overflow-wrap: anywhere; }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(25, 27, 29, .22);
}
.drawer-backdrop.open { display: block; }
.small-note { color: var(--muted); font-size: 12px; }
.small-note.error { color: var(--error); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 60;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--text);
  color: white;
  padding: 9px 14px;
  transition: opacity .18s ease, transform .18s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 920px) {
  .login-screen {
    padding: 18px;
    background:
      radial-gradient(ellipse 70% 36% at 50% 55%, rgba(42, 166, 84, .13), rgba(17, 18, 22, 0) 74%),
      linear-gradient(180deg, #14151a 0%, var(--login-bg) 60%, #0d0e12 100%);
  }
  .login-grid {
    background-size: 7px 7px, 7px 7px;
    opacity: .9;
  }
  .login-grid-sheen {
    background-size: 7px 7px, 7px 7px;
    opacity: .5;
  }
  .login-card {
    min-height: 0;
    width: min(354px, calc(100vw - 36px));
    border-radius: 16px;
    padding: 30px 22px 24px;
  }
  .login-card h1 {
    font-size: 29px;
  }
  .login-subtitle,
  .login-status {
    font-size: 14px;
  }
  .telegram-login-button {
    min-height: 54px;
    font-size: 17px;
  }
  .login-divider {
    margin: 22px 0 18px;
  }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 45;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: grid; }
  .workspace { grid-template-rows: 60px auto minmax(0, 1fr); }
  .workspace-header { padding: 0 10px; }
  .workspace-title h1 { font-size: 16px; }
  .workspace-title p { display: none; }
  .composer-wrap { order: -1; padding: 10px; }
  .stream { padding: 14px 10px 88px; }
  .settings-row { grid-template-columns: 1fr; }
  .composer-bottom { align-items: stretch; }
  .file-button, .select, .primary-button { width: 100%; }
  .usage-grid { grid-template-columns: 1fr; }
  .preview-box { min-height: 220px; }
}

/* AIDA workspace shell: the post-login UI is refined here while the bot backend stays untouched. */
.app-shell {
  --workspace-bg: #171b1e;
  --workspace-bg-soft: #1b2023;
  --workspace-panel: hsl(200 8% 15% / .84);
  --workspace-sidebar: #121517;
  --workspace-sidebar-deep: #0f1214;
  --workspace-line: hsl(0 0% 100% / .08);
  --workspace-line-strong: hsl(0 0% 100% / .14);
  --workspace-text: hsl(200 10% 95%);
  --workspace-muted: hsl(200 6% 72%);
  --workspace-dim: hsl(200 5% 52%);
  --workflow-accent-image: hsl(152 34% 52%);
  --workflow-accent-video: hsl(212 46% 62%);
  --workflow-accent-audio: hsl(24 48% 63%);
  --workflow-accent-chat: hsl(268 30% 68%);
  --workflow-active-accent: var(--workflow-accent-image);
  --liquid-ease-soft: cubic-bezier(.32,.72,.24,1);
  --liquid-ease-move: cubic-bezier(.22,1,.36,1);
  --liquid-glass-bg: hsl(200 8% 14% / .52);
  --liquid-glass-bg-fallback: hsl(200 8% 13% / .92);
  --liquid-glass-border: hsl(190 12% 80% / .09);
  --liquid-glass-inner: hsl(190 20% 90% / .05);
  --workspace-accent: hsl(152 34% 52%);
  --workspace-accent-strong: hsl(152 40% 42%);
  --workspace-accent-soft: color-mix(in srgb, var(--workspace-accent) 12%, transparent);
  --workspace-accent-wash: color-mix(in srgb, var(--workspace-accent) 7%, transparent);
  --workspace-accent-line: color-mix(in srgb, var(--workspace-accent) 30%, transparent);
  --workspace-accent-glow: color-mix(in srgb, var(--workspace-accent) 18%, transparent);
  --workspace-accent-text: color-mix(in srgb, var(--workspace-accent) 76%, white 24%);
  --workspace-dot-filter: hue-rotate(0deg) saturate(1);
  --settings-bg-panel: hsl(200 8% 14% / .58);
  --settings-bg-cell: hsl(200 8% 20% / .62);
  --settings-bg-cell-hover: hsl(200 8% 25% / .68);
  --settings-bg-header: hsl(200 8% 17% / .46);
  --settings-border-soft: hsl(190 12% 80% / .09);
  --settings-border-mid: hsl(190 12% 80% / .15);
  --settings-text-label: hsl(200 6% 72% / .72);
  --settings-text-muted: hsl(200 5% 52%);
  --settings-text-primary: hsl(200 10% 95% / .92);
  --settings-accent: hsl(152 34% 52%);
  --settings-accent-soft: hsl(152 34% 52% / .13);
  --settings-accent-border: hsl(152 34% 52% / .40);
  --settings-accent-glow: hsl(152 34% 52% / .14);
  --settings-accent-text: hsl(152 46% 70%);
  --motion-ease: cubic-bezier(.22,1,.36,1);
  --motion-duration: 180ms;
  --motion-pop-duration: 360ms;
  --motion-tap-scale: .955;
  --motion-tap-y: 2px;
  --motion-pop-scale: 1.035;
  --motion-ring-scale: 1.38;
  --motion-ring-opacity: .24;
  /* Later accent swaps: blue #3b82f6 / violet #8b5cf6 via the five --settings-accent* tokens. */
  width: 100vw;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  overflow: hidden;
  background: var(--workspace-sidebar-deep);
  color: var(--workspace-text);
}

.app-shell[data-workflow="video"] {
  --workspace-accent: var(--workflow-accent-video);
  --workspace-accent-strong: hsl(212 46% 50%);
  --workspace-dot-filter: hue-rotate(72deg) saturate(1.05);
  --settings-accent: var(--workflow-accent-video);
  --settings-accent-soft: hsl(212 46% 62% / .13);
  --settings-accent-border: hsl(212 46% 62% / .38);
  --settings-accent-glow: hsl(212 46% 62% / .13);
  --settings-accent-text: hsl(212 58% 76%);
}

.app-shell[data-workflow="chat"] {
  --workspace-accent: var(--workflow-accent-chat);
  --workspace-accent-strong: hsl(268 30% 54%);
  --workspace-dot-filter: hue-rotate(132deg) saturate(.95);
  --settings-accent: var(--workflow-accent-chat);
  --settings-accent-soft: hsl(268 30% 68% / .13);
  --settings-accent-border: hsl(268 30% 68% / .38);
  --settings-accent-glow: hsl(268 30% 68% / .13);
  --settings-accent-text: hsl(268 44% 80%);
}

.app-shell[data-workflow="audio"] {
  --workspace-accent: var(--workflow-accent-audio);
  --workspace-accent-strong: hsl(24 45% 49%);
  --workspace-dot-filter: hue-rotate(212deg) saturate(.9);
  --settings-accent: var(--workflow-accent-audio);
  --settings-accent-soft: hsl(24 48% 63% / .13);
  --settings-accent-border: hsl(24 48% 63% / .38);
  --settings-accent-glow: hsl(24 48% 63% / .14);
  --settings-accent-text: hsl(24 62% 78%);
}

.app-shell .sidebar {
  position: relative;
  top: auto;
  height: 100dvh;
  min-height: 0;
  gap: 16px;
  padding: 22px 20px 18px;
  overflow: auto;
  border-right: 1px solid var(--workspace-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .018), transparent 24%),
    linear-gradient(180deg, var(--workspace-sidebar), var(--workspace-sidebar-deep));
  color: var(--workspace-text);
}

.app-shell .workspace {
  position: relative;
  min-width: 0;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  overflow: hidden;
  border-left: 1px solid var(--workspace-line);
  border-top-left-radius: 28px;
  border-bottom-left-radius: 28px;
  background:
    linear-gradient(180deg, rgba(23, 27, 30, .92), rgba(18, 21, 23, .98)),
    var(--workspace-bg);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, .035),
    inset 16px 0 42px rgba(0, 0, 0, .16);
}

.app-shell .workspace::before,
.app-shell .workspace::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.app-shell .workspace::before {
  z-index: 0;
  background:
    radial-gradient(ellipse 58% 23% at var(--workspace-glow-x) 0%, color-mix(in srgb, var(--workspace-accent) 24%, transparent), var(--workspace-accent-soft) 48%, transparent 74%),
    radial-gradient(ellipse 38% 18% at 66% 2%, rgba(230, 255, 238, .075), transparent 62%),
    linear-gradient(180deg, var(--workspace-accent-soft), transparent 28%);
}

.app-shell .workspace::after {
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(238, 255, 243, .11) .42px, transparent .74px),
    radial-gradient(circle, var(--workspace-accent-wash) .38px, transparent .7px);
  background-position: center, 4px 4px;
  background-size: 8px 8px, 8px 8px;
  -webkit-mask-image: radial-gradient(ellipse 88% 70% at var(--workspace-glow-x) 28%, #000 0%, rgba(0, 0, 0, .7) 48%, rgba(0, 0, 0, .22) 82%, transparent 100%);
  mask-image: radial-gradient(ellipse 88% 70% at var(--workspace-glow-x) 28%, #000 0%, rgba(0, 0, 0, .7) 48%, rgba(0, 0, 0, .22) 82%, transparent 100%);
  opacity: .66;
}

.app-shell .workspace > * {
  position: relative;
  z-index: 1;
}

.app-shell .sidebar-top,
.app-shell .workspace-header,
.app-shell .drawer-head,
.app-shell .composer-bottom {
  display: flex;
  align-items: center;
}

.app-shell .brand-row {
  gap: 11px;
}

.app-shell .brand-row strong {
  color: var(--workspace-text);
  font-size: 15px;
  letter-spacing: 0;
}

.app-shell .brand-row span:not(.brand-mark),
.app-shell .section-label,
.app-shell .small-note,
.app-shell .project-row span,
.app-shell .history-row span {
  color: var(--workspace-muted);
}

.app-shell .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, .28), transparent 34%),
    linear-gradient(135deg, var(--workspace-accent), var(--workspace-accent-strong));
  color: #f4fffb;
  box-shadow: 0 0 22px var(--workspace-accent-glow);
}

.app-shell .icon-button,
.app-shell .quiet-button,
.app-shell .primary-button,
.app-shell .new-button,
.app-shell .mode-tab,
.app-shell .file-button,
.app-shell .select,
.app-shell .field {
  border-color: var(--workspace-line);
  background: hsl(200 8% 20% / .82);
  color: var(--workspace-text);
  border-radius: 12px;
}

.app-shell .icon-button:hover,
.app-shell .quiet-button:hover,
.app-shell .file-button:hover,
.app-shell .select:hover {
  border-color: var(--workspace-line-strong);
  background: hsl(200 8% 25% / .92);
}

.app-shell .new-button,
.app-shell .primary-button {
  position: relative;
  overflow: hidden;
  border-color: var(--settings-accent-border);
  background: linear-gradient(180deg, var(--workspace-accent), var(--workspace-accent-strong));
  color: #f5fffb;
  font-weight: 750;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    0 10px 26px var(--settings-accent-glow);
}

.app-shell .new-button::after,
.app-shell .primary-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(244, 255, 246, .34) .42px, transparent .72px);
  background-size: var(--aida-button-dots-size) var(--aida-button-dots-size);
  opacity: var(--aida-button-dots-opacity);
  pointer-events: none;
}

.app-shell .primary-button:disabled {
  opacity: .5;
  box-shadow: none;
}

.app-shell .text-button {
  color: rgba(209, 229, 222, .72);
}

.app-shell .section-label {
  margin: 0 0 9px;
  font-size: 10px;
  letter-spacing: .12em;
}

.app-shell .mode-section {
  display: none !important;
}

.app-shell .mode-nav-list {
  display: grid;
  gap: 8px;
}

.app-shell .mode-nav-tab {
  width: 100%;
  justify-content: flex-start;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  text-align: left;
}

.app-shell .mode-nav-tab.active {
  border-color: var(--workspace-accent-line);
  background: var(--workspace-accent-soft);
  color: #f8fffb;
  font-weight: 700;
}

.app-shell .mode-nav-tab:disabled {
  opacity: .58;
}

.app-shell .mode-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(221, 242, 235, .55);
}

.app-shell .mode-nav-tab.active .mode-dot {
  border-color: transparent;
  background: var(--workspace-accent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--workspace-accent) 70%, transparent);
}

.app-shell .project-row,
.app-shell .history-row {
  border-radius: 12px;
  color: var(--workspace-text);
  padding: 10px;
}

.app-shell .project-row:hover,
.app-shell .history-row:hover,
.app-shell .project-row.active,
.app-shell .history-row.active {
  border-color: var(--workspace-line);
  background: rgba(255, 255, 255, .045);
}

.app-shell .history-thumb {
  border-color: var(--workspace-line);
  background: rgba(255, 255, 255, .04);
  color: rgba(244, 255, 251, .78);
}

.app-shell .workspace-header {
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 58px;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 clamp(22px, 2.6vw, 42px);
  border-bottom: 1px solid rgba(229, 255, 239, .075);
  background: rgba(18, 21, 23, .38);
  backdrop-filter: blur(14px);
}

.app-shell .workspace-title {
  display: none;
}

.app-shell .workflow-switcher {
  position: absolute;
  top: 14px;
  left: var(--workspace-content-axis-x, 50%);
  z-index: 8;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--liquid-glass-border);
  border-radius: 999px;
  background: var(--liquid-glass-bg-fallback);
  color: var(--workspace-text);
  box-shadow:
    inset 0 1px 0 var(--liquid-glass-inner),
    inset 0 -1px 0 hsl(190 20% 90% / .025),
    0 6px 22px hsl(200 20% 4% / .16);
  transform: translateX(-50%);
  isolation: isolate;
  pointer-events: auto;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .app-shell .workflow-switcher {
    background:
      radial-gradient(80% 140% at 50% 0%, hsl(190 20% 92% / .08), transparent 58%),
      var(--liquid-glass-bg);
    -webkit-backdrop-filter: blur(18px) saturate(1.25);
    backdrop-filter: blur(18px) saturate(1.25);
  }
}

.workflow-switcher-tabs {
  display: contents;
}

.workflow-switcher-tab {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--workspace-dim);
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  transition: color .36s var(--liquid-ease-soft), opacity .2s ease;
}

.workflow-switcher-tab svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
  transition: stroke .36s var(--liquid-ease-soft), opacity .2s ease;
}

.workflow-switcher-tab:hover {
  color: var(--workspace-muted);
}

.workflow-switcher-tab.active,
.workflow-switcher-tab[aria-selected="true"] {
  color: var(--workspace-text);
}

.workflow-switcher-tab.active svg,
.workflow-switcher-tab[aria-selected="true"] svg {
  stroke: var(--tab-accent);
}

.workflow-switcher-tab:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.workflow-switcher-tab:focus {
  outline: none;
}

.workflow-switcher-tab:focus-visible {
  box-shadow:
    0 0 0 1.5px hsl(190 15% 75% / .34),
    0 0 0 4px hsl(190 15% 75% / .08);
}

.workflow-switcher-indicator {
  position: absolute;
  z-index: 1;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border: 1px solid color-mix(in srgb, var(--workflow-indicator-accent, var(--workflow-accent-image)) 24%, transparent);
  border-radius: 999px;
  background:
    radial-gradient(60% 120% at 50% 0%, hsl(190 20% 90% / .09), transparent 70%),
    color-mix(in oklab, var(--workflow-indicator-accent, var(--workflow-accent-image)) 12%, hsl(200 10% 40% / .08));
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--workflow-indicator-accent, var(--workflow-accent-image)) 9%, transparent);
  pointer-events: none;
  transform: translateX(0);
  transition:
    transform .46s var(--liquid-ease-move),
    width .46s var(--liquid-ease-move),
    border-color .46s var(--liquid-ease-soft),
    background .48s var(--liquid-ease-soft),
    box-shadow .46s var(--liquid-ease-soft);
  will-change: transform, width;
}

.workflow-switcher-indicator::before,
.workflow-switcher-indicator::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.workflow-switcher-indicator::before {
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--workflow-indicator-accent, var(--workflow-accent-image)), transparent);
  filter: blur(.3px);
  opacity: .75;
}

.workflow-switcher-indicator::after {
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, hsl(190 30% 95% / .14) 48%, transparent 62%);
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
}

.workflow-switcher-indicator.is-glinting::after {
  animation: workflow-glint .56s var(--liquid-ease-soft) forwards;
}

.workflow-switcher-indicator.is-moving {
  animation: workflow-squash .46s var(--liquid-ease-move);
}

@keyframes workflow-glint {
  0% {
    opacity: 0;
    background-position: 120% 0;
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    background-position: -40% 0;
  }
}

@keyframes workflow-squash {
  0% {
    scale: 1 1;
  }
  40% {
    scale: 1.06 .9;
  }
  100% {
    scale: 1 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workflow-switcher-indicator,
  .workflow-switcher-tab,
  .settings-segment-indicator,
  .settings-segment-button {
    transition-duration: 1ms !important;
  }

  .workflow-switcher-indicator.is-moving,
  .workflow-switcher-indicator.is-glinting::after,
  .settings-segment-indicator.is-moving,
  .settings-segment-indicator.is-glinting::after {
    animation: none !important;
  }
}

.app-shell .composer-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: center;
  width: min(920px, calc(100% - 72px));
  border: 0;
  background: transparent;
  padding: 0 0 30px;
}

.app-shell .composer {
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  border-radius: 18px;
  border: 1px solid var(--workspace-line-strong);
  background: rgba(17, 25, 26, .96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .045),
    0 20px 70px rgba(0, 0, 0, .28);
  padding: 13px 14px 12px;
}

.app-shell .mode-row,
.app-shell .usage-panel,
.app-shell #projectSelect {
  display: none;
}

.app-shell .prompt-box {
  display: block;
  padding: 0;
}

.app-shell .prompt-box > span {
  display: none;
}

.app-shell textarea {
  min-height: 58px;
  max-height: 150px;
  resize: none;
  color: var(--workspace-text);
  caret-color: var(--workspace-accent);
  font-size: 14px;
  line-height: 1.45;
}

.app-shell textarea::placeholder {
  color: rgba(214, 228, 223, .52);
}

.app-shell .settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 0 0;
}

.app-shell .settings-row label {
  min-width: 118px;
}

.app-shell .settings-row span {
  display: none;
}

.app-shell .select {
  min-width: 0;
  min-height: 34px;
  padding: 0 34px 0 12px;
  color: rgba(244, 255, 251, .88);
}

.app-shell .composer-bottom {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 0 0;
  border-top: 1px solid rgba(229, 255, 239, .075);
}

.app-shell .file-button {
  width: auto;
  min-width: 132px;
  min-height: 34px;
}

.app-shell .primary-button {
  min-width: 160px;
  min-height: 38px;
}

.app-shell .reference-panel,
.app-shell .upload-list {
  padding: 9px 0 0;
}

.app-shell .reference-chip,
.app-shell .upload-chip {
  border-color: var(--workspace-line);
  background: rgba(255, 255, 255, .045);
  color: rgba(244, 255, 251, .74);
}

.app-shell .form-message {
  min-height: 17px;
  margin: 8px 0 0;
  color: rgba(217, 232, 226, .68);
}

.app-shell .stream {
  grid-column: 1 / -1;
  grid-row: 2;
  min-height: 0;
  overflow: auto;
  padding: 26px clamp(24px, 3.5vw, 54px) 210px;
}

.app-shell .task-panel.empty {
  display: none;
}

.app-shell .task-panel {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 18px;
  border-color: var(--workspace-line);
  background: rgba(16, 24, 25, .88);
  color: var(--workspace-text);
}

.app-shell .task-panel p {
  color: rgba(214, 228, 223, .7);
}

.app-shell .preview-box {
  border-color: var(--workspace-line);
  background: rgba(255, 255, 255, .035);
}

.app-shell .status {
  border-color: var(--workspace-line);
  background: rgba(255, 255, 255, .05);
  color: rgba(244, 255, 251, .78);
}

.app-shell .status.success {
  color: var(--workspace-accent-text);
  background: var(--workspace-accent-wash);
  border-color: var(--workspace-accent-line);
}

.app-shell .status.processing,
.app-shell .status.pending {
  color: hsl(200 8% 82%);
  background: hsl(0 0% 100% / .05);
  border-color: hsl(0 0% 100% / .12);
}

.app-shell .drawer {
  border-left-color: var(--workspace-line);
  background: #0f1617;
  color: var(--workspace-text);
}

.app-shell .drawer-head {
  border-bottom-color: var(--workspace-line);
}

.app-shell .detail-row {
  border-bottom-color: var(--workspace-line);
}

.app-shell .detail-row span:first-child {
  color: var(--workspace-muted);
}

.app-shell .drawer-backdrop {
  background: rgba(0, 0, 0, .42);
}

.app-shell .toast {
  border-color: var(--workspace-line);
  background: #11191a;
  color: var(--workspace-text);
}

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

  .app-shell .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 45;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    transition: transform .18s ease;
  }

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

  .app-shell .workspace {
    border-left: 0;
    border-radius: 0;
  }

  .app-shell .workspace-header {
    justify-content: space-between;
    padding: 0 12px;
  }

  .app-shell .composer-wrap {
    width: calc(100% - 24px);
    padding-bottom: 14px;
  }

  .app-shell .composer {
    border-radius: 16px;
  }

  .app-shell .settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .app-shell .file-button,
  .app-shell .primary-button {
    width: 100%;
  }

  .app-shell .stream {
    padding: 18px 12px 198px;
  }
}

/* Bare workspace frame: first layout pass before adding content back in. */
.app-shell {
  --workspace-bg: #171b1e;
  --workspace-bg-soft: #1b2023;
  --workspace-sidebar-deep: #0f1214;
  --workspace-line: hsl(0 0% 100% / .14);
  --workspace-line-soft: hsl(0 0% 100% / .08);
  --workspace-right-rail-width: 340px;
  --workspace-rail-gap: clamp(36px, 3vw, 56px);
  --workspace-content-min-width: 560px;
  --workspace-content-area-width: calc(100% - var(--workspace-right-rail-width) - var(--workspace-rail-gap));
  --workspace-content-width: min(740px, max(var(--workspace-content-min-width), calc(var(--workspace-content-area-width) - 24px)));
  --workspace-content-axis-x: calc(var(--workspace-content-area-width) / 2);
  --workspace-glow-x: var(--workspace-content-axis-x);
  --responsive-sidebar-width: min(274px, 82vw);
  --prompt-max-height: 220px;
  position: relative;
  grid-template-columns: 274px minmax(0, 1fr);
  background: var(--workspace-sidebar-deep);
}

.workspace-sidebar-toggle {
  display: none;
}

.app-shell .sidebar {
  height: 100dvh;
  padding: 0;
  overflow: hidden;
  border-right: 0;
  background: var(--workspace-sidebar-deep);
}

.app-shell .sidebar > :not(.aida-sidebar) {
  display: none !important;
}

.aida-sidebar {
  height: 100%;
  min-height: 0;
  display: flex !important;
  flex-direction: column;
  gap: 20px;
  padding: 24px 18px 16px;
  color: rgba(244, 255, 251, .92);
}

.aida-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 4px 10px;
}

.aida-logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(229, 255, 234, .10);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, var(--workspace-accent-soft), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .015));
  color: var(--workspace-accent-text);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-shadow: 0 0 16px color-mix(in srgb, var(--workspace-accent) 42%, transparent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .07),
    0 0 24px color-mix(in srgb, var(--workspace-accent) 7%, transparent);
}

.aida-brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.aida-brand-copy strong,
.aida-account-copy strong {
  overflow: hidden;
  color: rgba(250, 255, 253, .96);
  font-size: 15px;
  line-height: 1.1;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aida-brand-copy span,
.aida-account-copy span {
  overflow: hidden;
  color: rgba(216, 231, 226, .48);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aida-sidebar-nav {
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 2px 0 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(229, 255, 234, .14) transparent;
}

.aida-sidebar button,
.aida-sidebar summary,
.aida-sidebar input {
  font: inherit;
}

.aida-nav-item,
.aida-tree-item,
.aida-project-toggle,
.aida-project-add-chat,
.aida-delete-button,
.aida-tree-action {
  width: 100%;
  border: 0;
  color: rgba(238, 249, 245, .72);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.aida-nav-item {
  min-height: 36px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.2;
}

.aida-nav-item > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aida-nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(238, 249, 245, .66);
}

.aida-sidebar svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aida-nav-item:hover {
  background: hsl(0 0% 100% / .035);
  color: rgba(244, 255, 251, .92);
}

.aida-nav-item-active,
.aida-nav-item-active:hover {
  background: hsl(0 0% 100% / .05);
  color: var(--workspace-accent-text);
}

.aida-nav-item-active .aida-nav-icon,
.aida-nav-item:hover .aida-nav-icon {
  background: transparent;
  color: var(--workspace-accent-text);
  box-shadow: none;
}

.aida-nav-item-active {
  text-shadow: 0 0 18px var(--workspace-accent-glow);
}

.aida-create-project-item {
  margin-bottom: 9px;
}

.aida-nav-group {
  display: grid;
  gap: 3px;
}

.aida-nav-group summary {
  list-style: none;
}

.aida-nav-group summary::-webkit-details-marker {
  display: none;
}

.aida-chevron {
  display: grid;
  place-items: center;
  color: rgba(238, 249, 245, .42);
  transition: transform .18s ease, color .18s ease;
}

.aida-nav-group[open] > summary .aida-chevron {
  color: rgba(238, 249, 245, .50);
  transform: rotate(180deg);
}

.aida-tree {
  display: grid;
  gap: 1px;
  margin: 0 0 7px 11px;
  padding: 3px 0 2px 20px;
  border-left: 1px solid rgba(229, 255, 234, .055);
}

.aida-tree-item,
.aida-project-row {
  min-height: 31px;
  padding: 0 8px;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  line-height: 1.2;
}

.aida-tree-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px;
  align-items: center;
  column-gap: 4px;
}

.aida-project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px 22px;
  align-items: center;
  column-gap: 4px;
  position: relative;
}

.aida-project-toggle,
.aida-project-add-chat {
  min-width: 0;
  height: 31px;
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent;
  color: rgba(238, 249, 245, .62);
  font-weight: 610;
}

.aida-project-toggle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aida-delete-button {
  width: 22px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(238, 249, 245, .32);
  font-size: 15px;
  line-height: 1;
  opacity: .72;
}

.aida-delete-button:hover {
  background: rgba(255, 91, 91, .10);
  color: rgba(255, 157, 157, .92);
  opacity: 1;
}

.aida-tree-item {
  min-width: 0;
  display: block;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 0;
  color: rgba(216, 231, 226, .56);
}

.aida-tree-item::before,
.aida-project-row::before,
.aida-tree-action::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 50%;
  width: 13px;
  height: 1px;
  background: rgba(229, 255, 234, .045);
}

.aida-tree-action {
  position: relative;
}

.aida-tree-item:hover,
.aida-tree-action:hover {
  color: rgba(244, 255, 251, .9);
  background: hsl(0 0% 100% / .03);
}

.aida-project-row:hover .aida-project-toggle,
.aida-project-add-chat:hover {
  color: var(--workspace-accent-text);
}

.aida-tree-item-active,
.aida-tree-item-active:hover {
  background: hsl(0 0% 100% / .045);
  color: var(--workspace-accent-text);
  text-shadow: 0 0 18px var(--workspace-accent-glow);
}

.aida-project-active .aida-project-toggle {
  color: var(--workspace-accent-text);
}

.aida-project-chats {
  display: none;
  gap: 1px;
  margin: 0 0 4px 8px;
  padding-left: 12px;
  border-left: 1px solid rgba(229, 255, 234, .045);
}

.aida-project-open .aida-project-chats {
  display: grid;
}

.aida-empty-note {
  min-height: 28px;
  display: flex;
  align-items: center;
  color: rgba(216, 231, 226, .30);
  font-size: 12px;
}

.aida-tree-action {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  background: transparent;
  font-size: 12.5px;
  line-height: 1.2;
}

.aida-nav-group > .aida-tree-action {
  width: calc(100% - 31px);
  margin: 0 0 4px 31px;
}

.aida-tree-action span {
  color: var(--workspace-accent-text);
}

.aida-project-chat-action {
  margin-top: 1px;
}

.aida-tree-item-editor {
  display: flex;
  align-items: center;
}

.aida-rename-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--workspace-accent-line);
  outline: none;
  background: transparent;
  color: var(--workspace-accent-text);
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

.aida-rename-input::placeholder {
  color: rgba(36, 230, 115, .36);
}

.aida-project-editor {
  height: 31px;
}

.aida-account-card {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px 0;
  border: 0;
  border-top: 1px solid rgba(229, 255, 234, .075);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.aida-account-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--workspace-accent-line);
  border-radius: 8px;
  background: var(--workspace-accent-soft);
  color: var(--workspace-accent-text);
  font-size: 13px;
  font-weight: 760;
}

.aida-account-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.app-shell .workspace {
  min-height: 100dvh;
  display: block;
  overflow: hidden;
  border: 1px solid transparent;
  border-right: 0;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
  background:
    radial-gradient(ellipse 34% 13% at var(--workspace-glow-x) -2%, var(--workspace-accent-soft), var(--workspace-accent-wash) 44%, transparent 78%) padding-box,
    linear-gradient(180deg, #14171a 0%, var(--workspace-bg) 100%) padding-box,
    linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .10) 32%, var(--workspace-accent-glow) 58%, rgba(255, 255, 255, .08) 100%) border-box;
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, .035),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  transition: background .42s var(--liquid-ease-soft), border-color .42s var(--liquid-ease-soft);
}

.app-shell .workspace::before {
  z-index: 0;
  background:
    radial-gradient(ellipse 46% 18% at var(--workspace-glow-x) -4%, color-mix(in srgb, var(--workspace-accent) 15%, transparent), var(--workspace-accent-wash) 48%, transparent 80%),
    linear-gradient(180deg, color-mix(in srgb, var(--workspace-accent) 3%, transparent), transparent 28%);
  transition: background .42s var(--liquid-ease-soft), opacity .42s var(--liquid-ease-soft);
}

.app-shell .workspace::after {
  z-index: 0;
  background-image:
    radial-gradient(circle at 6px 6px, rgba(238, 255, 243, .06) .52px, transparent 1.05px),
    url("/web/static/workspace-dots.svg?v=bare-frame-10");
  background-position:
    0 0,
    0 0;
  background-size: 12px 12px, 360px 252px;
  background-repeat: repeat;
  background-blend-mode: screen;
  -webkit-mask-image: radial-gradient(ellipse 72% 66% at var(--workspace-glow-x) 0%, #000 0%, rgba(0, 0, 0, .9) 18%, rgba(0, 0, 0, .52) 45%, rgba(0, 0, 0, .15) 68%, transparent 92%);
  mask-image: radial-gradient(ellipse 72% 66% at var(--workspace-glow-x) 0%, #000 0%, rgba(0, 0, 0, .9) 18%, rgba(0, 0, 0, .52) 45%, rgba(0, 0, 0, .15) 68%, transparent 92%);
  filter: var(--workspace-dot-filter) drop-shadow(0 0 2px var(--workspace-accent-soft));
  opacity: .96;
  transition: filter .42s var(--liquid-ease-soft), opacity .42s var(--liquid-ease-soft);
}

.app-shell .workspace > *,
.app-shell .drawer,
.app-shell .drawer-backdrop,
.app-shell + .toast {
  display: none !important;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace-sidebar-toggle {
    position: fixed;
    left: 0;
    top: 72px;
    z-index: 56;
    width: 24px;
    height: 104px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(229, 255, 234, .22);
    border-left: 0;
    border-radius: 0 14px 14px 0;
    background:
      radial-gradient(ellipse 88% 40% at 100% 50%, var(--workspace-accent-soft), transparent 72%),
      linear-gradient(90deg, rgba(5, 14, 13, .96), rgba(7, 25, 18, .88));
    box-shadow:
      8px 0 24px rgba(0, 0, 0, .22),
      inset -1px 0 0 var(--workspace-accent-wash),
      inset 0 1px 0 rgba(255, 255, 255, .06);
    backdrop-filter: blur(10px);
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  }

  .workspace-sidebar-toggle:focus {
    outline: none;
  }

  .workspace-sidebar-toggle:focus-visible {
    border-color: rgba(229, 255, 234, .36);
    box-shadow:
      8px 0 24px rgba(0, 0, 0, .22),
      0 0 0 1px var(--workspace-accent-glow),
      0 0 18px var(--workspace-accent-glow),
      inset -1px 0 0 var(--workspace-accent-soft),
      inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .workspace-sidebar-toggle span {
    display: none;
    width: 2px;
    height: 42px;
    border-radius: 999px;
    background:
      linear-gradient(180deg, transparent 0%, rgba(224, 255, 244, .9) 16%, var(--workspace-accent) 50%, rgba(224, 255, 244, .9) 84%, transparent 100%);
    box-shadow:
      0 0 7px color-mix(in srgb, var(--workspace-accent) 45%, transparent),
      0 0 18px var(--workspace-accent-glow);
    transition: height .2s ease, opacity .2s ease, background .2s ease, box-shadow .2s ease;
  }

  .workspace-sidebar-toggle span:first-child,
  .workspace-sidebar-toggle span:last-child {
    display: none;
  }

  .workspace-sidebar-toggle span:nth-child(2) {
    display: block;
    width: 2px;
  }

  .workspace-sidebar-toggle:hover {
    border-color: rgba(229, 255, 234, .30);
    background:
      radial-gradient(ellipse 94% 42% at 100% 50%, var(--workspace-accent-soft), transparent 74%),
      linear-gradient(90deg, rgba(5, 14, 13, .98), rgba(8, 29, 20, .92));
    box-shadow:
      10px 0 28px rgba(0, 0, 0, .24),
      inset -1px 0 0 var(--workspace-accent-wash),
      inset 0 1px 0 rgba(255, 255, 255, .08);
  }

  .app-shell.sidebar-open .workspace-sidebar-toggle {
    transform: translateX(calc(var(--responsive-sidebar-width) - 1px));
  }

  .app-shell .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    width: var(--responsive-sidebar-width);
    border: 1px solid rgba(229, 255, 234, .20);
    border-left: 0;
    border-top-right-radius: 18px;
    border-bottom-right-radius: 18px;
    background: var(--workspace-sidebar-deep);
    transform: translateX(calc(-1 * var(--responsive-sidebar-width) - 18px));
    transition: transform .2s ease;
    box-shadow:
      12px 0 32px rgba(0, 0, 0, .20),
      inset -1px 0 0 var(--workspace-accent-wash),
      inset 0 1px 0 rgba(255, 255, 255, .05);
  }

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

  .app-shell .workspace {
    width: 100vw;
    border-left: 0;
    border-radius: 0;
  }

  .app-shell .drawer-backdrop.open {
    z-index: 44;
    display: block !important;
    background: rgba(0, 0, 0, .18);
    backdrop-filter: none;
  }
}

@media (max-width: 520px) {
  .workspace-sidebar-toggle {
    top: 58px;
    width: 22px;
    height: 94px;
    border-radius: 0 13px 13px 0;
  }

}

/* Composer return pass: brings the input surface back into the bare AIDA frame. */
.app-shell .workspace {
  position: relative;
  display: block;
  border-top: 0;
  background:
    radial-gradient(ellipse 34% 13% at var(--workspace-glow-x) -2%, var(--workspace-accent-soft), var(--workspace-accent-wash) 44%, transparent 78%) padding-box,
    linear-gradient(180deg, #14171a 0%, var(--workspace-bg) 100%) padding-box;
}

.app-shell .workspace > .workspace-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 3;
  display: flex !important;
  min-height: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.app-shell .workspace > .workspace-header > * {
  pointer-events: auto;
}

.app-shell .workspace > .workflow-switcher {
  display: flex !important;
}

.app-shell .workspace > .composer-wrap {
  display: block !important;
}

.app-shell .workspace > .stream {
  display: block !important;
}

.app-shell .workspace > .model-settings-panel:not(.hidden) {
  display: grid !important;
}

.app-shell .workspace > .workspace-updates-card {
  display: grid !important;
}

.app-shell .drawer.open {
  display: block !important;
}

.app-shell .drawer-backdrop.open {
  display: block !important;
}

.app-shell .stream {
  position: absolute;
  inset: 0;
  z-index: 2;
  height: auto;
  padding: 0;
  pointer-events: none;
}

.app-shell .sent-thread {
  --sent-thread-content-width: var(--workspace-content-width, 740px);
  --sent-thread-column-width: min(var(--sent-thread-content-width), calc(100% - 24px));
  --sent-thread-column-before: max(12px, calc(var(--workspace-content-axis-x, 50%) - (var(--sent-thread-column-width) * .5)));
  --sent-thread-top-safe: 76px;
  --sent-thread-bottom-safe: calc(30px + var(--composer-live-height, 164px) + 18px);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  max-height: none;
  display: grid;
  grid-template-columns:
    minmax(12px, var(--sent-thread-column-before))
    minmax(0, var(--sent-thread-column-width))
    minmax(12px, 1fr);
  align-content: start;
  gap: 24px 0;
  overflow-y: auto;
  overflow-x: visible;
  overscroll-behavior: contain;
  padding: var(--sent-thread-top-safe) 0 var(--sent-thread-bottom-safe);
  scroll-padding-block: var(--sent-thread-top-safe) var(--sent-thread-bottom-safe);
  scrollbar-width: none;
  transform: none;
  pointer-events: auto;
}

.app-shell .sent-thread::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.app-shell .sent-thread:empty {
  display: none;
}

.app-shell .sent-message {
  grid-column: 2;
  width: min(560px, 78%);
  display: grid;
  gap: 8px;
  justify-items: stretch;
  animation: message-in .18s ease-out;
}

.app-shell .sent-message.is-persisted {
  animation: none;
}

.app-shell .sent-message.from-user {
  justify-self: end;
}

.app-shell .sent-message.from-assistant {
  justify-self: start;
  width: fit-content;
  max-width: min(560px, 78%);
  justify-items: start;
}

.app-shell .sent-message.from-assistant.is-pending {
  width: 368px;
  max-width: 78%;
}

.app-shell .sent-message.from-assistant.is-visual-pending {
  width: 520px;
  max-width: min(520px, 92%);
}

.app-shell .sent-message.from-assistant.has-result {
  width: 368px;
  max-width: 78%;
  gap: 7px;
}

.app-shell .sent-bubble {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(221, 238, 234, .12);
  border-radius: 18px 18px 6px 18px;
  background:
    linear-gradient(180deg, var(--workspace-accent-wash), transparent 62%),
    hsl(200 8% 16% / .92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 14px 38px rgba(0, 0, 0, .22);
  backdrop-filter: blur(16px);
}

.app-shell .sent-text {
  margin: 0;
  padding: 13px 15px 12px;
  color: rgba(244, 255, 251, .92);
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.app-shell .sent-message.is-collapsed .sent-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 15;
  overflow: hidden;
}

.app-shell .sent-message.from-assistant.has-text-response {
  width: 100%;
  max-width: 100%;
  gap: 5px;
}

.app-shell .assistant-markdown {
  width: 100%;
  min-width: 0;
  color: rgba(244, 255, 251, .92);
  font-size: 15px;
  line-height: 1.62;
  overflow-wrap: anywhere;
}

.app-shell .assistant-markdown > :first-child {
  margin-top: 0;
}

.app-shell .assistant-markdown > :last-child {
  margin-bottom: 0;
}

.app-shell .assistant-markdown p,
.app-shell .assistant-markdown ul,
.app-shell .assistant-markdown ol,
.app-shell .assistant-markdown blockquote,
.app-shell .assistant-markdown .markdown-table-scroll,
.app-shell .assistant-markdown .markdown-code-block {
  margin: 0 0 15px;
}

.app-shell .assistant-markdown h1,
.app-shell .assistant-markdown h2,
.app-shell .assistant-markdown h3,
.app-shell .assistant-markdown h4,
.app-shell .assistant-markdown h5,
.app-shell .assistant-markdown h6 {
  margin: 25px 0 10px;
  color: rgba(250, 255, 253, .97);
  font-weight: 680;
  line-height: 1.28;
  letter-spacing: 0;
}

.app-shell .assistant-markdown h1 {
  font-size: 24px;
}

.app-shell .assistant-markdown h2 {
  font-size: 20px;
}

.app-shell .assistant-markdown h3 {
  font-size: 17px;
}

.app-shell .assistant-markdown h4,
.app-shell .assistant-markdown h5,
.app-shell .assistant-markdown h6 {
  font-size: 15px;
}

.app-shell .assistant-markdown ul,
.app-shell .assistant-markdown ol {
  padding-left: 25px;
}

.app-shell .assistant-markdown li {
  padding-left: 3px;
}

.app-shell .assistant-markdown li + li {
  margin-top: 5px;
}

.app-shell .assistant-markdown li > p {
  margin: 5px 0;
}

.app-shell .assistant-markdown strong {
  color: rgba(255, 255, 255, .98);
  font-weight: 700;
}

.app-shell .assistant-markdown a {
  color: var(--workspace-accent-text);
  text-decoration-color: color-mix(in srgb, var(--workspace-accent) 52%, transparent);
  text-underline-offset: 3px;
}

.app-shell .assistant-markdown a:hover {
  color: var(--workspace-accent);
}

.app-shell .assistant-markdown blockquote {
  padding: 2px 0 2px 15px;
  border-left: 3px solid var(--workspace-accent-line);
  color: rgba(222, 235, 230, .70);
}

.app-shell .assistant-markdown blockquote > :last-child {
  margin-bottom: 0;
}

.app-shell .assistant-markdown hr {
  height: 1px;
  margin: 24px 0;
  border: 0;
  background: rgba(221, 238, 234, .12);
}

.app-shell .assistant-markdown code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .09);
  color: rgba(249, 252, 251, .94);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: .88em;
  line-height: 1.45;
}

.app-shell .markdown-code-block {
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(221, 238, 234, .13);
  border-radius: 8px;
  background: hsl(200 8% 10% / .88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}

.app-shell .markdown-code-header {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid rgba(221, 238, 234, .11);
  background: rgba(255, 255, 255, .035);
}

.app-shell .markdown-code-language {
  overflow: hidden;
  color: rgba(218, 228, 224, .62);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: lowercase;
  white-space: nowrap;
}

.app-shell .markdown-code-copy {
  width: 28px;
  height: 28px;
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(218, 228, 224, .66);
}

.app-shell .markdown-code-copy:hover,
.app-shell .markdown-code-copy:focus-visible {
  background: rgba(255, 255, 255, .07);
  color: rgba(250, 255, 253, .96);
}

.app-shell .markdown-code-copy svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.2;
}

.app-shell .markdown-code-block pre {
  max-width: 100%;
  margin: 0;
  overflow: auto;
  padding: 15px 16px 17px;
  scrollbar-color: rgba(214, 228, 222, .22) transparent;
  scrollbar-width: thin;
}

.app-shell .markdown-code-block pre code {
  display: block;
  min-width: max-content;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(241, 249, 246, .90);
  font-size: 13px;
  line-height: 1.58;
  overflow-wrap: normal;
  white-space: pre;
}

.app-shell .markdown-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(221, 238, 234, .13);
  border-radius: 8px;
  scrollbar-color: rgba(214, 228, 222, .22) transparent;
  scrollbar-width: thin;
}

.app-shell .assistant-markdown table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  color: rgba(238, 247, 243, .86);
  font-size: 13px;
  line-height: 1.45;
}

.app-shell .assistant-markdown th,
.app-shell .assistant-markdown td {
  min-width: 130px;
  padding: 10px 12px;
  border-right: 1px solid rgba(221, 238, 234, .10);
  border-bottom: 1px solid rgba(221, 238, 234, .10);
  text-align: left;
  vertical-align: top;
}

.app-shell .assistant-markdown th {
  background: rgba(255, 255, 255, .035);
  color: rgba(250, 255, 253, .96);
  font-weight: 680;
}

.app-shell .assistant-markdown tr:last-child td {
  border-bottom: 0;
}

.app-shell .assistant-markdown th:last-child,
.app-shell .assistant-markdown td:last-child {
  border-right: 0;
}

.app-shell .assistant-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.app-shell .sent-attachments {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.app-shell .sent-attachments:empty {
  display: none;
}

.app-shell .sent-attachment {
  width: min(168px, 48vw);
  height: 112px;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(221, 238, 234, .14);
  border-radius: 16px 16px 6px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)),
    hsl(200 8% 15% / .72);
  appearance: none;
  color: rgba(244, 255, 251, .62);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  line-height: 1.1;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .16);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.app-shell .sent-attachment:hover,
.app-shell .sent-attachment:focus-visible {
  border-color: var(--workspace-accent-line);
  background:
    linear-gradient(180deg, var(--workspace-accent-soft), rgba(255, 255, 255, .04)),
    hsl(200 8% 18% / .82);
  transform: translateY(-1px);
}

.app-shell .sent-attachment img,
.app-shell .sent-attachment video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.app-shell .sent-attachment-file {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px;
}

.app-shell .sent-attachment-kind {
  width: fit-content;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid rgba(221, 238, 234, .11);
  border-radius: 7px;
  color: rgba(232, 241, 237, .70);
  background: rgba(255, 255, 255, .055);
  font-size: 10px;
  line-height: 1;
  text-transform: uppercase;
}

.app-shell .sent-attachment-name {
  max-width: 100%;
  overflow: hidden;
  color: rgba(244, 255, 251, .82);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .sent-meta {
  width: 100%;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-shell .sent-meta-left,
.app-shell .sent-meta-right {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell .sent-meta-right {
  justify-content: flex-end;
  margin-left: auto;
}

.app-shell .sent-time {
  color: rgba(218, 228, 224, .54);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.app-shell .sent-expand {
  min-height: 26px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--workspace-accent-text);
  font-size: 12px;
  line-height: 1;
}

.app-shell .sent-expand:hover {
  color: var(--workspace-accent);
}

.app-shell .sent-actions {
  min-height: 24px;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  overflow: visible;
  opacity: 1;
  transform: none;
  pointer-events: auto;
  transition: opacity .16s ease, transform .16s ease;
}

.app-shell .sent-action-button {
  width: 28px;
  height: 28px;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, .055);
  color: rgba(218, 228, 224, .72);
  text-decoration: none;
  backdrop-filter: blur(10px);
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

.app-shell .sent-action-button::before {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 7px);
  min-height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(38, 40, 39, .96);
  color: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
  font-size: 12px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(0, 3px);
  transition: opacity .14s ease, transform .14s ease;
  white-space: nowrap;
}

.app-shell .sent-message.from-assistant .sent-action-button::before {
  right: auto;
  left: 0;
}

.app-shell .sent-action-button:hover {
  background: rgba(255, 255, 255, .085);
  color: rgba(232, 241, 237, .90);
  transform: translateY(-1px);
}

.app-shell .sent-action-button:hover::before,
.app-shell .sent-action-button:focus-visible::before {
  opacity: 1;
  transform: translate(0, 0);
}

.app-shell .sent-action-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.12;
}

.app-shell .assistant-result-preview {
  width: 100%;
  aspect-ratio: var(--result-aspect, 1);
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(221, 238, 234, .075);
  border-radius: 18px 18px 18px 6px;
  background: rgba(10, 17, 16, .22);
  appearance: none;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .012);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.app-shell .assistant-result-preview:hover,
.app-shell .assistant-result-preview:focus-visible {
  border-color: rgba(221, 238, 234, .16);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .02);
  transform: translateY(-1px);
}

.app-shell .assistant-result-preview img,
.app-shell .assistant-result-preview video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.app-shell .assistant-result-meta {
  width: 100%;
  min-height: 28px;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-start;
  overflow: visible;
}

.app-shell .assistant-result-meta .sent-actions {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.app-shell .sent-message.from-assistant.has-result:hover .assistant-result-meta .sent-actions,
.app-shell .sent-message.from-assistant.has-result:focus-within .assistant-result-meta .sent-actions {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.app-shell .generation-wait-card {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(178, 235, 205, .12);
  border-radius: 18px 18px 18px 6px;
  background: rgba(10, 17, 16, .96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .035),
    inset 0 0 0 1px color-mix(in srgb, var(--workspace-accent) 4%, transparent),
    inset 0 -42px 78px color-mix(in srgb, var(--workspace-accent) 3%, transparent),
    0 16px 42px rgba(0, 0, 0, .20);
  backdrop-filter: blur(12px);
}

.app-shell .generation-dot-grid {
  position: absolute;
  inset: 22px;
  display: grid;
  grid-template-columns: repeat(25, 1fr);
  grid-template-rows: repeat(25, 1fr);
  align-items: center;
  justify-items: center;
}

.app-shell .generation-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  opacity: calc(var(--alpha) * .62);
  background: rgba(221, 232, 228, .76);
  transform: scale(var(--scale));
  animation: generation-dot var(--duration) cubic-bezier(.42, 0, .24, 1) infinite;
  animation-delay: var(--delay);
  will-change: opacity, transform;
}

.app-shell .generation-dot.is-accent {
  width: 2.5px;
  height: 2.5px;
  background: rgba(232, 239, 236, .86);
  box-shadow: 0 0 7px rgba(232, 239, 236, .13);
}

.app-shell .generation-dot.is-bright {
  width: 2.7px;
  height: 2.7px;
  background: rgba(248, 252, 250, .9);
  box-shadow: 0 0 8px rgba(248, 252, 250, .18);
}

.app-shell .assistant-pending {
  width: 100%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 18px 18px 18px 6px;
  color: rgba(244, 255, 251, .92);
}

.app-shell .assistant-pending--chat {
  min-height: 96px;
  padding: 20px 22px 16px;
  border: 1px solid rgba(255, 255, 255, .07);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .028), rgba(255, 255, 255, .008) 42%),
    var(--workspace-accent-wash);
  background-color: rgba(10, 13, 12, .72);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .04) inset,
    0 18px 40px -28px rgba(0, 0, 0, .8);
}

.app-shell .pending-hairline-edge {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--workspace-accent-line);
}

.app-shell .pending-hairline-edge::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 34%;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--workspace-accent) 45%, var(--workspace-accent-strong) 60%, transparent);
  filter: drop-shadow(0 0 6px var(--workspace-accent-glow));
  transform: translateX(-110%);
  animation: assistant-hairline-travel 2.6s cubic-bezier(.45, 0, .2, 1) infinite;
  will-change: transform;
}

.app-shell .pending-hairline-body {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.app-shell .pending-hairline-ghost {
  display: block;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .05), var(--workspace-accent-soft) 50%, rgba(255, 255, 255, .05));
  background-size: 200% 100%;
  opacity: .5;
  animation: assistant-hairline-breathe 3.4s ease-in-out infinite;
  will-change: opacity, background-position;
}

.app-shell .pending-hairline-ghost-a {
  width: 78%;
}

.app-shell .pending-hairline-ghost-b {
  width: 52%;
  animation-delay: .45s;
}

.app-shell .pending-hairline-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-shell .pending-hairline-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--workspace-accent);
  box-shadow: 0 0 8px var(--workspace-accent-glow);
  animation: assistant-hairline-pulse 1.8s ease-in-out infinite;
  will-change: opacity, transform;
}

.app-shell .pending-hairline-label {
  color: rgba(235, 245, 240, .45);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}

.app-shell .assistant-pending--visual {
  padding: 10px;
  border: 1px solid var(--liquid-glass-border);
  border-radius: 18px 18px 18px 8px;
  background:
    radial-gradient(120% 100% at 50% 0%, hsl(190 20% 92% / .05), transparent 60%),
    linear-gradient(180deg, hsl(200 8% 15% / .78), hsl(200 8% 11% / .82));
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    inset 0 1px 0 var(--liquid-glass-inner),
    0 22px 52px -30px rgba(0, 0, 0, .8);
}

.app-shell .pending-latent-aperture {
  --latent-sweep-travel: 214px;
  height: 264px;
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--workspace-accent) 16%, hsl(190 12% 80% / .06));
  border-radius: 12px;
  background:
    radial-gradient(120% 100% at 50% 118%, var(--workspace-accent-wash), transparent 58%),
    linear-gradient(180deg, #0b0f0e, #080b0a);
  contain: layout paint;
  isolation: isolate;
}

.app-shell .pending-latent-fog {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  filter: blur(28px);
  mix-blend-mode: screen;
  opacity: .42;
  will-change: transform;
}

.app-shell .pending-latent-fog-1 {
  background: radial-gradient(circle at 50% 50%, var(--workspace-accent-soft), transparent 62%);
  animation: assistant-fog-drift-1 14s ease-in-out infinite alternate;
}

.app-shell .pending-latent-fog-2 {
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--workspace-accent) 12%, transparent), transparent 58%);
  opacity: .26;
  animation: assistant-fog-drift-2 19s ease-in-out infinite alternate;
}

.app-shell .pending-latent-fog-3 {
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .07), transparent 55%);
  opacity: .22;
  animation: assistant-fog-drift-3 23s ease-in-out infinite alternate;
}

.app-shell .pending-latent-grain {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .10) .5px, transparent .5px);
  background-size: 16px 16px;
  opacity: .12;
  -webkit-mask-image: radial-gradient(90% 80% at 50% 50%, #000 30%, transparent 100%);
  mask-image: radial-gradient(90% 80% at 50% 50%, #000 30%, transparent 100%);
}

.app-shell .pending-latent-sweep {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--workspace-accent-strong), transparent);
  opacity: .45;
  filter: drop-shadow(0 0 8px var(--workspace-accent-glow));
  transform: translateY(18px);
  animation: assistant-latent-sweep 5.2s cubic-bezier(.6, 0, .4, 1) infinite;
  will-change: transform, opacity;
}

.app-shell .pending-latent-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55));
  pointer-events: none;
}

.app-shell .pending-latent-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 4px;
  color: rgba(235, 245, 240, .5);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.app-shell .pending-latent-tick {
  width: 12px;
  height: 1px;
  background: var(--workspace-accent);
  transform-origin: left center;
  animation: assistant-latent-tick 2.4s ease-in-out infinite;
  will-change: transform, opacity;
}

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

.attachment-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(0, 5, 4, .72);
  backdrop-filter: blur(18px);
}

.attachment-viewer[hidden] {
  display: none;
}

.attachment-viewer-panel {
  width: min(780px, calc(100vw - 40px));
  max-height: calc(100vh - 56px);
  display: grid;
  gap: 12px;
}

.attachment-viewer.is-result-viewer {
  place-items: stretch;
  padding: 0;
  background: rgba(0, 5, 4, .88);
}

.attachment-viewer.is-result-viewer .attachment-viewer-panel {
  width: 100vw;
  height: 100dvh;
  max-height: none;
  gap: 0;
}

.attachment-viewer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.attachment-viewer.is-result-viewer .attachment-viewer-top {
  position: fixed;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 2;
  padding: 8px 8px 8px 12px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 14px;
  background: rgba(8, 18, 16, .62);
  box-shadow: 0 18px 54px rgba(0, 0, 0, .28);
  -webkit-backdrop-filter: blur(16px) saturate(1.18);
  backdrop-filter: blur(16px) saturate(1.18);
}

.attachment-viewer-title {
  min-width: 0;
  overflow: hidden;
  color: rgba(244, 255, 251, .82);
  font-size: 13px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-viewer-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  color: rgba(244, 255, 251, .86);
}

.attachment-viewer-close svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.attachment-viewer-content {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.attachment-viewer.is-result-viewer .attachment-viewer-content {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 74px 24px 24px;
  scrollbar-color: rgba(244, 255, 251, .24) transparent;
}

@supports (align-items: safe center) {
  .attachment-viewer.is-result-viewer .attachment-viewer-content {
    align-items: safe center;
    justify-content: safe center;
  }
}

.attachment-viewer-media {
  max-width: 100%;
  max-height: min(72vh, 680px);
  display: block;
  border: 1px solid rgba(221, 238, 234, .14);
  border-radius: 16px;
  object-fit: contain;
  background: rgba(8, 18, 16, .86);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .34);
}

.attachment-viewer.is-result-viewer .attachment-viewer-media {
  width: auto;
  height: auto;
  flex: 0 0 auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 112px);
  box-sizing: border-box;
  margin: 0 auto;
  border-radius: 14px;
  background: rgba(8, 18, 16, .94);
}

.attachment-viewer-file {
  width: min(360px, calc(100vw - 56px));
  min-height: 180px;
  display: grid;
  align-content: end;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(221, 238, 234, .14);
  border-radius: 16px;
  background: rgba(8, 18, 16, .86);
  box-shadow: 0 24px 72px rgba(0, 0, 0, .34);
}

.attachment-viewer-kind {
  width: fit-content;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid rgba(221, 238, 234, .12);
  border-radius: 8px;
  color: rgba(232, 241, 237, .72);
  background: rgba(255, 255, 255, .055);
  font-size: 11px;
  line-height: 1;
  text-transform: uppercase;
}

.attachment-viewer-name {
  overflow-wrap: anywhere;
  color: rgba(244, 255, 251, .88);
  font-size: 14px;
  line-height: 1.35;
}

.attachment-viewer-open {
  width: fit-content;
  color: var(--workspace-accent-text);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
}

.attachment-viewer-open:hover {
  color: var(--workspace-accent);
}

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

@keyframes generation-dot {
  0%,
  100% {
    opacity: calc(var(--alpha) * .38);
    transform: scale(calc(var(--scale) * .58));
  }
  28% {
    opacity: calc(var(--alpha) * .9);
    transform: scale(calc(var(--scale) * 1.08));
  }
  52% {
    opacity: calc(var(--alpha) * 1.75);
    transform: scale(calc(var(--scale) * 1.82));
  }
  74% {
    opacity: calc(var(--alpha) * .68);
    transform: scale(calc(var(--scale) * .86));
  }
}

@keyframes assistant-hairline-travel {
  0% {
    transform: translateX(-110%);
  }
  55%,
  100% {
    transform: translateX(310%);
  }
}

@keyframes assistant-hairline-breathe {
  0%,
  100% {
    opacity: .34;
    background-position: 0% 0;
  }
  50% {
    opacity: .62;
    background-position: 100% 0;
  }
}

@keyframes assistant-hairline-pulse {
  0%,
  100% {
    opacity: .55;
    transform: scale(.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes assistant-fog-drift-1 {
  from {
    transform: translate(-14%, -8%) scale(1);
  }
  to {
    transform: translate(12%, 10%) scale(1.18);
  }
}

@keyframes assistant-fog-drift-2 {
  from {
    transform: translate(16%, 6%) scale(1.1) rotate(0deg);
  }
  to {
    transform: translate(-10%, -12%) scale(.95) rotate(18deg);
  }
}

@keyframes assistant-fog-drift-3 {
  from {
    transform: translate(-6%, 14%) scale(.9);
  }
  to {
    transform: translate(8%, -10%) scale(1.15);
  }
}

@keyframes assistant-latent-sweep {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  12%,
  50% {
    opacity: .45;
  }
  50% {
    transform: translateY(var(--latent-sweep-travel, 130px));
  }
  62%,
  100% {
    opacity: 0;
    transform: translateY(var(--latent-sweep-travel, 130px));
  }
}

@keyframes assistant-latent-tick {
  0%,
  100% {
    opacity: .5;
    transform: scaleX(.4);
  }
  50% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell .pending-hairline-edge::after,
  .app-shell .pending-hairline-ghost,
  .app-shell .pending-hairline-pulse,
  .app-shell .pending-latent-fog,
  .app-shell .pending-latent-sweep,
  .app-shell .pending-latent-tick {
    animation: none !important;
  }

  .app-shell .pending-hairline-edge::after {
    opacity: .7;
    transform: translateX(90%);
  }

  .app-shell .pending-hairline-ghost {
    opacity: .45;
  }

  .app-shell .pending-hairline-pulse {
    opacity: .9;
  }

  .app-shell .pending-latent-fog-1 {
    transform: translate(-4%, 0) scale(1.08);
  }

  .app-shell .pending-latent-fog-2 {
    transform: translate(6%, -4%);
  }

  .app-shell .pending-latent-sweep {
    opacity: .3;
    transform: translateY(calc(var(--latent-sweep-travel, 130px) * .55));
  }

  .app-shell .pending-latent-tick {
    opacity: .8;
    transform: scaleX(1);
  }
}

.app-shell .composer-wrap {
  position: absolute;
  left: var(--workspace-content-axis-x, 50%);
  bottom: 30px;
  z-index: 9;
  width: var(--workspace-content-width, min(740px, calc(100% - 24px)));
  height: 104px;
  padding: 0;
  overflow: visible;
  transform: translateX(-50%);
  transition:
    left .34s cubic-bezier(.32,.72,.24,1),
    width .34s cubic-bezier(.32,.72,.24,1);
}

.app-shell .composer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 5px;
  overflow: visible;
  isolation: isolate;
  border-radius: 25px;
  border: 1px solid var(--liquid-glass-border);
  background:
    radial-gradient(110% 130% at 50% 0%, hsl(190 20% 92% / .07), transparent 58%),
    linear-gradient(180deg, hsl(200 8% 18% / .62), hsl(200 8% 13% / .68));
  -webkit-backdrop-filter: blur(22px) saturate(1.24);
  backdrop-filter: blur(22px) saturate(1.24);
  box-shadow:
    inset 0 1px 0 var(--liquid-glass-inner),
    inset 0 -1px 0 hsl(190 20% 90% / .024);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.app-shell .composer::before,
.app-shell .composer::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.app-shell .composer::before {
  inset: -10px -8px -12px;
  z-index: 0;
  border-radius: 31px;
  background:
    radial-gradient(circle at 37px calc(100% - 29px), rgba(231, 255, 242, .46) 0, rgba(60, 224, 128, .28) 12px, rgba(52, 192, 106, .13) 34px, transparent 78px),
    radial-gradient(82% 76% at 50% 100%, rgba(52, 192, 106, .20), rgba(52, 192, 106, .065) 42%, transparent 70%),
    linear-gradient(90deg, transparent, rgba(235, 255, 246, .12), transparent);
  filter: blur(10px) saturate(1.16);
  transform: translateY(5px) scale(.985);
  transition: opacity .22s ease, transform .22s ease;
}

.app-shell .composer::after {
  left: 28px;
  right: 28px;
  bottom: -1px;
  z-index: 2;
  height: 2px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent 0%, rgba(218, 255, 236, .42) 18%, rgba(52, 192, 106, .92) 50%, rgba(218, 255, 236, .42) 82%, transparent 100%);
  filter:
    drop-shadow(0 0 5px rgba(52, 192, 106, .54))
    drop-shadow(0 0 18px rgba(52, 192, 106, .24));
  transform: scaleX(.38);
  transform-origin: center;
  transition: opacity .2s ease, transform .2s ease;
}

.app-shell .composer:focus-within {
  border-color: var(--settings-accent-border);
  box-shadow:
    inset 0 1px 0 hsl(190 20% 92% / .07),
    inset 0 -1px 0 hsl(190 20% 90% / .026),
    0 0 0 1px var(--settings-accent-glow),
    0 0 24px var(--settings-accent-glow);
}

.app-shell .composer.drag-over {
  border-color: var(--settings-accent-border);
  background:
    radial-gradient(90% 120% at 48% 100%, rgba(52, 192, 106, .09), transparent 60%),
    var(--settings-bg-panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .06),
    0 0 0 1px var(--settings-accent-glow),
    0 0 38px var(--settings-accent-glow);
}

.app-shell .composer.drag-over::before {
  opacity: 1;
  transform: translateY(0) scale(1);
  animation: composer-drop-globe 1.85s ease-in-out infinite;
}

.app-shell .composer.drag-over .prompt-box {
  border-color: rgba(184, 255, 218, .19);
  background:
    radial-gradient(90% 130% at 22% 100%, rgba(52, 192, 106, .08), transparent 62%),
    linear-gradient(180deg, hsl(190 20% 92% / .045), transparent 48%),
    hsl(200 8% 17% / .43);
}

.app-shell .composer.is-generating {
  border-color: rgba(126, 236, 174, .22);
}

.app-shell .composer.is-generating::after {
  opacity: .92;
  transform: scaleX(.9);
  animation: composer-bottom-glow 2.35s cubic-bezier(.45, 0, .22, 1) infinite;
}

.app-shell .composer > * {
  position: relative;
  z-index: 1;
}

.app-shell .composer > .composer-file-input {
  position: absolute;
  z-index: 0;
}

.composer-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell .prompt-box {
  position: relative;
  min-height: 76px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  padding: 12px 18px 8px;
  border-radius: 21px;
  border: 1px solid hsl(190 12% 80% / .075);
  background:
    linear-gradient(180deg, hsl(190 20% 92% / .035), transparent 48%),
    hsl(200 8% 17% / .42);
  box-shadow:
    inset 0 1px 0 hsl(190 20% 92% / .036),
    0 1px 0 hsl(190 20% 90% / .014);
}

.app-shell textarea {
  min-height: 24px;
  max-height: var(--prompt-max-height);
  padding: 0;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.35;
  scrollbar-width: thin;
  scrollbar-color: var(--settings-accent-glow) transparent;
}

.app-shell .composer.has-attachments .prompt-box {
  justify-content: flex-start;
  padding-top: 10px;
  padding-bottom: 12px;
}

.app-shell textarea::placeholder {
  color: var(--settings-text-muted);
}

.app-shell .composer-bottom {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 18px;
  border-top: 0;
  border-radius: 0;
  background: transparent;
}

.app-shell .composer-bottom:has(.composer-hint:not(:empty)) {
  min-height: 26px;
  padding-top: 0;
  padding-bottom: 0;
}

.prompt-action-row {
  min-height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 4px;
}

.composer-action-group {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.composer-main-actions {
  flex: 1 1 auto;
  gap: 8px;
}

.composer-chip-wrap {
  position: relative;
  min-width: 0;
  flex: 0 1 auto;
}

.composer-chip-button {
  height: 30px;
  max-width: 174px;
  min-width: 0;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid hsl(190 12% 80% / .075);
  border-radius: 999px;
  background:
    radial-gradient(90% 140% at 50% 0%, hsl(190 20% 92% / .06), transparent 68%),
    hsl(200 8% 19% / .54);
  color: rgba(242, 252, 248, .86);
  font-size: 12px;
  font-weight: 680;
  line-height: 1;
  white-space: nowrap;
  transition:
    border-color var(--motion-duration) var(--motion-ease),
    background var(--motion-duration) var(--motion-ease),
    color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease),
    box-shadow var(--motion-duration) var(--motion-ease),
    filter var(--motion-duration) var(--motion-ease);
}

.composer-chip-button:hover,
.composer-chip-button.is-open {
  border-color: var(--settings-accent-border);
  background:
    radial-gradient(86% 145% at 50% 0%, hsl(190 20% 92% / .085), transparent 68%),
    color-mix(in oklab, var(--settings-accent) 8%, hsl(200 8% 19% / .58));
  color: var(--settings-accent-text);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--settings-accent) 8%, transparent);
}

.composer-chip-button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.composer-chip-button:focus-visible,
.composer-icon-button:focus-visible,
.send-button:focus-visible,
.composer-popover button:focus-visible {
  outline: 2px solid var(--settings-accent-border);
  outline-offset: 2px;
}

.composer-chip-button svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  color: rgba(231, 242, 237, .5);
  transition: transform var(--motion-duration) var(--motion-ease), color var(--motion-duration) var(--motion-ease);
}

.composer-chip-button.is-open svg {
  color: var(--settings-accent-text);
  transform: rotate(180deg);
}

.composer-chip-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  border-radius: 50%;
  background: var(--settings-accent);
  box-shadow: 0 0 8px var(--settings-accent-glow);
}

.composer-chip-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.composer-settings-chip {
  max-width: 142px;
}

.composer-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 24;
  width: min(318px, calc(100vw - 34px));
  max-height: min(360px, calc(100dvh - var(--composer-live-height, 104px) - 96px));
  display: grid;
  gap: 7px;
  padding: 8px;
  overflow: auto;
  border: 1px solid var(--settings-border-soft);
  border-radius: 14px;
  background:
    linear-gradient(180deg, hsl(190 20% 92% / .06), transparent 46%),
    hsl(200 8% 15% / .88);
  color: var(--settings-text-primary);
  box-shadow:
    inset 0 1px 0 hsl(190 20% 92% / .045),
    0 18px 42px rgba(0, 0, 0, .26);
  transform: translateX(var(--composer-popover-shift-x, 0));
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
  scrollbar-width: thin;
  scrollbar-color: var(--settings-border-mid) transparent;
}

.composer-model-popover {
  width: min(362px, calc(100vw - 34px));
  background:
    linear-gradient(180deg, hsl(190 20% 92% / .075), transparent 50%),
    hsl(200 8% 15% / .95);
}

.composer-popover.is-open {
  animation: composer-popover-in .16s var(--liquid-ease-soft);
}

.composer-popover-title {
  padding: 4px 4px 0;
  color: rgba(218, 231, 226, .48);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
  line-height: 1;
  text-transform: uppercase;
}

.composer-popover-empty {
  padding: 10px;
  color: var(--settings-text-muted);
  font-size: 12px;
}

.composer-model-list,
.composer-settings-grid {
  display: grid;
  gap: 5px;
}

.composer-model-option,
.composer-setting-pill {
  min-width: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(245, 255, 251, .68);
  transition:
    border-color var(--motion-duration) var(--motion-ease),
    background var(--motion-duration) var(--motion-ease),
    color var(--motion-duration) var(--motion-ease),
    transform var(--motion-duration) var(--motion-ease),
    box-shadow var(--motion-duration) var(--motion-ease),
    filter var(--motion-duration) var(--motion-ease);
}

.composer-model-option {
  min-height: 58px;
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  text-align: left;
}

.composer-model-option-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.composer-model-option strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-model-option strong {
  font-size: 12px;
  font-weight: 720;
}

.composer-model-kind {
  flex: 0 0 auto;
  color: rgba(218, 231, 226, .45);
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: uppercase;
}

.composer-model-details {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.composer-model-detail-chip {
  max-width: 84px;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  overflow: hidden;
  border: 1px solid rgba(218, 231, 226, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  color: rgba(218, 231, 226, .52);
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-model-option:hover,
.composer-setting-pill:hover {
  border-color: var(--settings-border-mid);
  background: hsl(190 20% 92% / .04);
  color: var(--settings-text-primary);
}

.composer-model-option.is-selected,
.composer-setting-pill.is-selected {
  border-color: color-mix(in srgb, var(--settings-accent) 26%, transparent);
  background:
    radial-gradient(65% 130% at 50% 0%, hsl(190 20% 90% / .08), transparent 70%),
    color-mix(in oklab, var(--settings-accent) 12%, hsl(200 10% 40% / .08));
  color: var(--settings-accent-text);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--settings-accent) 9%, transparent);
}

.composer-model-option.is-selected .composer-model-kind {
  color: color-mix(in srgb, var(--settings-accent-text) 72%, white 8%);
}

.composer-model-option.is-selected .composer-model-detail-chip {
  border-color: color-mix(in srgb, var(--settings-accent) 18%, transparent);
  background: color-mix(in srgb, var(--settings-accent) 10%, rgba(255, 255, 255, .035));
  color: color-mix(in srgb, var(--settings-accent-text) 62%, white 8%);
}

.composer-settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
}

.composer-setting-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 680;
}

.composer-icon-button,
.send-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: rgba(222, 238, 232, .78);
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.composer-icon-button.compact {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 10px;
}

.composer-icon-button:hover,
.composer-icon-button[aria-expanded="true"] {
  border-color: transparent;
  background: transparent;
  color: var(--settings-accent);
}

.prompt-attach-button {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 12px;
  color: rgba(246, 255, 251, .92);
}

.prompt-attach-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
  transform: translateX(-4px);
}

.send-button {
  width: 36px;
  height: 36px;
  min-height: 36px;
  border-radius: 12px;
  border-color: var(--settings-accent-border);
  background: linear-gradient(180deg, var(--settings-accent), var(--workspace-accent-strong));
  color: #f6fffb;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .2),
    0 8px 22px var(--settings-accent-glow);
}

.send-button:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .26),
    0 12px 28px var(--settings-accent-glow);
}

.send-button:disabled {
  border-color: transparent;
  background: rgba(255, 255, 255, .045);
  color: rgba(214, 228, 223, .25);
  box-shadow: none;
  cursor: not-allowed;
}

.send-button.is-busy svg {
  opacity: .55;
}

.composer-chat-tool[hidden],
.app-shell:not([data-workflow="chat"]) .composer-chat-tool {
  display: none !important;
}

.composer-chat-tool.is-active {
  border-color: var(--settings-accent-border);
  background: var(--settings-accent-soft);
  color: var(--settings-accent-text);
}

.composer-motion-control,
.composer-popover button {
  isolation: isolate;
  will-change: transform, filter;
}

.composer-motion-control > *:not(.motion-ripple),
.composer-popover button > *:not(.motion-ripple) {
  position: relative;
  z-index: 2;
}

.composer-motion-control.is-pressing,
.composer-popover button.is-pressing {
  transform: translateY(var(--motion-tap-y)) scale(var(--motion-tap-scale));
  filter: brightness(1.08) saturate(1.08);
}

.composer-motion-control.motion-pop,
.composer-popover button.motion-pop {
  animation: composer-tactile-pop var(--motion-pop-duration) var(--motion-ease) both;
}

.motion-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 120%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--settings-accent) 28%, white 18%) 0%, transparent 62%);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.18);
  animation: composer-ripple-out var(--motion-pop-duration) var(--motion-ease) forwards;
}

.composer-chip-button.is-open.motion-pop,
.composer-chat-tool.is-active.motion-pop,
.composer-model-option.is-selected.motion-pop,
.composer-setting-pill.is-selected.motion-pop {
  box-shadow:
    inset 0 0 18px color-mix(in srgb, var(--settings-accent) 12%, transparent),
    0 0 0 1px color-mix(in srgb, var(--settings-accent) 14%, transparent);
}

@keyframes composer-tactile-pop {
  0% {
    transform: translateY(var(--motion-tap-y)) scale(var(--motion-tap-scale));
    filter: brightness(1.12);
  }
  58% {
    transform: translateY(-1px) scale(var(--motion-pop-scale));
    filter: brightness(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes composer-ripple-out {
  0% {
    opacity: var(--motion-ring-opacity);
    transform: translate(-50%, -50%) scale(.18);
  }
  58% {
    opacity: calc(var(--motion-ring-opacity) * .52);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(var(--motion-ring-scale));
  }
}

@keyframes composer-drop-globe {
  0%,
  100% {
    opacity: .74;
    transform: translateY(0) scale(.992);
    filter: blur(11px) saturate(1.08);
  }
  48% {
    opacity: 1;
    transform: translateY(-2px) scale(1.012);
    filter: blur(9px) saturate(1.26);
  }
}

@keyframes composer-bottom-glow {
  0%,
  100% {
    opacity: .42;
    transform: scaleX(.46);
    filter:
      drop-shadow(0 0 4px rgba(52, 192, 106, .42))
      drop-shadow(0 0 13px rgba(52, 192, 106, .16));
  }
  44% {
    opacity: .98;
    transform: scaleX(1);
    filter:
      drop-shadow(0 0 7px rgba(108, 242, 164, .66))
      drop-shadow(0 0 24px rgba(52, 192, 106, .28));
  }
  70% {
    opacity: .72;
    transform: scaleX(.72);
  }
}

@keyframes composer-popover-in {
  from {
    opacity: 0;
    transform: translateX(var(--composer-popover-shift-x, 0)) translateY(5px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateX(var(--composer-popover-shift-x, 0)) translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-shell .composer.drag-over::before,
  .app-shell .composer.is-generating::after,
  .composer-motion-control,
  .composer-popover button,
  .composer-popover.is-open {
    animation: none !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .app-shell .composer.drag-over::before {
    opacity: .86;
    transform: translateY(0) scale(1);
  }

  .app-shell .composer.is-generating::after {
    opacity: .78;
    transform: scaleX(.82);
  }

  .motion-ripple {
    display: none;
  }
}

.composer-hint {
  min-width: 0;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  color: rgba(217, 232, 226, .46);
  font-size: 12px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-hint.error {
  color: rgba(255, 174, 142, .86);
}

.app-shell #projectSelect {
  display: none;
}

.app-shell .composer-hidden-controls {
  display: none !important;
}

.app-shell .composer,
.app-shell .composer:focus-within,
.app-shell .composer.drag-over,
.app-shell .model-settings-panel,
.app-shell .sent-bubble,
.app-shell .sent-attachment,
.app-shell .sent-action-button::before,
.app-shell .assistant-result-preview,
.app-shell .assistant-result-preview:hover,
.app-shell .assistant-result-preview:focus-visible,
.app-shell .generation-wait-card,
.app-shell .assistant-pending--chat,
.app-shell .assistant-pending--visual {
  box-shadow: none !important;
}

/* Render stability: keep the 2K/fullscreen scroll path out of expensive
   backdrop/mask/filter compositing. These effects were visually pleasant but
   could make Chromium drop whole UI layers while a media-heavy thread scrolls. */
.app-shell .workspace::after {
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
  opacity: .28;
  background-blend-mode: normal;
}

.app-shell .sent-thread {
  contain: layout paint;
  transform: translateZ(0);
  will-change: scroll-position;
  overflow-x: hidden;
}

.app-shell .sent-message {
  contain: layout paint;
}

.app-shell .sent-bubble,
.app-shell .composer,
.app-shell .composer:focus-within,
.app-shell .composer.drag-over,
.app-shell .model-settings-panel,
.app-shell .workspace-updates-card,
.app-shell .settings-panel,
.composer-popover,
.model-picker-menu,
.attachment-viewer-dialog,
.attachment-viewer-backdrop {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.app-shell .sent-bubble {
  background:
    linear-gradient(180deg, var(--workspace-accent-wash), transparent 62%),
    hsl(200 8% 16% / .98);
}

.app-shell .sent-attachment {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)),
    hsl(200 8% 15% / .94);
}

.app-shell .composer {
  background:
    radial-gradient(110% 130% at 50% 0%, hsl(190 20% 92% / .07), transparent 58%),
    linear-gradient(180deg, hsl(200 8% 18% / .90), hsl(200 8% 13% / .94));
}

.app-shell .model-settings-panel,
.app-shell .workspace-updates-card {
  background:
    radial-gradient(120% 90% at 50% 0%, hsl(190 20% 92% / .06), transparent 62%),
    linear-gradient(180deg, hsl(200 8% 17% / .94), hsl(200 8% 13% / .96));
}

.app-shell .workspace-updates-card {
  position: absolute;
  top: 76px;
  right: 28px;
  z-index: 4;
  width: min(340px, calc(100% - 56px));
  min-height: 142px;
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 20px 22px;
  border: 1px solid var(--liquid-glass-border);
  border-radius: 20px;
  background:
    radial-gradient(120% 100% at 50% 0%, hsl(190 20% 92% / .07), transparent 64%),
    linear-gradient(180deg, hsl(200 8% 17% / .58), hsl(200 8% 13% / .62));
  color: var(--settings-text-primary);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  backdrop-filter: blur(20px) saturate(1.18);
  box-shadow:
    inset 0 1px 0 var(--liquid-glass-inner),
    inset 0 -1px 0 hsl(190 20% 90% / .02);
  pointer-events: none;
}

.app-shell .workspace-updates-card span {
  color: var(--settings-accent-text);
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-shell .workspace-updates-card strong {
  max-width: 210px;
  color: rgba(244, 255, 251, .90);
  font-size: 20px;
  font-weight: 720;
  line-height: 1.18;
  letter-spacing: 0;
}

.app-shell .settings-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  width: min(620px, 100%);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(221, 238, 234, .18);
  border-radius: 16px;
  background: rgba(13, 21, 21, .98);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 22px 70px rgba(0, 0, 0, .36);
  backdrop-filter: blur(18px);
}

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

.settings-panel-header span {
  min-width: 0;
  overflow: hidden;
  color: rgba(244, 255, 251, .92);
  font-size: 13px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .settings-panel .settings-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.15fr) repeat(3, minmax(112px, .85fr));
  gap: 9px;
  padding: 0;
}

.app-shell .settings-panel .settings-row label {
  min-width: 0;
}

.app-shell .settings-panel .settings-row span {
  display: block;
}

.app-shell .settings-panel .usage-panel {
  display: grid;
  padding: 0;
}

.app-shell .model-settings-panel {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 7;
  width: min(340px, calc(100vw - 56px));
  max-height: calc(100dvh - 56px);
  display: grid;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  isolation: isolate;
  padding: 16px;
  border: 1px solid var(--liquid-glass-border);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 50% 0%, hsl(190 20% 92% / .07), transparent 62%),
    linear-gradient(180deg, hsl(200 8% 17% / .58), hsl(200 8% 13% / .62));
  color: var(--settings-text-primary);
  box-shadow:
    inset 0 1px 0 var(--liquid-glass-inner),
    inset 0 -1px 0 hsl(190 20% 90% / .024);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  backdrop-filter: blur(22px) saturate(1.22);
  scrollbar-width: thin;
  scrollbar-color: var(--settings-border-mid) transparent;
  transition:
    border-color .24s cubic-bezier(.32,.72,.24,1),
    background .24s cubic-bezier(.32,.72,.24,1),
    opacity .22s cubic-bezier(.32,.72,.24,1),
    transform .34s cubic-bezier(.32,.72,.24,1);
}

.app-shell .model-settings-panel.is-resizing {
  overflow: hidden;
  transition:
    height .38s cubic-bezier(.32,.72,.24,1),
    border-color .24s cubic-bezier(.32,.72,.24,1),
    background .24s cubic-bezier(.32,.72,.24,1);
}

.app-shell .model-settings-panel::before {
  display: none;
}

.settings-panel-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.settings-panel-title span {
  width: fit-content;
  min-height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px 1px;
  border: 1px solid var(--settings-accent-border);
  border-radius: 999px;
  background: var(--settings-accent-soft);
  color: var(--settings-accent-text);
  font-size: 9px;
  font-weight: 720;
  line-height: 1;
  text-transform: uppercase;
}

.settings-panel-title strong {
  min-width: 0;
  overflow: hidden;
  color: rgba(244, 255, 251, .94);
  font-size: 12px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell .model-settings-panel .settings-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 0;
}

.settings-field {
  min-width: 0;
  display: grid;
  gap: 0;
}

.app-shell[data-workflow="audio"] #settingsPanel .settings-field-standard {
  display: none !important;
}

.settings-field > span,
.app-shell .model-settings-panel .settings-field > span {
  display: block !important;
  margin-bottom: 10px;
  color: var(--settings-text-label);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.model-picker {
  position: relative;
  min-width: 0;
}

.model-picker-button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--settings-accent) 18%, var(--settings-border-mid));
  border-radius: 12px;
  background:
    radial-gradient(86% 135% at 50% 0%, hsl(190 20% 92% / .055), transparent 62%),
    hsl(200 8% 18% / .54);
  color: var(--settings-text-primary);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  box-shadow:
    inset 0 1px 0 hsl(190 20% 90% / .035),
    inset 0 -1px 0 hsl(190 20% 90% / .018),
    inset 0 0 16px color-mix(in srgb, var(--settings-accent) 5%, transparent);
  transition:
    border-color .34s var(--liquid-ease-soft),
    background .34s var(--liquid-ease-soft),
    box-shadow .34s var(--liquid-ease-soft),
    color .34s var(--liquid-ease-soft);
}

.model-picker-button:hover,
.model-picker.is-open .model-picker-button {
  border-color: color-mix(in srgb, var(--settings-accent) 24%, transparent);
  background:
    radial-gradient(80% 135% at 50% 0%, hsl(190 20% 92% / .08), transparent 68%),
    color-mix(in oklab, var(--settings-accent) 9%, hsl(200 8% 19% / .62));
  box-shadow:
    inset 0 1px 0 hsl(190 20% 90% / .05),
    inset 0 0 18px color-mix(in srgb, var(--settings-accent) 9%, transparent);
}

.model-picker-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-left: auto;
  color: var(--settings-text-muted);
  transition: transform .16s ease, color .16s ease;
}

.model-picker.is-open .model-picker-button svg {
  color: var(--settings-text-primary);
  transform: rotate(180deg);
}

.model-picker-button span,
.model-picker-option span {
  min-width: 0;
  position: relative;
  z-index: 2;
  display: block !important;
  overflow: hidden;
  color: inherit !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-picker-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  max-height: 232px;
  overflow-y: auto;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--settings-border-soft);
  border-radius: 12px;
  background:
    linear-gradient(180deg, hsl(190 20% 92% / .055), transparent 46%),
    hsl(200 8% 15% / .82);
  box-shadow:
    inset 0 1px 0 hsl(190 20% 92% / .045),
    0 16px 38px rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  scrollbar-width: thin;
  scrollbar-color: var(--settings-border-mid) transparent;
}

.model-picker-option {
  width: 100%;
  min-height: 34px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, .66);
  font-size: 12px;
  font-weight: 620;
  text-align: left;
  transition:
    border-color .28s var(--liquid-ease-soft),
    background .28s var(--liquid-ease-soft),
    color .28s var(--liquid-ease-soft);
}

.model-picker-option:hover {
  border-color: var(--settings-border-mid);
  background:
    radial-gradient(80% 135% at 50% 0%, hsl(190 20% 92% / .045), transparent 68%),
    hsl(200 8% 23% / .54);
  color: var(--settings-text-primary);
}

.model-picker-option.is-selected {
  border-color: color-mix(in srgb, var(--settings-accent) 24%, transparent);
  background:
    radial-gradient(65% 130% at 50% 0%, hsl(190 20% 90% / .08), transparent 70%),
    color-mix(in oklab, var(--settings-accent) 12%, hsl(200 10% 40% / .08));
  color: var(--settings-accent-text);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--settings-accent) 9%, transparent);
}

.model-picker-option.is-selected::after {
  content: "";
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 999px;
  background: var(--settings-accent);
}

.model-picker-button::before,
.model-picker-option::before,
.settings-aspect-button::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 1.5px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--settings-accent), transparent);
  filter: blur(.3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--liquid-ease-soft);
}

.model-picker-button::before,
.model-picker.is-open .model-picker-button::before,
.model-picker-option.is-selected::before,
.settings-aspect-button.is-selected::before {
  opacity: .75;
}

.settings-native-field,
.settings-native-select {
  display: none !important;
}

.settings-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.settings-aspect-button,
.settings-segment-button {
  min-width: 0;
  position: relative;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--settings-border-soft);
  border-radius: 10px;
  background:
    radial-gradient(80% 135% at 50% 0%, hsl(190 20% 92% / .045), transparent 64%),
    hsl(200 8% 19% / .52);
  color: var(--settings-text-primary);
  transition:
    border-color .28s var(--liquid-ease-soft),
    background .28s var(--liquid-ease-soft),
    color .28s var(--liquid-ease-soft),
    transform .28s var(--liquid-ease-soft),
    box-shadow .28s var(--liquid-ease-soft);
}

.settings-aspect-button {
  min-height: 72px;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 10px 7px;
  text-align: center;
}

.settings-segment-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  gap: 6px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid var(--settings-border-soft);
  border-radius: 999px;
  background:
    radial-gradient(80% 140% at 50% 0%, hsl(190 20% 92% / .06), transparent 60%),
    hsl(200 8% 16% / .48);
  box-shadow:
    inset 0 1px 0 hsl(190 20% 90% / .028),
    inset 0 -1px 0 hsl(190 20% 90% / .015);
  isolation: isolate;
}

.settings-segment-indicator {
  position: absolute;
  z-index: 1;
  display: block;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border: 1px solid color-mix(in srgb, var(--settings-accent) 24%, transparent);
  border-radius: 999px;
  background:
    radial-gradient(70% 130% at 50% 0%, hsl(190 20% 94% / .13), transparent 68%),
    color-mix(in oklab, var(--settings-accent) 18%, hsl(200 10% 40% / .12));
  box-shadow:
    inset 0 1px 0 hsl(190 20% 96% / .09),
    inset 0 0 20px color-mix(in srgb, var(--settings-accent) 14%, transparent),
    0 0 0 1px color-mix(in srgb, var(--settings-accent) 10%, transparent);
  pointer-events: none;
  transform: translateX(0);
  transition:
    transform .52s var(--liquid-ease-move),
    width .52s var(--liquid-ease-move),
    border-color .46s var(--liquid-ease-soft),
    background .48s var(--liquid-ease-soft),
    box-shadow .46s var(--liquid-ease-soft);
  will-change: transform, width;
}

.app-shell .settings-row .settings-segment-indicator {
  display: block;
}

.settings-segment-indicator::before,
.settings-segment-indicator::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  pointer-events: none;
}

.settings-segment-indicator::before {
  left: 18%;
  right: 18%;
  bottom: -1px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--settings-accent), transparent);
  filter: blur(.3px);
  opacity: .75;
}

.settings-segment-indicator::after {
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, hsl(190 30% 95% / .14) 48%, transparent 62%);
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
}

.settings-segment-indicator.is-glinting::after {
  animation: workflow-glint .56s var(--liquid-ease-soft) forwards;
}

.settings-segment-indicator.is-moving {
  animation: workflow-squash .52s var(--liquid-ease-move);
}

.settings-segment-button {
  position: relative;
  z-index: 2;
  min-height: 34px;
  display: inline-flex;
  justify-content: center;
  padding: 0 10px;
  border-color: transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--settings-text-muted);
  font-size: 12px;
  font-weight: 650;
}

.settings-aspect-button:hover,
.settings-segment-button:hover {
  border-color: var(--settings-border-mid);
  background: hsl(190 20% 92% / .035);
  color: var(--settings-text-primary);
  transform: translateY(-1px);
}

.settings-aspect-button:hover {
  background:
    radial-gradient(80% 135% at 50% 0%, hsl(190 20% 92% / .055), transparent 64%),
    hsl(200 8% 23% / .56);
}

.settings-segment-button:hover {
  border-color: transparent;
  background: transparent;
  transform: none;
}

.settings-aspect-button.is-selected,
.settings-segment-button.is-selected {
  border-color: color-mix(in srgb, var(--settings-accent) 24%, transparent);
  background:
    radial-gradient(65% 130% at 50% 0%, hsl(190 20% 90% / .08), transparent 70%),
    color-mix(in oklab, var(--settings-accent) 12%, hsl(200 10% 40% / .08));
  color: var(--settings-accent-text);
  box-shadow: inset 0 0 18px color-mix(in srgb, var(--settings-accent) 9%, transparent);
}

.settings-segment-button.is-selected {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.settings-aspect-button > *,
.settings-segment-button > * {
  position: relative;
  z-index: 2;
}

.aspect-icon {
  width: 26px;
  height: 22px;
  display: grid !important;
  place-items: center;
}

.aspect-icon > span {
  display: block !important;
  max-width: 23px;
  max-height: 21px;
  border: 1.45px solid currentColor;
  border-radius: 3px;
  background: transparent;
  color: var(--settings-text-muted);
  box-shadow: none;
}

.settings-aspect-button.is-selected .aspect-icon > span {
  color: var(--settings-accent);
}

.aspect-icon-auto > span,
.aspect-icon-source > span {
  width: 20px;
  height: 15px;
  position: relative;
}

.aspect-icon-auto > span::before,
.aspect-icon-source > span::before {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: currentColor;
  font-size: 9px;
  font-weight: 760;
  line-height: 1;
}

.aspect-icon-auto > span::before {
  content: "A";
}

.aspect-icon-source > span::before {
  content: "";
  background:
    linear-gradient(90deg, transparent calc(50% - .5px), currentColor calc(50% - .5px), currentColor calc(50% + .5px), transparent calc(50% + .5px)),
    linear-gradient(0deg, transparent calc(50% - .5px), currentColor calc(50% - .5px), currentColor calc(50% + .5px), transparent calc(50% + .5px));
  opacity: .78;
}

.settings-option-label {
  max-width: 100%;
  display: block !important;
  overflow: hidden;
  color: inherit !important;
  font-size: 12.5px !important;
  font-weight: 680 !important;
  line-height: 1.05 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-option-detail {
  max-width: 100%;
  display: block !important;
  overflow: hidden;
  color: var(--settings-text-muted) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-aspect-button.is-selected .settings-option-detail {
  color: var(--settings-accent-text) !important;
  opacity: .72;
}

.app-shell .model-settings-panel .usage-panel {
  display: none !important;
}

.app-shell .reference-panel,
.app-shell .upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.app-shell .reference-panel.hidden,
.app-shell .upload-list:empty {
  display: none;
}

.app-shell .reference-chip,
.app-shell .upload-chip {
  width: 54px;
  height: 54px;
  min-height: 54px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  gap: 0;
  max-width: none;
  border-radius: 12px;
  padding: 0;
  font-size: 12px;
  border: 1px solid rgba(221, 238, 234, .18);
  background: rgba(255, 255, 255, .055);
}

.app-shell .upload-chip img,
.app-shell .reference-chip img {
  width: 100%;
  height: 100%;
  flex: 0 0 auto;
  border-radius: inherit;
  object-fit: cover;
  background: rgba(255, 255, 255, .06);
}

.reference-chip-label {
  color: rgba(244, 255, 251, .68);
  font-size: 11px;
  font-weight: 700;
}

.upload-chip-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 6px;
  color: rgba(244, 255, 251, .72);
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.app-shell .upload-chip img + .upload-chip-name,
.app-shell .upload-chip img + .upload-chip-name + span,
.app-shell .upload-chip span:not(.upload-chip-name):not(:only-child) {
  display: none;
}

.app-shell .upload-chip button,
.app-shell .reference-chip button {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: rgba(5, 8, 9, .74);
  color: rgba(244, 255, 251, .82);
  font-size: 13px;
  line-height: 1;
}

.app-shell .upload-chip button:hover,
.app-shell .reference-chip button:hover {
  background: rgba(255, 255, 255, .10);
  color: rgba(244, 255, 251, .96);
}

.app-shell .form-message {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-shell {
    --workspace-right-rail-width: 0px;
    --workspace-rail-gap: 0px;
    --workspace-content-min-width: 0px;
    --workspace-content-area-width: 100%;
    --workspace-content-width: min(740px, calc(100% - 24px));
    --workspace-content-axis-x: 50%;
    --workspace-glow-x: 50%;
  }

  .app-shell .workspace:has(> .model-settings-panel:not(.hidden)) {
    --workspace-right-rail-width: 0px;
    --workspace-rail-gap: 0px;
    --workspace-content-min-width: 0px;
    --workspace-content-area-width: 100%;
    --workspace-content-width: min(740px, calc(100% - 24px));
    --workspace-content-axis-x: 50%;
    --workspace-glow-x: 50%;
  }

  .app-shell .workspace > .workspace-updates-card {
    display: none !important;
  }
}

@media (max-height: 960px) {
  .app-shell .workspace > .workspace-updates-card {
    display: none !important;
  }
}

@media (max-width: 760px) {
  .app-shell {
    --prompt-max-height: 180px;
    --workspace-right-rail-width: 0px;
    --workspace-rail-gap: 0px;
    --workspace-content-min-width: 0px;
    --workspace-content-area-width: 100%;
    --workspace-content-width: min(740px, calc(100% - 24px));
    --workspace-content-axis-x: 50%;
    --workspace-glow-x: 50%;
  }

  .app-shell .workspace:has(> .model-settings-panel:not(.hidden)) {
    --workspace-right-rail-width: 0px;
    --workspace-rail-gap: 0px;
    --workspace-content-min-width: 0px;
    --workspace-content-area-width: 100%;
    --workspace-content-width: min(740px, calc(100% - 24px));
    --workspace-content-axis-x: 50%;
    --workspace-glow-x: 50%;
  }

  .app-shell .workflow-switcher {
    top: 12px;
    width: min(292px, calc(100vw - 72px));
    height: 40px;
    padding: 4px;
  }

  .workflow-switcher-tab {
    flex: 1 1 0;
    justify-content: center;
    gap: 5px;
    padding: 0 8px;
    font-size: 12px;
  }

  .workflow-switcher-tab svg {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
  }

  .app-shell .stream {
    padding: 0;
  }

  .app-shell .composer-wrap {
    bottom: 14px;
    width: calc(100% - 24px);
    height: 104px;
  }

  .app-shell .sent-thread {
    --sent-thread-content-width: 340px;
    --sent-thread-column-width: min(var(--sent-thread-content-width), calc(100% - 24px));
    --sent-thread-column-before: max(12px, calc(var(--workspace-content-axis-x, 50%) - (var(--sent-thread-column-width) * .5)));
    --sent-thread-top-safe: 62px;
    --sent-thread-bottom-safe: calc(14px + var(--composer-live-height, 150px) + 12px);
    bottom: 0;
    max-height: none;
    gap: 18px;
    padding: var(--sent-thread-top-safe) 0 var(--sent-thread-bottom-safe);
    scroll-padding-block: var(--sent-thread-top-safe) var(--sent-thread-bottom-safe);
  }

  .app-shell .sent-message {
    width: min(100%, 330px);
  }

  .app-shell .sent-message.from-assistant {
    max-width: min(100%, 330px);
  }

  .app-shell .sent-message.from-assistant.is-pending,
  .app-shell .sent-message.from-assistant.has-result {
    width: 248px;
    max-width: 100%;
  }

  .app-shell .sent-message.from-assistant.is-visual-pending {
    width: min(100%, 340px);
  }

  .app-shell .assistant-result-preview,
  .app-shell .generation-wait-card,
  .app-shell .assistant-pending {
    border-radius: 16px 16px 16px 6px;
  }

  .app-shell .generation-dot-grid {
    inset: 16px;
  }

  .app-shell .assistant-pending--chat {
    min-height: 88px;
    padding: 16px 16px 14px;
  }

  .app-shell .pending-hairline-ghost-a {
    width: 88%;
  }

  .app-shell .pending-hairline-ghost-b {
    width: 60%;
  }

  .app-shell .assistant-pending--visual {
    padding: 8px;
    border-radius: 16px;
  }

  .app-shell .pending-latent-aperture {
    --latent-sweep-travel: 156px;
    height: 196px;
  }

  .app-shell .composer {
    min-height: 104px;
    border-radius: 23px;
  }

  .app-shell .prompt-box {
    min-height: 76px;
    padding: 12px 14px 8px;
    border-radius: 20px;
  }

  .app-shell .composer.has-attachments .prompt-box {
    padding-top: 10px;
    padding-bottom: 11px;
  }

  .app-shell textarea {
    min-height: 24px;
    font-size: 15px;
  }

  .app-shell .composer-bottom {
    min-height: 0;
    gap: 9px;
    padding: 0 14px;
  }

  .prompt-action-row {
    gap: 8px;
    padding-top: 4px;
  }

  .composer-main-actions {
    gap: 6px;
  }

  .composer-chip-button {
    height: 29px;
    padding: 0 8px;
  }

  .composer-model-chip {
    max-width: 132px;
  }

  .composer-settings-chip {
    max-width: 112px;
  }

  .composer-popover {
    left: auto;
    right: 0;
    max-height: min(330px, calc(100dvh - var(--composer-live-height, 104px) - 74px));
  }

  .composer-model-popover {
    left: 0;
    right: auto;
  }

  .composer-hint {
    max-width: 42vw;
  }

  .app-shell .settings-panel {
    right: auto;
    left: 0;
    width: 100%;
    max-height: min(42dvh, 360px);
    overflow-y: auto;
  }

  .app-shell .settings-panel .settings-row {
    grid-template-columns: 1fr 1fr;
  }

  .app-shell .composer-popover {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    bottom: calc(14px + var(--composer-live-height, 150px) + 12px);
    width: auto;
    max-height: min(52dvh, 430px);
    transform: none !important;
  }
}

@media (max-width: 440px) {
  .composer-hint {
    display: none;
  }

  .composer-model-chip {
    max-width: 116px;
  }

  .composer-settings-chip {
    max-width: 94px;
  }

  .app-shell .settings-panel .settings-row {
    grid-template-columns: 1fr;
  }
}

/* Audio workflow */
.audio-settings-fields {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.audio-settings-header {
  display: grid;
  gap: 7px;
  padding: 2px 2px 0;
}

.audio-settings-header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.audio-settings-header strong {
  color: var(--settings-text-primary);
  font-size: 14px;
}

.audio-settings-kicker {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid var(--settings-accent-border);
  border-radius: 999px;
  background: var(--settings-accent-soft);
  color: var(--settings-accent-text) !important;
  font-size: 9px !important;
  font-weight: 760 !important;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.audio-settings-header p {
  margin: 0;
  color: var(--settings-text-muted);
  font-size: 11px;
  line-height: 1.45;
}

.audio-settings-primary,
.audio-advanced-settings,
.audio-weight-grid {
  display: grid;
  gap: 12px;
}

.composer-audio-settings {
  display: grid;
  gap: 12px;
}

.composer-audio-settings .audio-text-field > span,
.composer-audio-settings .audio-weight-grid label > span {
  margin-bottom: 6px;
}

.composer-audio-settings .audio-text-field input,
.composer-audio-settings .audio-text-field textarea,
.composer-audio-settings .audio-text-field select {
  background: hsl(200 8% 12% / .62);
}

.audio-setting-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.audio-setting-group legend,
.audio-text-field > span,
.audio-weight-grid label > span {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 8px;
  color: var(--settings-text-label);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.audio-setting-group small,
.audio-text-field small {
  color: var(--settings-text-muted);
  font-size: 9px;
  font-weight: 550;
  letter-spacing: 0;
  text-transform: none;
}

.audio-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--settings-border-soft);
  border-radius: 12px;
  background: hsl(200 8% 11% / .38);
}

.audio-choice-grid button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--settings-text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.audio-choice-grid button.is-selected {
  border-color: var(--settings-accent-border);
  background: var(--settings-accent-soft);
  color: var(--settings-accent-text);
  box-shadow: inset 0 0 16px var(--settings-accent-glow);
}

.audio-text-field {
  min-width: 0;
  display: grid;
}

.audio-text-field input,
.audio-text-field textarea,
.audio-text-field select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--settings-border-soft);
  border-radius: 10px;
  outline: none;
  background: hsl(200 8% 17% / .62);
  color: var(--settings-text-primary);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}

.audio-text-field textarea {
  min-height: 66px;
}

.audio-text-field input:focus,
.audio-text-field textarea:focus,
.audio-text-field select:focus {
  border-color: var(--settings-accent-border);
  box-shadow: 0 0 0 3px var(--settings-accent-soft);
}

.audio-weight-grid label {
  min-width: 0;
  display: grid;
}

.audio-weight-grid output {
  color: var(--settings-accent-text);
  font-variant-numeric: tabular-nums;
}

.audio-weight-grid input[type="range"] {
  width: 100%;
  accent-color: var(--settings-accent);
}

.assistant-audio-result {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 4px 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--workspace-accent-line);
  border-radius: 18px;
  background:
    radial-gradient(100% 140% at 0 0, var(--workspace-accent-soft), transparent 58%),
    hsl(200 8% 14% / .76);
}

.assistant-audio-mark {
  grid-row: 1 / span 2;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 13px;
  background: var(--workspace-accent-soft);
}

.assistant-audio-mark span {
  width: 2px;
  border-radius: 999px;
  background: var(--workspace-accent);
}

.assistant-audio-mark span:nth-child(1),
.assistant-audio-mark span:nth-child(5) { height: 10px; }
.assistant-audio-mark span:nth-child(2),
.assistant-audio-mark span:nth-child(4) { height: 20px; }
.assistant-audio-mark span:nth-child(3) { height: 28px; }

.assistant-audio-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.assistant-audio-copy strong {
  overflow: hidden;
  color: var(--workspace-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assistant-audio-copy span {
  color: var(--workspace-dim);
  font-size: 10px;
  text-transform: uppercase;
}

.assistant-audio-result audio,
.preview-box-audio audio,
.attachment-viewer-audio {
  width: 100%;
  min-width: 0;
  accent-color: var(--workspace-accent);
}

.assistant-audio-result audio {
  grid-column: 2;
  height: 34px;
}

.preview-box-audio {
  min-height: 92px !important;
  align-items: center;
  padding: 20px;
}

@media (max-width: 760px) {
  .app-shell .workflow-switcher {
    width: min(360px, calc(100vw - 48px));
  }

  .workflow-switcher-tab {
    gap: 4px;
    padding: 0 6px;
    font-size: 11px;
  }

  .workflow-switcher-tab svg {
    width: 13px;
    height: 13px;
    flex-basis: 13px;
  }
}

@media (min-width: 761px) and (max-width: 1740px) {
  .app-shell .model-settings-panel {
    right: 18px;
    bottom: 28px;
    width: min(340px, calc(100vw - 36px));
    max-height: calc(100dvh - 56px);
  }
}

@media (min-width: 761px) and (max-width: 1180px) {
  .app-shell .model-settings-panel {
    transform: translateX(calc(100% + 28px));
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 760px) {
  .app-shell .workspace > .model-settings-panel,
  .app-shell .workspace > .model-settings-panel:not(.hidden) {
    display: none !important;
    left: 12px;
    right: 12px;
    bottom: calc(14px + var(--composer-live-height, 150px) + 18px);
    width: auto;
    max-height: min(calc(100dvh - var(--composer-live-height, 150px) - 58px), 430px);
    padding: 15px;
    border-radius: 18px;
    transform: translateY(calc(100% + 32px));
    opacity: 0;
    pointer-events: none;
  }

  .settings-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-aspect-button {
    min-height: 66px;
    padding: 9px 7px;
  }
}

@media (max-width: 440px) {
  .settings-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-segment-button {
    min-width: 54px;
  }
}
