:root {
  color-scheme: light;
  font-family:
  ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --app-bg: #ffffff;
  --sidebar-bg: #f7f7f8;
  --sidebar-bg-2: #f2f2f3;
  --surface: #ffffff;
  --surface-soft: #f6f6f7;
  --surface-muted: #eeeeef;
  --line: #e8e8ea;
  --line-strong: #d3d5d9;
  --text: #202124;
  --text-inverse: #ffffff;
  --muted: #8a8d91;
  --muted-strong: #63666b;
  --accent: #2f6f63;
  --accent-soft: rgb(47 111 99 / 0.14);
  --user-message-bg: color-mix(in srgb, var(--surface-muted) 78%, var(--surface));
  --button-contrast-bg: #202124;
  --button-contrast-text: #ffffff;
  --composer-send-bg: var(--button-contrast-bg);
  --composer-send-text: var(--button-contrast-text);
  --brand-glow: #2f6f63;
  --brand-glow-soft: rgb(47 111 99 / 0.13);
  --brand-glow-strong: rgb(47 111 99 / 0.24);
  --codex-logo-filter: none;
  --code-surface: #f8fafc;
  --code-comment: #64748b;
  --code-keyword: #4f46e5;
  --code-string: #047857;
  --code-number: #b45309;
  --code-function: #0f766e;
  --code-meta: #94a3b8;
  --danger: #e5484d;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.04), 0 18px 44px rgba(0, 0, 0, 0.08);
  --sidebar-width: 284px;
  --right-width: 356px;
  --composer-height: 112px;
  --file-meta-width: 5.5rem;
}

html[data-theme='night'] {
  color-scheme: dark;
  --app-bg: #0b0b0c;
  --sidebar-bg: #202020;
  --sidebar-bg-2: #1b1b1c;
  --surface: #202020;
  --surface-soft: #2a2a2b;
  --surface-muted: #343436;
  --line: #353537;
  --line-strong: #464648;
  --text: #ededee;
  --text-inverse: #17181a;
  --muted: #94969b;
  --muted-strong: #b4b6bb;
  --accent: #7fcbbd;
  --accent-soft: rgb(127 203 189 / 0.2);
  --user-message-bg: color-mix(in srgb, var(--surface-muted) 82%, transparent);
  --button-contrast-bg: #ffffff;
  --button-contrast-text: #101114;
  --composer-send-bg: var(--button-contrast-bg);
  --composer-send-text: var(--button-contrast-text);
  --brand-glow: #7fcbbd;
  --brand-glow-soft: rgb(127 203 189 / 0.18);
  --brand-glow-strong: rgb(127 203 189 / 0.3);
  --codex-logo-filter: invert(1);
  --code-surface: #1a1b1f;
  --code-comment: #7d8590;
  --code-keyword: #c792ea;
  --code-string: #a5d6a7;
  --code-number: #f78c6c;
  --code-function: #82aaff;
  --code-meta: #697098;
  --danger: #ff6b6f;
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.18), 0 18px 44px rgba(0, 0, 0, 0.26);
}

html[data-theme='day'] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html {
  background: var(--app-bg);
}

body {
  min-width: 320px;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--app-bg);
  color: var(--text);
}

.app-boot-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: var(--app-bg);
  color: var(--text);
  transition: opacity 0.18s ease;
}

.app-boot-loader[hidden] {
  display: none;
}

.app-boot-loader-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 600;
}

.paw-loader-mark {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffb020 0%, #ffd166 55%, #ffe08a 100%);
  box-shadow: 0 18px 48px rgb(255 176 32 / 0.28);
  animation: paw-loader-pulse 1.45s ease-in-out infinite;
}

.paw-loader-mark::before {
  content: "";
  position: absolute;
  inset: 15px;
  background: #17130b;
  -webkit-mask: url('/paw-loader-20260531.svg') center / contain no-repeat;
  mask: url('/paw-loader-20260531.svg') center / contain no-repeat;
}

@keyframes paw-loader-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1) rotate(-2deg);
  }

  50% {
    transform: translateY(-4px) scale(1.035) rotate(2deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .paw-loader-mark {
    animation: none;
  }
}

.user-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--app-bg) 86%, transparent);
  backdrop-filter: blur(18px);
}

.user-gate[hidden] {
  display: none;
}

.user-gate-card {
  width: min(390px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: var(--shadow-card);
}

.user-gate-card h1 {
  margin-bottom: 18px;
  font-size: 22px;
}

.user-code-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.user-code-input {
  width: 100%;
  min-height: 52px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 20px;
  letter-spacing: 0;
  outline: none;
  padding: 0 16px;
}

.user-code-input:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 70%, transparent);
}

.user-gate-error {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}

.user-gate-actions {
  display: grid;
  gap: 10px;
}

.user-choice-button {
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-size: 18px;
  font-weight: 650;
  padding: 0 16px;
  text-align: left;
}

.user-choice-button:hover {
  background: var(--surface-muted);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(2px);
}

.drawer-backdrop[hidden] {
  display: none;
}

body.mobile-drawer-left .chat-list-panel {
  transform: translateX(0) !important;
}

body.mobile-drawer-right .files-panel {
  transform: translateX(0) !important;
}

.mobile-drawer-button {
  display: none;
}

button,
select,
textarea {
  font: inherit;
}

button,
select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
}

button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -webkit-appearance: none;
  appearance: none;
  padding: 0 13px;
  cursor: pointer;
  font-weight: 500;
  user-select: none;
}

button *,
select,
option,
summary,
label,
[role='button'],
[role='menuitem'],
.chat-open-button,
.chat-open-button *,
.chat-row-menu-button,
.file-row,
.file-row *,
.download-link,
.menu-row,
.mode-menu-row,
.model-menu-row,
.agent-menu-row,
.composer-icon-button,
.composer-agent-pill,
.composer-mode-pill,
.composer-send-button,
.topbar-link-button,
.topbar-icon-button,
.mobile-drawer-button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button:hover {
  background: var(--surface-muted);
}

button:focus {
  outline: 0;
  -webkit-focus-ring-color: transparent;
}

button:focus:not(:focus-visible) {
  outline: 0;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.layout {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--app-bg);
}

.layout::before,
.layout::after {
  display: none;
}

.chat-panel::before,
.chat-panel::after {
  position: fixed;
  right: var(--right-width);
  left: var(--sidebar-width);
  z-index: 1;
  pointer-events: none;
  content: '';
}

.chat-panel::before {
  top: 0;
  height: 70px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--app-bg) 88%, transparent) 0%,
    color-mix(in srgb, var(--app-bg) 48%, transparent) 62%,
    transparent 100%
  );
}

.chat-panel::after {
  bottom: 0;
  height: 152px;
  background: linear-gradient(
    0deg,
    color-mix(in srgb, var(--app-bg) 86%, transparent) 0%,
    color-mix(in srgb, var(--app-bg) 34%, transparent) 58%,
    transparent 100%
  );
}

.topbar {
  position: fixed;
  top: 0;
  right: var(--right-width);
  left: var(--sidebar-width);
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: 53px;
  padding: 0 20px;
  border-bottom: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: auto;
}

.thread-title {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  pointer-events: auto;
}

.page-title-button,
.page-title-input {
  display: block;
  min-width: 0;
  max-width: 100%;
  min-height: 34px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  overflow: hidden;
  font: inherit;
  font-size: 18px;
  font-weight: 560;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-title-input {
  width: min(360px, 100%);
  caret-color: var(--accent);
}

.page-title-button[hidden],
.page-title-input[hidden] {
  display: none;
}

.page-title-button:hover,
.page-title-input:focus {
  background: transparent;
  color: var(--text);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  overflow: hidden;
  font-size: 18px;
  font-weight: 560;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.eyebrow {
  display: none;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.copy-feedback-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--composer-height, 112px) + 24px + env(safe-area-inset-bottom, 0px));
  z-index: 140;
  max-width: min(280px, calc(100vw - 32px));
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  box-shadow: 0 14px 42px rgb(0 0 0 / 0.18);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  transform: translate(-50%, 8px) scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.copy-feedback-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.copy-feedback-toast[hidden] {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 8px;
  pointer-events: auto;
}

.topbar-icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--muted-strong);
  box-shadow: 0 10px 30px color-mix(in srgb, #000 9%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.18);
  backdrop-filter: blur(28px) saturate(1.18);
}

.topbar-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  color: var(--muted-strong);
  box-shadow: 0 10px 30px color-mix(in srgb, #000 9%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(1.18);
  backdrop-filter: blur(28px) saturate(1.18);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-icon-button:hover,
.topbar-link-button:hover {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--accent);
}

.topbar-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  max-width: min(42vw, 280px);
  min-height: 30px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font-size: 13px;
}

button.status-pill {
  cursor: pointer;
  font: inherit;
  text-align: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button.status-pill:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 2px;
}

.status-pill-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill-fade .status-pill-text {
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.25rem), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.25rem), transparent);
}

#connectionStatus.status-pill {
  flex: 1 1 auto;
  max-width: min(52vw, 320px);
}

.user-status-pill .message-user-avatar,
.user-status-pill .message-user-initial {
  width: 17px;
  min-width: 17px;
  height: 17px;
}

.status-pill.online {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.status-pill.error {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.chat-list-panel {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 19;
  display: flex;
  width: var(--sidebar-width);
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 16px 10px 18px;
  background: linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
}

.chat-panel {
  position: fixed;
  top: 53px;
  right: var(--right-width);
  bottom: 0;
  left: var(--sidebar-width);
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 20px 0;
  overflow: hidden;
  background: var(--app-bg);
}

.files-panel {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: calc(var(--right-width) - 36px);
  max-height: none;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(28px) saturate(1.18);
  backdrop-filter: blur(28px) saturate(1.18);
}

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

.chat-list-panel .panel-head {
  padding: 0 8px 8px;
}

.chat-list-panel .panel-head h2 {
  color: var(--muted);
}

#newChatButton {
  min-height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.project-nav {
  display: grid;
  gap: 6px;
  padding: 4px 0 10px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.project-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project-nav-icon-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted-strong);
}

.project-nav-icon-button svg,
.project-row-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-nav-icon-button:hover,
.project-nav-icon-button:focus-visible {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  color: var(--text);
  outline: none;
}

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

.project-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 86%, transparent);
  text-align: left;
}

.project-row:hover,
.project-row:focus-visible,
.project-row.active {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  color: var(--text);
  outline: none;
}

.project-row-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--muted-strong);
}

.project-row-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-row-count {
  min-width: 1.4em;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.project-empty {
  padding: 5px 8px 2px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar {
  display: none;
  justify-content: center;
  gap: 8px;
  max-width: 850px;
  width: 100%;
  margin: 16px auto 14px;
}

.toolbar select {
  flex: 1 1 180px;
  min-width: 0;
  max-width: 260px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.chat-list,
.file-list {
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chat-list {
  flex: 1;
  min-height: 0;
  margin-top: 0;
}

.chat-row,
.file-row {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: stretch;
  gap: 0;
  margin: 1px 0;
  padding: 0;
}

.chat-row-no-menu {
  grid-template-columns: minmax(0, 1fr);
}

.chat-open-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px;
  align-items: start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 8px 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.chat-row-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.chat-unread-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 72%, transparent);
}

.chat-unread-dot[hidden] {
  display: none;
}

.chat-row:hover,
.files-panel .file-list .file-row:not(.file-row-active):hover {
  background: color-mix(in srgb, var(--surface) 44%, transparent);
}

.chat-row:hover .chat-open-button,
.chat-row.active .chat-open-button,
.chat-row-menu-button:hover {
  background: transparent;
}

.chat-row-menu-button {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 34px;
  min-width: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 10px 10px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-row-menu-button .menu-icon {
  width: 16px;
  height: 16px;
}

.chat-row-menu-button:hover,
.chat-row-menu-button:focus-visible {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  color: var(--text);
  outline: none;
}

.chat-row.active {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 86%, transparent);
  font-size: 15px;
  line-height: 1.25;
  white-space: normal;
}

.chat-title-text {
  display: -webkit-box;
  overflow: hidden;
  min-width: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.chat-pin-icon {
  display: inline-flex;
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: color-mix(in srgb, var(--accent) 78%, var(--muted-strong));
}

.chat-pin-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.chat-row-pinned .chat-open-button {
  padding-left: 10px;
}

.chat-row-body .chat-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.chat-meta-line {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
}

.chat-meta-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-agent-logo,
.chat-agent-logo-initial {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.chat-agent-logo {
  object-fit: contain;
}

.chat-agent-logo-initial {
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 8px;
  font-weight: 700;
}

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

.messages {
  width: min(910px, 100%);
  flex: 1;
  min-height: 0;
  margin: 0 auto;
  padding: 16px 30px calc(var(--composer-height) + 70px);
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.messages-bottom-anchor {
  flex: 0 0 auto;
  width: 100%;
  height: 1px;
}

.messages.is-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.messages-loader {
  color: var(--muted);
  font-size: 13px;
}

.messages.messages-preparing .messages-content {
  opacity: 1;
}

.messages:not(.is-loading):not(.messages-preparing) .messages-content {
  opacity: 1;
}

.messages > .chat-meta {
  display: block;
  margin-top: 36px;
  color: var(--muted);
}

.load-more-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 34px;
  margin: 0 auto 22px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.load-more-row:disabled {
  cursor: default;
  opacity: 0.72;
}

.load-more-status {
  pointer-events: none;
}

.message {
  position: relative;
  max-width: 100%;
  margin: 0 0 24px;
  padding: 0 0 34px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.message.user {
  margin-left: 0;
  margin-bottom: 34px;
  padding: 14px 16px 42px;
  border-radius: 18px;
  background: var(--user-message-bg);
}

.message.system {
  padding: 12px 14px 40px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.message.command {
  padding: 12px 14px 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
}

.message.command.command-error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--line));
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}

.message-command-label {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 600;
}

.message-role {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 20px;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.message-agent-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.message-user-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
}

.message-user-avatar,
.message-user-initial {
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
}

.message-user-avatar {
  object-fit: cover;
  background: var(--surface-muted);
}

.message-user-initial {
  display: grid;
  place-items: center;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
}

.message-user-initial::before {
  content: attr(data-initial);
}

.message-role-logo,
.message-role-initial {
  width: 16px;
  min-width: 16px;
  height: 16px;
}

.message-role-logo {
  object-fit: contain;
}

.agent-logo-agy,
.chat-agent-logo-agy,
.composer-agent-logo-agy {
  filter: hue-rotate(38deg) saturate(1.15);
}

.composer-agent-logo-codex,
.chat-agent-logo-codex,
.agent-logo-codex,
.message-role-logo-codex {
  filter: var(--codex-logo-filter);
}

.message-role-initial {
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 9px;
  font-weight: 700;
}

.message-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 24px;
  margin-bottom: 8px;
}

.message-actions {
  position: absolute;
  right: 2px;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.message-footer {
  position: absolute;
  right: 2px;
  bottom: 0;
  left: 2px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  pointer-events: none;
}

.message-footer-meta {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.35;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.message-footer .message-role {
  min-height: 0;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
}

.message-footer .message-agent-label,
.message-footer .message-user-label {
  max-width: min(34vw, 180px);
  overflow: hidden;
  white-space: nowrap;
}

.message-footer .message-agent-label > span:last-child,
.message-footer .message-user-label > span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-footer .message-user-avatar,
.message-footer .message-user-initial {
  width: 16px;
  min-width: 16px;
  height: 16px;
}

.message-footer .message-role-logo,
.message-footer .message-role-initial {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.message.user .message-actions,
.message.system .message-actions {
  right: auto;
  bottom: auto;
}

.message.user .message-footer,
.message.system .message-footer {
  right: 12px;
  bottom: 8px;
  left: 12px;
}

.message-footer .message-actions {
  position: static;
  flex: 0 0 auto;
  pointer-events: auto;
}

.message-copy-button,
.message-edit-button,
.message-menu-button {
  display: grid;
  place-items: center;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  opacity: 1;
}

.copy-icon {
  width: 18px;
  height: 18px;
}

.message-menu-button .menu-icon {
  width: 18px;
  height: 18px;
}

.message-copy-button:hover,
.message-copy-button.copied,
.message-edit-button:hover,
.message-menu-button:hover {
  opacity: 1;
}

.message-copy-button:hover,
.message-edit-button:hover,
.message-menu-button:hover {
  background: var(--surface-soft);
  border-color: var(--line);
  color: var(--text);
}

.message-copy-button.copied {
  color: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  .message-copy-button,
  .message-edit-button {
    opacity: 0;
    transition: opacity 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  }

  .message:hover .message-copy-button,
  .message:focus-within .message-copy-button,
  .message-copy-button.copied,
  .message:hover .message-edit-button,
  .message:focus-within .message-edit-button {
    opacity: 1;
  }
}

.edit-icon {
  width: 17px;
  height: 17px;
}

.message-timestamp {
  position: static;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 11px;
  line-height: 1.35;
  pointer-events: none;
}

.message:hover .message-footer-meta,
.message:focus-within .message-footer-meta,
.message.message-footer-hold .message-footer-meta {
  opacity: 1;
}

@media (hover: none), (pointer: coarse) {
  .message-footer-meta {
    opacity: 0;
  }
}

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

.message-edit-textarea {
  display: block;
  width: 100%;
  min-height: 92px;
  max-height: 50vh;
  padding: 12px 13px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  resize: none;
}

.message-edit-textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--line-strong));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

.message-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.message-edit-cancel,
.message-edit-save {
  min-height: 36px;
  border-radius: 999px;
}

.message-edit-cancel {
  border-color: transparent;
  background: transparent;
  color: var(--muted-strong);
}

.message-edit-save {
  border-color: var(--text);
  background: var(--text);
  color: var(--text-inverse);
}

.message-text {
  margin: 0;
  white-space: normal;
  word-break: break-word;
  font-size: 16px;
  line-height: 1.58;
}

.message-text > :first-child {
  margin-top: 0;
}

.message-text > :last-child {
  margin-bottom: 0;
}

.message-text p,
.message-text ul,
.message-text ol,
.message-text blockquote,
.message-text hr,
.message-table-scroll,
.message-text pre {
  margin: 0 0 18px;
}

.message-text h1,
.message-text h2,
.message-text h3,
.message-text h4,
.message-text h5,
.message-text h6 {
  margin: 24px 0 14px;
  color: var(--text);
  font-size: 1.06em;
  font-weight: 700;
  line-height: 1.35;
}

.message-text hr {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
}

.message-text ul,
.message-text ol {
  padding-left: 24px;
}

.message-text li + li {
  margin-top: 5px;
}

.message-task-checkbox {
  display: inline-grid;
  place-items: center;
  width: 1em;
  height: 1em;
  margin-right: 0.45em;
  border: 1px solid var(--muted);
  border-radius: 4px;
  color: var(--accent);
  font-size: 0.8em;
  line-height: 1;
  vertical-align: -0.12em;
}

.message-table-scroll {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.message-table-scroll table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.message-table-scroll th,
.message-table-scroll td {
  min-width: min(9rem, 54vw);
  max-width: min(32rem, 82vw);
  padding: 7px 9px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.message-table-scroll th {
  background: var(--surface-soft);
  font-weight: 700;
}

.message-text a:not(.message-image-link):not(.message-artifact-file) {
  display: inline;
  margin: 0 1px;
  padding: 0 5px 1px;
  border-radius: 7px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  color: color-mix(in srgb, var(--text) 88%, var(--muted-strong));
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: normal;
  white-space: normal;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.message-text a:not(.message-image-link):not(.message-artifact-file)::after {
  content: "";
  display: inline-block;
  width: 0.78em;
  height: 0.78em;
  margin-left: 0.24em;
  background: currentColor;
  opacity: 0.58;
  vertical-align: -0.08em;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7'/%3E%3Cpath d='M9 7h8v8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.message-text a:not(.message-image-link):not(.message-artifact-file):hover {
  background: color-mix(in srgb, var(--surface-muted) 88%, var(--text) 4%);
  color: var(--text);
  text-decoration: none;
}

.message-text code {
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

.message-text pre {
  overflow: auto;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.message-code-block {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  max-height: min(65vh, 560px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-surface, var(--surface-soft));
}

.message-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--code-surface, var(--surface-soft)) 82%, var(--surface));
}

.message-code-lang {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.message-code-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.message-code-copy,
.message-code-wrap-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.message-code-copy svg,
.message-code-wrap-toggle svg {
  display: block;
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.message-code-copy:hover,
.message-code-wrap-toggle:hover {
  background: color-mix(in srgb, var(--surface-soft) 80%, var(--text) 4%);
}

.message-code-copy.is-copied,
.message-code-wrap-toggle[aria-pressed='true'] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.message-code-block .message-code-pre {
  margin: 0;
  padding: 12px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
}

.message-code-block .message-code-content {
  display: block;
  overflow: visible;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre;
}

.message-code-block.is-wrapped .message-code-pre {
  overflow-x: hidden;
}

.message-code-block.is-wrapped .message-code-content {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

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

.message-text .hljs-comment,
.message-text .hljs-quote {
  color: var(--code-comment);
}

.message-text .hljs-keyword,
.message-text .hljs-selector-tag,
.message-text .hljs-literal,
.message-text .hljs-section,
.message-text .hljs-link {
  color: var(--code-keyword);
}

.message-text .hljs-string,
.message-text .hljs-title,
.message-text .hljs-name,
.message-text .hljs-type,
.message-text .hljs-attribute,
.message-text .hljs-symbol,
.message-text .hljs-bullet,
.message-text .hljs-addition,
.message-text .hljs-template-tag,
.message-text .hljs-template-variable {
  color: var(--code-string);
}

.message-text .hljs-number,
.message-text .hljs-regexp,
.message-text .hljs-variable,
.message-text .hljs-template-variable,
.message-text .hljs-attr {
  color: var(--code-number);
}

.message-text .hljs-built_in,
.message-text .hljs-builtin-name,
.message-text .hljs-class .hljs-title {
  color: var(--code-function);
}

.message-text .hljs-meta,
.message-text .hljs-deletion {
  color: var(--code-meta);
}

.message-text pre code {
  padding: 0;
  background: transparent;
  white-space: pre;
}

.message-text blockquote {
  padding-left: 13px;
  border-left: 3px solid var(--line-strong);
  color: var(--muted-strong);
}

.message-image-link {
  position: relative;
  display: block;
  width: min(100%, 520px);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 10px 0 14px;
  border-radius: 14px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  text-decoration: none;
}

.message-image-link::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 48%, transparent), transparent),
    color-mix(in srgb, var(--surface-soft) 90%, transparent);
  background-size: 220% 100%, 100% 100%;
  animation: message-image-skeleton 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 160ms ease;
}

.message-image-link.message-image-loaded::before,
.message-image-link.message-image-error::before {
  opacity: 0;
  animation: none;
}

.message-image-link img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 160ms ease;
}

.message-image-link.message-image-loaded img {
  opacity: 1;
}

.message-image-link.message-image-error {
  display: grid;
  place-items: center;
  min-height: 180px;
  color: var(--muted);
}

.message-image-link.message-image-error::after {
  content: 'Не удалось загрузить изображение';
  position: relative;
  z-index: 1;
  padding: 12px;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

@keyframes message-image-skeleton {
  from {
    background-position: 160% 0, 0 0;
  }

  to {
    background-position: -60% 0, 0 0;
  }
}

.message-image-link img.message-artifact-svg {
  width: 100%;
  min-height: 0;
  background: transparent;
}

.message-artifact-inline-link {
  display: inline;
  padding: 1px 4px 2px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-muted) 72%, transparent);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.message-artifact-inline-link:hover {
  background: var(--surface-muted);
  text-decoration: none;
}

.message-artifacts {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.message-artifacts-has-image-grid {
  gap: 10px;
}

.message-artifact-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
  width: min(100%, 520px);
}

.message-artifact-image-grid .message-artifact-image {
  min-width: 0;
  width: auto;
  max-width: none;
  margin: 0;
}

.message-artifact-image-grid .message-image-link {
  width: 100%;
  margin: 0;
  border-radius: 12px;
  aspect-ratio: 1 / 1;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.message-artifact-image-grid .message-image-link img {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.message-artifact-image-grid .message-image-link img.message-artifact-svg {
  min-height: 0;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  object-fit: contain;
}

.message-artifact {
  position: relative;
  margin: 0;
}

.message-artifact-image {
  width: min(100%, 520px);
  max-width: 100%;
  margin: 10px 0 14px;
}

.message-artifact-image .message-image-link {
  margin: 0;
}

.message-artifact figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.message-artifact-html {
  position: relative;
  display: grid;
  gap: 9px;
}

.message-artifact-file-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  max-width: 100%;
}

.message-artifact-html iframe {
  display: block;
  width: min(640px, 100%);
  min-height: 240px;
  height: min(52vh, 420px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.message-artifact-html a,
.message-artifact-file {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
  text-decoration: none;
}

.message-artifact-html a:hover,
.message-artifact-file:hover {
  background: var(--surface-muted);
  text-decoration: none;
}

.message-artifact-menu-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.message-artifact-image .message-artifact-menu-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}

.message-artifact-menu-button .menu-icon {
  width: 15px;
  height: 15px;
  display: block;
  pointer-events: none;
}

.message-artifact-menu-button:hover,
.message-artifact-menu-button:focus-visible {
  background: transparent;
  color: var(--text);
  outline: none;
}

.message-artifact-image .message-artifact-menu-button:hover,
.message-artifact-image .message-artifact-menu-button:focus-visible {
  color: #fff;
}

.message-thinking-block {
  margin: 0 0 10px;
  border: 1px solid color-mix(in srgb, var(--line) 54%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 22%, transparent);
  overflow: hidden;
}

.continuation-actions {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  max-width: 620px;
}

.continuation-actions-heading {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.continuation-actions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.continuation-action-button {
  display: grid;
  min-height: 76px;
  align-content: start;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 88%, var(--accent-soft) 12%);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.continuation-action-button:hover,
.continuation-action-button:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.continuation-action-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.continuation-action-title {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.continuation-action-description {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
}

.message-thinking-summary {
  cursor: pointer;
  padding: 8px 12px;
  color: var(--muted-strong);
  font-size: 13px;
  list-style: none;
  user-select: none;
}

.message-thinking-summary::-webkit-details-marker {
  display: none;
}

.message-thinking-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.15s ease;
}

.message-thinking-block[open] .message-thinking-summary::before {
  transform: rotate(90deg);
}

.message-thinking-body {
  padding: 0 12px 10px;
  color: var(--muted-strong);
  font-size: 13px;
}

.message-thinking-pre {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  font-size: 12px;
  line-height: 1.45;
}

.thinking-message {
  padding: 0 0 34px 14px;
  color: var(--muted-strong);
}

.thinking-message .message-header {
  margin-bottom: 6px;
}

.thinking-text {
  display: block;
  min-height: 30px;
  max-width: min(100%, 560px);
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--surface-soft);
  font-size: 14px;
}

.thinking-message.live-response-message .thinking-text {
  max-width: min(100%, 640px);
  color: var(--text);
}

.live-response-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.5;
}

.thinking-status-lines {
  display: grid;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}

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

.thinking-text-row-extra {
  grid-template-columns: minmax(0, 1fr);
  padding-left: 33px;
}

.thinking-status-line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.35;
}

.thinking-text-live .thinking-status-line-current {
  mask-image: linear-gradient(90deg, #000 calc(100% - 1.25rem), transparent);
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 1.25rem), transparent);
}

.thinking-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.35;
  animation: thinkingPulse 1.1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes thinkingPulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }

  40% {
    opacity: 0.9;
    transform: translateY(-2px);
  }
}

.new-messages-button {
  position: fixed;
  right: calc(var(--right-width) + 24px);
  bottom: calc(var(--composer-height) + 42px);
  z-index: 21;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(24px) saturate(1.16);
  backdrop-filter: blur(24px) saturate(1.16);
}

.new-messages-button[hidden] {
  display: none;
}

.message-form {
  position: fixed;
  left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width) - var(--right-width) - min(870px, calc(100vw - var(--sidebar-width) - var(--right-width) - 28px))) / 2);
  right: calc(var(--right-width) + (100vw - var(--sidebar-width) - var(--right-width) - min(870px, calc(100vw - var(--sidebar-width) - var(--right-width) - 28px))) / 2);
  bottom: 18px;
  z-index: 24;
  display: block;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  overflow: visible;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--text) 6%, transparent) inset,
    0 4px 8px color-mix(in srgb, #000 10%, transparent);
  -webkit-backdrop-filter: blur(40px) saturate(1.26);
  backdrop-filter: blur(40px) saturate(1.26);
}

.message-form.composer-multiline {
  border-radius: 34px;
}

.message-form textarea {
  display: block;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  max-height: 70dvh;
  margin: 0;
  padding: 8px 4px;
  overflow: hidden;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}

.composer-attachments {
  position: absolute;
  right: 0;
  bottom: calc(100% + var(--composer-attachments-bottom-offset, 10px));
  left: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  max-height: min(34dvh, 220px);
  margin: 0;
  padding: 0 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  pointer-events: auto;
}

.composer-attachments[hidden] {
  display: none;
}

.composer-attachment-chip {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 22px;
  gap: 8px;
  align-items: center;
  width: min(260px, 100%);
  min-height: 52px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 52%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
}

.composer-attachment-chip.uploading {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.composer-attachment-chip.uploading::after {
  position: absolute;
  inset: auto 8px 5px 8px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  content: '';
  animation: composer-upload-pulse 1s ease-in-out infinite;
}

.composer-attachment-chip.uploading .composer-attachment-remove {
  opacity: 0.45;
  cursor: wait;
}

@keyframes composer-upload-pulse {
  0% {
    transform: translateX(-24%);
    opacity: 0.35;
  }

  50% {
    transform: translateX(24%);
    opacity: 1;
  }

  100% {
    transform: translateX(-24%);
    opacity: 0.35;
  }
}

.composer-attachment-preview {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-muted) 88%, transparent);
}

.composer-attachment-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-attachment-preview svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
  color: var(--muted-strong);
}

.composer-attachment-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.composer-attachment-name,
.composer-attachment-size {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment-name {
  color: var(--text);
  font-size: 13px;
}

.composer-attachment-size {
  color: var(--muted);
  font-size: 11px;
}

.composer-attachment-remove {
  position: static;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--muted-strong);
  line-height: 0;
  appearance: none;
  -webkit-appearance: none;
}

.composer-attachment-remove svg {
  display: block;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.composer-attachment-remove:hover {
  background: color-mix(in srgb, var(--surface-muted) 92%, transparent);
  color: var(--text);
}

button.composer-attachment-remove:hover {
  background: color-mix(in srgb, var(--surface-muted) 92%, transparent);
}

.composer-attachments[hidden] {
  display: none;
}

.composer-slash-hints {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
}

.composer-slash-hints[hidden] {
  display: none;
}

.composer-speech-progress {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 5;
  display: grid;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 12px 9px;
  border: 0;
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 94%, #000 6%);
  color: var(--muted-strong);
  box-shadow:
    0 1px 0 color-mix(in srgb, #fff 8%, transparent) inset,
    0 8px 18px color-mix(in srgb, #000 18%, transparent);
  pointer-events: none;
}

.composer-speech-progress[hidden] {
  display: none;
}

.composer-speech-progress-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.composer-speech-progress-track {
  position: relative;
  display: block;
  width: 100%;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, transparent);
}

.composer-speech-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 38%;
  border-radius: inherit;
  background: color-mix(in srgb, var(--text) 72%, var(--surface));
  animation: composer-speech-progress 1.05s ease-in-out infinite;
}

@keyframes composer-speech-progress {
  0% {
    transform: translateX(-110%);
  }

  50% {
    transform: translateX(105%);
  }

  100% {
    transform: translateX(270%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .composer-speech-progress-fill {
    animation: none;
    width: 100%;
    opacity: 0.55;
  }
}

.composer-slash-hint {
  display: block;
  width: 100%;
  margin: 0;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.composer-slash-hint strong {
  color: var(--text);
  font-weight: 600;
}

.composer-slash-hint.is-selected {
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--text);
}

@media (hover: none), (pointer: coarse) {
  .composer-slash-hint:hover {
    background: transparent;
    color: var(--muted-strong);
  }

  .composer-slash-hint.is-selected {
    background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
    color: var(--text);
  }
}

.message-form textarea:focus {
  outline: 0;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}

select:focus,
button:focus-visible {
  outline: 0;
}

.composer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 50px;
}

.composer-icon-button,
.composer-send-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  line-height: 1;
}

.composer-icon-button {
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0;
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.composer-toggle-icon {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.composer-toggle-icon-close {
  width: 20px;
  height: 20px;
}

.composer-speech-button svg {
  display: block;
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.composer-speech-button.is-recording {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--line));
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-soft));
  color: var(--danger);
}

.composer-speech-button.is-transcribing {
  color: var(--accent);
}

.composer-speech-button:disabled {
  cursor: default;
  opacity: 0.48;
}

.composer-speech-button {
  margin-left: 0;
}

.composer-speech-button + .composer-send-button {
  margin-left: 0;
}

.composer-icon-button.active .composer-toggle-icon-plus {
  display: none;
}

.composer-icon-button.active .composer-toggle-icon-close {
  display: block;
}

.composer-icon-button.active .composer-toggle-icon-close[hidden] {
  display: block;
}

.composer-icon-button:not(.active) .composer-toggle-icon-close {
  display: none;
}

.composer-icon-button.active {
  background: color-mix(in srgb, var(--surface-soft) 98%, transparent);
}

.composer-selector-group {
  display: inline-flex;
  align-items: stretch;
  flex: 0 0 auto;
  width: max-content;
  min-width: max-content;
  max-width: min(520px, 100%);
  min-height: 44px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 94%, transparent);
  opacity: 1;
  pointer-events: auto;
  transition:
    opacity 150ms ease,
    background-color 150ms ease;
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
  backdrop-filter: blur(16px) saturate(1.12);
}

.message-form:hover .composer-selector-group,
.message-form:focus-within .composer-selector-group,
.composer-selector-group:has(.active) {
  background: color-mix(in srgb, var(--surface-soft) 94%, transparent);
  opacity: 1;
  pointer-events: auto;
}

.message-form.composer-multiline .composer-controls {
  display: grid;
  grid-template-columns: 46px minmax(300px, 1fr) 46px 46px;
  grid-template-areas:
    "input input input input"
    "attach selector speech send";
  align-items: end;
  gap: 8px 10px;
  min-height: 0;
}

.message-form.composer-multiline #messageInput {
  grid-area: input;
  width: 100%;
}

.message-form.composer-multiline #composerMenuButton {
  grid-area: attach;
}

.message-form.composer-multiline .composer-selector-group {
  grid-area: selector;
  justify-self: end;
  width: max-content;
  min-width: max-content;
  opacity: 1;
  pointer-events: auto;
}

.message-form.composer-multiline #speechRecordButton {
  grid-area: speech;
  margin-left: 0;
}

.message-form.composer-multiline #sendButton {
  grid-area: send;
}

.composer-agent-pill,
.composer-mode-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: 0 15px;
  gap: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  white-space: nowrap;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.composer-selector-group > .composer-agent-pill {
  flex: 0 0 auto;
  border-right: 1px solid color-mix(in srgb, var(--line) 34%, transparent);
}

.composer-selector-group > .composer-mode-pill {
  flex: 0 0 auto;
  min-width: max-content;
}

.composer-agent-pill[hidden] {
  display: none;
}

.composer-selector-group > .composer-agent-pill:hover,
.composer-selector-group > .composer-agent-pill.active,
.composer-selector-group > .composer-mode-pill:hover,
.composer-selector-group > .composer-mode-pill.active {
  background: color-mix(in srgb, var(--surface-soft) 98%, transparent);
}

#agentMenuButtonLabel,
#modeMenuModelLabel,
#modeMenuModeLabel {
  overflow: visible;
  text-overflow: clip;
  font-size: 13px;
}

#agentMenuButtonLabel {
  flex: 0 0 auto;
  min-width: max-content;
}

.composer-agent-logo-wrap {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  margin-left: -2px;
}

.composer-agent-logo,
.composer-agent-logo-initial {
  width: 22px;
  height: 22px;
}

.composer-agent-logo {
  object-fit: contain;
}

.composer-agent-logo-initial {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
}

#modeMenuModeLabel {
  flex: 0 0 auto;
  min-width: max-content;
  color: var(--muted);
}

#modeMenuModelLabel {
  flex: 0 0 auto;
  min-width: max-content;
  color: var(--text);
}

.composer-mode-pill.mode-only #modeMenuModelLabel,
.composer-mode-pill.mode-only #modeMenuModeLabel {
  flex: 0 1 auto;
}

.composer-mode-pill.mode-only #modeMenuModeLabel {
  color: var(--muted);
}

.composer-chevron {
  width: 8px;
  height: 8px;
  margin: -3px 4px 0 1px;
  border-right: 2px solid var(--muted-strong);
  border-bottom: 2px solid var(--muted-strong);
  transform: rotate(45deg);
}

.composer-send-button {
  margin-left: auto;
  background: var(--button-contrast-bg);
  color: var(--button-contrast-text);
  box-shadow: none;
}

.composer-send-button svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
}

.composer-send-button .stop-icon {
  display: none;
}

.composer-send-button.is-running .send-icon {
  display: none;
}

.composer-send-button.is-running .stop-icon {
  display: block;
}

.composer-send-button.is-running {
  background: var(--button-contrast-bg);
  color: var(--button-contrast-text);
}

.composer-send-button:hover {
  background: color-mix(in srgb, var(--button-contrast-bg) 92%, var(--surface));
  color: var(--button-contrast-text);
}

.composer-popover {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  z-index: 60;
  --composer-menu-exit-y: 28px;
  width: min(490px, calc(100vw - 34px));
  max-height: min(68vh, 620px);
  padding: 14px;
  overflow: auto;
  border: 1px solid color-mix(in srgb, var(--line-strong) 78%, transparent);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
  touch-action: none;
  transition:
    transform 190ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 160ms ease;
  will-change: transform, opacity;
  -webkit-backdrop-filter: blur(38px) saturate(1.24);
  backdrop-filter: blur(38px) saturate(1.24);
}

.composer-popover[hidden] {
  display: none;
}

.composer-popover[data-menu-closing='true'] {
  pointer-events: none;
}

.composer-popover[data-menu-motion='vertical-in'] {
  animation: composer-menu-slide-up 190ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.composer-popover[data-menu-motion='vertical-out'] {
  animation: composer-menu-slide-down 170ms ease-in both;
}

.composer-popover[data-menu-motion='horizontal-in'] {
  animation: composer-menu-slide-side-in 190ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.composer-popover[data-menu-motion='drag'] {
  transition: none;
}

@keyframes composer-menu-slide-up {
  from {
    opacity: 0.82;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes composer-menu-slide-down {
  from {
    transform: translateY(var(--composer-menu-drag-y, 0));
  }

  to {
    transform: translateY(var(--composer-menu-exit-y, 28px));
  }
}

@keyframes composer-menu-slide-side-in {
  from {
    opacity: 0.92;
    transform: translateX(26px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.composer-mode-menu {
  width: min(420px, calc(100vw - 34px));
}

.composer-agent-menu {
  width: min(360px, calc(100vw - 34px));
}

.menu-title {
  padding: 6px 14px 8px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.3;
}

.menu-row,
.mode-menu-row,
.model-menu-row,
.agent-menu-row {
  width: 100%;
  min-height: 49px;
  padding: 0 12px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  text-align: left;
}

.menu-row[hidden],
.menu-title[hidden],
.menu-separator[hidden],
.mode-menu-row[hidden],
.model-menu-row[hidden],
.agent-menu-row[hidden] {
  display: none !important;
}

.menu-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
  text-decoration: none;
}

.composer-agent-menu-shortcut,
.composer-mode-menu-shortcut {
  display: none;
}

.mode-menu-row,
.model-menu-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  align-items: center;
}

.agent-menu-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto 26px;
  align-items: center;
}

.menu-row:hover,
.mode-menu-row:hover,
.model-menu-row:hover,
.agent-menu-row:hover,
.mode-menu-row.selected,
.model-menu-row.selected,
.agent-menu-row.selected {
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.menu-icon {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 24px;
  height: 24px;
  color: var(--text);
}

.menu-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-chevron,
.menu-check {
  color: var(--text);
  font-size: 23px;
  line-height: 1;
}

.menu-check {
  visibility: hidden;
  justify-self: end;
}

.mode-menu-row.selected .menu-check,
.model-menu-row.selected .menu-check,
.agent-menu-row.selected .menu-check {
  visibility: visible;
}

.menu-separator {
  height: 1px;
  margin: 8px 8px;
  background: var(--line);
}

.composer-menu-back {
  display: none;
}

.agent-menu-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-meta {
  color: var(--muted);
  font-size: 13px;
}

.agent-menu-row:disabled {
  opacity: 0.5;
}

.agent-menu-row:disabled:hover {
  background: transparent;
}

.agent-logo,
.agent-initial,
.agent-logo-initial {
  justify-self: center;
  width: 22px;
  height: 22px;
}

.agent-logo {
  object-fit: contain;
}

.agent-initial,
.agent-logo-initial {
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: 10px;
  font-weight: 700;
}

.file-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 4px;
}

.project-sources-panel {
  display: grid;
  gap: 10px;
  min-height: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
}

.project-sources-panel[hidden] {
  display: none;
}

.project-sources-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.project-sources-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-sources-head h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-sources-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.project-source-action,
.project-add-source-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  color: var(--text);
  font-size: 12px;
}

.project-source-action:hover,
.project-add-source-button:hover,
.project-source-action:focus-visible,
.project-add-source-button:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  outline: none;
}

.project-source-action-danger {
  color: var(--danger);
}

.project-add-source-button {
  justify-self: start;
}

.project-source-list {
  display: grid;
  gap: 4px;
  max-height: min(32vh, 260px);
  overflow: auto;
  overscroll-behavior: contain;
}

.project-source-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 44%, transparent);
}

.project-source-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.project-source-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.project-source-name,
.project-source-detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-source-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.project-source-detail,
.project-source-empty {
  color: var(--muted);
  font-size: 11px;
}

.project-source-empty {
  padding: 4px 2px;
}

.project-source-menu-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
}

.project-source-menu-button:hover,
.project-source-menu-button:focus-visible {
  background: color-mix(in srgb, var(--surface-muted) 74%, transparent);
  color: var(--text);
}

.project-source-menu-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: currentColor;
}

.files-panel .file-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.files-panel .file-list .file-row {
  padding: 0;
  margin: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.files-panel .file-list .file-row:hover {
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  border-color: color-mix(in srgb, var(--line) 88%, transparent);
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0;
  align-items: stretch;
  min-height: 44px;
  text-decoration: none;
}

.file-row.file,
.file-row.external {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.file-row-open {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px 7px 10px;
  border: 0;
  border-radius: 11px 0 0 11px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.file-row-open-with-bullet {
  grid-template-columns: 10px 32px minmax(0, 1fr);
  gap: 8px;
}

.file-row-open-with-meta {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 8px 10px;
}

.file-row-open-with-meta,
.file-row-open-full {
  border-radius: 11px;
}

.file-row-open:hover {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
}

.file-row-open:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: -2px;
  z-index: 1;
}

.file-row-select {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  flex-shrink: 0;
  width: var(--file-meta-width);
  min-width: var(--file-meta-width);
  padding: 7px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.file-row-menu-button {
  display: grid;
  place-items: center;
  align-self: stretch;
  flex-shrink: 0;
  width: 34px;
  min-width: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0 11px 11px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.file-row-menu-button .menu-icon {
  width: 16px;
  height: 16px;
}

.file-row-menu-button:hover,
.file-row-menu-button:focus-visible {
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  color: var(--text);
  outline: none;
}

.file-row-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  flex-shrink: 0;
  width: var(--file-meta-width);
  min-width: var(--file-meta-width);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-row-select:hover,
.file-row-select:focus-visible {
  background: color-mix(in srgb, var(--accent-soft) 28%, transparent);
  outline: none;
}

.file-row-select:focus-visible .file-meta {
  color: var(--muted-strong);
}

.file-row.directory,
.file-row.file-row-notice {
  grid-template-columns: minmax(0, 1fr) auto;
  cursor: default;
}

.file-row.file-row-notice {
  grid-template-columns: minmax(0, 1fr);
  color: var(--muted);
}

.files-panel .file-list .file-row-active {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-soft) 52%, transparent),
    color-mix(in srgb, var(--accent-soft) 34%, transparent)
  );
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent),
    0 1px 0 color-mix(in srgb, var(--surface) 80%, transparent);
}

.files-panel .file-list .file-row-active:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--accent-soft) 58%, transparent),
    color-mix(in srgb, var(--accent-soft) 40%, transparent)
  );
}

.files-panel .file-list .file-row-active .file-row-open:hover {
  background: color-mix(in srgb, var(--surface) 24%, transparent);
}

.files-panel .file-list .file-row-active .file-row-select {
  border-left-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.file-row-active .file-name {
  color: var(--text);
  font-weight: 600;
}

.file-active-bullet {
  width: 7px;
  height: 7px;
  margin: 0;
  border-radius: 999px;
  justify-self: center;
  align-self: center;
  flex-shrink: 0;
}

.file-active-bullet.is-active {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-soft) 72%, transparent);
}

.file-active-bullet.is-inactive {
  background: color-mix(in srgb, var(--muted) 38%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line) 88%, transparent);
}

.file-active-bullet.is-placeholder {
  visibility: hidden;
}

.file-row.directory {
  color: var(--muted);
  pointer-events: none;
}

.files-panel .file-list .file-name {
  overflow: hidden;
  color: color-mix(in srgb, var(--text) 92%, var(--muted));
  font-size: 13px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.files-panel .file-list .file-meta {
  padding: 0;
  margin: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.files-panel .file-list .file-thumb {
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 9px;
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}

.files-panel .file-list .file-row-active .file-thumb {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent),
    0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}

.file-thumb {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  color: var(--muted-strong);
}

.file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-thumb svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.file-thumb-image {
  background: var(--surface);
}

.file-row-pending {
  color: var(--muted-strong);
  padding: 7px 10px;
  border: 1px dashed color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 55%, transparent);
}

.file-input-native {
  position: fixed;
  top: 0;
  left: -100vw;
  width: 1px;
  height: 1px;
  opacity: 0;
}

body.drag-over::after {
  position: fixed;
  inset: 14px;
  z-index: 90;
  display: grid;
  place-items: center;
  border: 2px dashed var(--line-strong);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-card);
  font-size: 20px;
  font-weight: 650;
  content: 'Отпусти файлы, чтобы добавить их в чат';
  pointer-events: none;
  backdrop-filter: blur(18px);
}

.preview {
  overflow: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.preview p {
  margin: 14px 0 0;
  color: var(--muted);
}

.preview pre {
  margin: 14px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
}

.preview img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin-top: 14px;
  border-radius: 12px;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.pixel-cat-widget {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  justify-items: center;
  min-height: 252px;
  margin-top: auto;
  padding: 28px 0 6px;
  border-top: 1px solid var(--line);
  isolation: isolate;
}

.pixel-cat-button {
  --cat-pointer-x: 0;
  --cat-pointer-y: 0;
  --cat-head-x: 0px;
  --cat-head-y: 0px;
  --cat-head-rotate: 0deg;
  --cat-muzzle-x: 0px;
  --cat-muzzle-y: 0px;
  --cat-left-paw-x: 0px;
  --cat-left-paw-y: 0px;
  --cat-left-paw-rotate: 0deg;
  --cat-right-paw-x: 0px;
  --cat-right-paw-y: 0px;
  --cat-right-paw-rotate: 0deg;
  display: grid;
  place-items: center;
  width: 236px;
  height: 206px;
  min-height: 206px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  box-shadow: none;
  touch-action: manipulation;
}

.pixel-cat-button:hover,
.pixel-cat-button:active {
  background: transparent;
  box-shadow: none;
}

.pixel-cat-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 6px;
}

.pixel-cat-sprite {
  width: 190px;
  height: 140px;
  overflow: visible;
  transform-box: fill-box;
  transform-origin: 50% 64%;
  transform-style: preserve-3d;
  animation: cat-idle 4200ms ease-in-out infinite;
  backface-visibility: visible;
  filter: drop-shadow(0 14px 9px rgb(0 0 0 / 0.14));
  image-rendering: pixelated;
  shape-rendering: crispEdges;
  will-change: transform;
}

.pixel-cat-pixel {
  vector-effect: non-scaling-stroke;
}

.pixel-cat-tiny-pixel {
  transform-box: fill-box;
  transform-origin: 50% 50%;
}

.pixel-cat-outline {
  fill: #6f3515;
}

.pixel-cat-fur {
  fill: #d86f22;
}

.pixel-cat-fur-light {
  fill: #f0a04a;
}

.pixel-cat-belly {
  fill: #c75a1a;
}

.pixel-cat-tail-fur,
.pixel-cat-leg {
  fill: #be5118;
}

.pixel-cat-floor-shadow {
  fill: rgb(0 0 0 / 0.12);
}

.pixel-cat-paw {
  fill: #f2b361;
}

.pixel-cat-ear,
.pixel-cat-cheek,
.pixel-cat-muzzle {
  fill: #ffc27a;
}

.pixel-cat-eye,
.pixel-cat-nose {
  fill: #030303;
}

.pixel-cat-mouth-block {
  fill: #030303;
}

.pixel-cat-blue-stripe {
  fill: #7b3a19;
}

.pixel-cat-eye-shine {
  fill: #f5f5f5;
}

.pixel-cat-cheek-pixel {
  fill: #f29b8d;
}

.pixel-cat-whisker-pixel {
  fill: #8d4b24;
}

.pixel-cat-toe-pixel {
  fill: #e4e4e4;
}

.pixel-cat-mouth,
.pixel-cat-whisker,
.pixel-cat-stripe,
.pixel-cat-leg-stripe,
.pixel-cat-side-stripe,
.pixel-cat-forehead-stripe,
.pixel-cat-tail-stripe {
  fill: none;
  stroke: #333739;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pixel-cat-whisker,
.pixel-cat-mouth {
  stroke-width: 2.2;
}

.pixel-cat-tail {
  transform-box: fill-box;
  transform-origin: 86% 78%;
}

.pixel-cat-head,
.pixel-cat-body,
.pixel-cat-legs,
.pixel-cat-stripes,
.pixel-cat-muzzle,
.pixel-cat-paw,
.pixel-cat-eye,
.pixel-cat-eye-shine,
.pixel-cat-blue-stripe,
.pixel-cat-cheek-pixel,
.pixel-cat-whisker-pixel {
  transform-box: fill-box;
  transform-origin: 50% 70%;
}

.pixel-cat-head,
.pixel-cat-muzzle,
.pixel-cat-front-paw {
  transition: transform 180ms ease;
}

.pixel-cat-button:hover .pixel-cat-head {
  transform: translate(var(--cat-head-x), var(--cat-head-y)) rotate(var(--cat-head-rotate));
}

.pixel-cat-button:hover .pixel-cat-muzzle {
  transform: translate(var(--cat-muzzle-x), var(--cat-muzzle-y)) scaleX(1.16);
}

.pixel-cat-button:hover .pixel-cat-left-paw {
  transform: translate(var(--cat-left-paw-x), var(--cat-left-paw-y)) rotate(var(--cat-left-paw-rotate));
}

.pixel-cat-button:hover .pixel-cat-right-paw {
  transform: translate(var(--cat-right-paw-x), var(--cat-right-paw-y)) rotate(var(--cat-right-paw-rotate));
}

.pixel-cat-button:hover .pixel-cat-whisker-pixel {
  transform: translate(var(--cat-muzzle-x), var(--cat-muzzle-y));
}

.pixel-cat-button:hover .pixel-cat-cheek-pixel {
  transform: translate(var(--cat-muzzle-x), var(--cat-muzzle-y)) scale(1.25);
}

.pixel-cat-bubble {
  position: absolute;
  right: 50%;
  bottom: 206px;
  z-index: 1;
  min-width: 44px;
  max-width: 168px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--text);
  box-shadow: var(--shadow-card);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  transform: translateX(50%);
  pointer-events: none;
}

.pixel-cat-bubble::after {
  position: absolute;
  right: 28px;
  bottom: -5px;
  width: 9px;
  height: 9px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: inherit;
  transform: rotate(45deg);
  content: '';
}

.pixel-cat-bubble.is-visible {
  animation: cat-bubble 2600ms ease both;
}

.cat-action-tail .pixel-cat-tail {
  animation: cat-tail-wag 1050ms ease-in-out;
}

.cat-action-blink .pixel-cat-eye {
  animation: cat-pixel-blink 620ms steps(1, end);
}

.cat-action-blink .pixel-cat-eye-shine {
  animation: cat-pixel-hide 620ms steps(1, end);
}

.cat-action-hop .pixel-cat-sprite {
  animation: cat-hop 900ms steps(8, end);
}

.cat-action-hop .pixel-cat-legs,
.cat-action-hop .pixel-cat-tail {
  animation: cat-pixel-paws-hop 900ms steps(4, end);
}

.cat-action-stretch .pixel-cat-sprite {
  animation: cat-stretch 1150ms steps(7, end);
}

.cat-action-stretch .pixel-cat-head {
  animation: cat-pixel-stretch-head 1150ms steps(5, end);
}

.cat-action-oiia-spin .pixel-cat-sprite {
  transform-origin: 51% 54%;
  animation: cat-oiia-spin 560ms steps(10, end) infinite;
  filter: drop-shadow(0 14px 9px rgb(0 0 0 / 0.16));
}

.cat-action-wiggle .pixel-cat-sprite {
  animation: cat-wiggle 1250ms steps(9, end);
}

.cat-action-wiggle .pixel-cat-tiny-pixel,
.cat-action-wiggle .pixel-cat-blue-stripe {
  animation: cat-pixel-rattle 1250ms steps(4, end);
}

.cat-action-squish .pixel-cat-sprite {
  animation: cat-squish 980ms steps(6, end);
}

.cat-action-squish .pixel-cat-eye {
  animation: cat-pixel-squint 980ms steps(2, end);
}

.cat-action-boop .pixel-cat-head {
  animation: cat-boop 980ms steps(5, end);
}

.cat-action-boop .pixel-cat-muzzle,
.cat-action-boop .pixel-cat-cheek-pixel {
  animation: cat-pixel-sniff 980ms steps(5, end);
}

.cat-action-moonwalk .pixel-cat-sprite {
  animation: cat-moonwalk 1600ms steps(8, end);
}

.cat-action-moonwalk .pixel-cat-legs {
  animation: cat-leg-shuffle 320ms steps(2, end) infinite;
}

.cat-action-surprise .pixel-cat-sprite {
  animation: cat-surprise 1100ms steps(6, end);
}

.cat-action-surprise .pixel-cat-eye {
  animation: cat-wide-eyes 1100ms steps(2, end);
}

.cat-action-surprise .pixel-cat-cheek-pixel {
  animation: cat-cheek-pop 1100ms steps(2, end);
}

.cat-action-pancake .pixel-cat-sprite {
  animation: cat-pancake 1200ms steps(7, end);
}

.cat-action-orbit .pixel-cat-sprite {
  animation: cat-orbit 2100ms steps(10, end);
}

.cat-action-sneeze .pixel-cat-head {
  animation: cat-sneeze-head 1180ms steps(7, end);
}

.cat-action-sneeze .pixel-cat-body {
  animation: cat-sneeze-body 1180ms steps(5, end);
}

.cat-action-sneeze .pixel-cat-cheek-pixel,
.cat-action-sneeze .pixel-cat-whisker-pixel {
  animation: cat-pixel-scatter 1180ms steps(5, end);
}

.cat-action-escape .pixel-cat-sprite {
  animation: cat-escape-return 4300ms steps(13, end);
}

.cat-action-escape .pixel-cat-tail {
  animation: cat-tail-wag 4300ms steps(8, end);
}

@keyframes cat-idle {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(2px) rotate(-0.5deg);
  }
}

@keyframes cat-tail-wag {
  0%,
  100% {
    transform: rotate(0deg);
  }

  20% {
    transform: rotate(-16deg);
  }

  46% {
    transform: rotate(12deg);
  }

  72% {
    transform: rotate(-10deg);
  }

  88% {
    transform: rotate(7deg);
  }
}

@keyframes cat-blink {
  0%,
  35%,
  100% {
    opacity: 1;
  }

  36%,
  58% {
    opacity: 0;
  }
}

@keyframes cat-pixel-blink {
  0%,
  35%,
  100% {
    transform: scaleY(1);
  }

  36%,
  58% {
    transform: scaleY(0.25);
  }
}

@keyframes cat-pixel-hide {
  0%,
  35%,
  100% {
    opacity: 1;
  }

  36%,
  58% {
    opacity: 0;
  }
}

@keyframes cat-hop {
  0%,
  100% {
    transform: translateY(0);
  }

  18% {
    transform: translateY(4px) scaleY(0.96);
  }

  38% {
    transform: translateY(-18px) rotate(-2deg);
  }

  70% {
    transform: translateY(4px) scaleY(0.96);
  }
}

@keyframes cat-pixel-paws-hop {
  0%,
  100% {
    transform: translateY(0);
  }

  38%,
  58% {
    transform: translateY(4px);
  }
}

@keyframes cat-stretch {
  0%,
  100% {
    transform: scale(1);
  }

  38%,
  68% {
    transform: scaleX(1.14) scaleY(0.86) translateY(9px);
  }
}

@keyframes cat-pixel-stretch-head {
  0%,
  100% {
    transform: translateX(0);
  }

  38%,
  68% {
    transform: translateX(-8px) translateY(3px) scaleX(0.92);
  }
}

@keyframes cat-oiia-spin {
  0% {
    transform: perspective(520px) rotateY(0deg) translateY(0) scale(1.03);
  }

  12.5% {
    transform: perspective(520px) rotateY(58deg) translateY(-1px) scale(1.02);
  }

  25% {
    transform: perspective(520px) rotateY(92deg) translateY(0) scaleX(0.78) scaleY(1.02);
  }

  37.5% {
    transform: perspective(520px) rotateY(142deg) translateY(1px) scale(1.02);
  }

  50% {
    transform: perspective(520px) rotateY(180deg) translateY(0) scale(1.03);
  }

  62.5% {
    transform: perspective(520px) rotateY(238deg) translateY(-1px) scale(1.02);
  }

  75% {
    transform: perspective(520px) rotateY(272deg) translateY(0) scaleX(0.78) scaleY(1.02);
  }

  87.5% {
    transform: perspective(520px) rotateY(322deg) translateY(1px) scale(1.02);
  }

  100% {
    transform: perspective(520px) rotateY(360deg) translateY(0) scale(1.03);
  }
}

@keyframes cat-wiggle {
  0%,
  100% {
    transform: rotate(0deg);
  }

  14% {
    transform: rotate(-8deg) translateX(-3px);
  }

  28% {
    transform: rotate(8deg) translateX(3px);
  }

  42% {
    transform: rotate(-6deg) translateX(-2px);
  }

  58% {
    transform: rotate(6deg) translateX(2px);
  }

  78% {
    transform: rotate(-2deg);
  }
}

@keyframes cat-pixel-rattle {
  0%,
  100% {
    transform: translate(0, 0);
  }

  25% {
    transform: translate(2px, -2px);
  }

  50% {
    transform: translate(-2px, 2px);
  }

  75% {
    transform: translate(2px, 0);
  }
}

@keyframes cat-squish {
  0%,
  100% {
    transform: scale(1);
  }

  35% {
    transform: scaleX(1.22) scaleY(0.72) translateY(20px);
  }

  62% {
    transform: scaleX(0.88) scaleY(1.12) translateY(-8px);
  }
}

@keyframes cat-pixel-squint {
  0%,
  100% {
    transform: scaleY(1);
  }

  35%,
  62% {
    transform: scaleY(0.55);
  }
}

@keyframes cat-boop {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  42% {
    transform: translateY(-8px) rotate(5deg) scale(1.06);
  }
}

@keyframes cat-pixel-sniff {
  0%,
  100% {
    transform: translate(0, 0) scaleX(1);
  }

  34% {
    transform: translate(5px, -2px) scaleX(1.22);
  }

  62% {
    transform: translate(-3px, 1px) scaleX(1.08);
  }
}

@keyframes cat-moonwalk {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  22% {
    transform: translateX(-14px) rotate(-3deg);
  }

  48% {
    transform: translateX(10px) rotate(2deg);
  }

  72% {
    transform: translateX(-8px) rotate(-1deg);
  }
}

@keyframes cat-leg-shuffle {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(3px);
  }
}

@keyframes cat-surprise {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  32% {
    transform: translateY(-10px) scale(1.04) rotate(2deg);
  }

  54% {
    transform: translateY(5px) scaleY(0.94);
  }
}

@keyframes cat-wide-eyes {
  0%,
  100% {
    transform: scale(1);
  }

  28%,
  70% {
    transform: scale(1.38);
  }
}

@keyframes cat-cheek-pop {
  0%,
  100% {
    transform: scale(1);
  }

  28%,
  70% {
    transform: scale(1.8);
  }
}

@keyframes cat-pancake {
  0%,
  100% {
    transform: scale(1);
  }

  44%,
  72% {
    transform: scaleX(1.28) scaleY(0.54) translateY(30px);
  }
}

@keyframes cat-orbit {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(16px, -16px) rotate(12deg);
  }

  50% {
    transform: translate(0, -24px) rotate(0deg);
  }

  75% {
    transform: translate(-16px, -16px) rotate(-12deg);
  }
}

@keyframes cat-sneeze-head {
  0%,
  100% {
    transform: translateX(0) rotate(0deg);
  }

  30% {
    transform: translateX(-5px) rotate(-6deg);
  }

  48% {
    transform: translateX(9px) rotate(8deg);
  }

  64% {
    transform: translateX(-3px) rotate(-3deg);
  }
}

@keyframes cat-sneeze-body {
  0%,
  100% {
    transform: scale(1);
  }

  42% {
    transform: scaleX(0.92) scaleY(1.06);
  }
}

@keyframes cat-pixel-scatter {
  0%,
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }

  24% {
    opacity: 1;
    transform: translate(-2px, 0);
  }

  42% {
    opacity: 0.35;
    transform: translate(8px, -4px);
  }

  68% {
    opacity: 0.75;
    transform: translate(-4px, 2px);
  }
}

@keyframes cat-escape-return {
  0%,
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  10% {
    transform: translate(-12px, 3px) scale(0.98);
  }

  22% {
    opacity: 1;
    transform: translate(168px, 0) scale(0.98);
  }

  23%,
  48% {
    opacity: 0;
    transform: translate(220px, 0) scale(0.98);
  }

  49% {
    opacity: 0;
    transform: translate(-220px, 4px) scale(0.98);
  }

  66% {
    opacity: 1;
    transform: translate(-64px, 4px) scale(0.98);
  }

  78% {
    transform: translate(8px, -4px) scale(1.03);
  }

  88% {
    transform: translate(-4px, 2px) scale(1);
  }
}

@keyframes cat-bubble {
  0% {
    opacity: 0;
    transform: translateX(50%) translateY(8px) scale(0.96);
  }

  12%,
  82% {
    opacity: 1;
    transform: translateX(50%) translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateX(50%) translateY(-4px) scale(0.98);
  }
}

@keyframes cat-bubble-inline {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }

  12%,
  82% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pixel-cat-sprite,
  .cat-action-tail .pixel-cat-tail,
  .cat-action-blink .pixel-cat-eye,
  .cat-action-hop .pixel-cat-sprite,
  .cat-action-stretch .pixel-cat-sprite,
  .cat-action-oiia-spin .pixel-cat-sprite,
  .cat-action-wiggle .pixel-cat-sprite,
  .cat-action-squish .pixel-cat-sprite,
  .cat-action-boop .pixel-cat-head,
  .cat-action-moonwalk .pixel-cat-sprite,
  .cat-action-moonwalk .pixel-cat-legs,
  .cat-action-surprise .pixel-cat-sprite,
  .cat-action-surprise .pixel-cat-eye,
  .cat-action-pancake .pixel-cat-sprite,
  .cat-action-orbit .pixel-cat-sprite,
  .cat-action-sneeze .pixel-cat-head,
  .cat-action-sneeze .pixel-cat-body,
  .cat-action-sneeze .pixel-cat-cheek-pixel,
  .cat-action-sneeze .pixel-cat-whisker-pixel,
  .cat-action-escape .pixel-cat-sprite,
  .cat-action-escape .pixel-cat-tail,
  .pixel-cat-bubble.is-visible {
    animation: none;
  }

  .files-panel .pixel-cat-bubble.is-visible {
    animation: none;
  }
}

@media (max-width: 1200px) {
  :root {
    --right-width: 0px;
  }

  .topbar,
  .chat-panel {
    right: 0;
  }

  .files-panel {
    position: fixed;
    top: 68px;
    right: 10px;
    bottom: 10px;
    left: auto;
    z-index: 41;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
    max-height: none;
    margin: 0;
    padding: 16px;
    overflow: hidden;
    transform: translateX(calc(100% + 24px));
    transition: transform 180ms ease;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    -webkit-backdrop-filter: blur(28px) saturate(1.18);
    backdrop-filter: blur(28px) saturate(1.18);
  }

  .files-panel .file-list {
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .files-panel .preview {
    min-height: 0;
    overflow: hidden;
  }

  .files-panel .preview p {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
  }

  .files-panel .pixel-cat-widget {
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    min-height: auto;
    padding: 10px 8px 4px;
  }

  .files-panel .pixel-cat-bubble {
    position: relative;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: none;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    word-break: break-word;
  }

  .files-panel .pixel-cat-bubble::after {
    right: auto;
    left: 50%;
    bottom: -5px;
    transform: translateX(-50%) rotate(45deg);
  }

  .files-panel .pixel-cat-bubble.is-visible {
    animation: cat-bubble-inline 2600ms ease both;
  }

  .files-panel .pixel-cat-button {
    align-self: center;
  }

  .mobile-drawer-button-right {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 43;
    display: grid;
    place-items: center;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--line-strong) 58%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 74%, transparent);
    color: var(--text);
    box-shadow: 0 10px 30px color-mix(in srgb, #000 10%, transparent);
    -webkit-backdrop-filter: blur(28px) saturate(1.18);
    backdrop-filter: blur(28px) saturate(1.18);
  }

  .mobile-drawer-button-right:hover,
  .mobile-drawer-button-right.active {
    background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  }

  .mobile-drawer-button-right svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .message-form {
    left: calc(var(--sidebar-width) + 20px);
    right: 20px;
  }

  .new-messages-button {
    right: 26px;
  }

  body[data-mobile-drawer='right'] .files-panel,
  body.mobile-drawer-right .files-panel {
    transform: translateX(0);
  }
}

.pwa-install-banner {
  position: fixed;
  right: 16px;
  bottom: calc(var(--composer-height) + 18px);
  left: 16px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px) saturate(1.08);
}

.pwa-install-banner[hidden] {
  display: none !important;
}

.pwa-install-banner-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pwa-install-banner-copy strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.pwa-install-banner-copy span {
  color: var(--muted-strong);
  font-size: 12px;
  line-height: 1.35;
}

.pwa-install-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pwa-install-banner-install {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--text);
  color: var(--text-inverse);
  font-size: 13px;
  font-weight: 600;
}

.pwa-install-banner-dismiss {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.pwa-install-banner-dismiss svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.pwa-install-banner-dismiss:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.pwa-install-dialog-panel {
  width: min(440px, 100%);
}

.pwa-install-dialog-intro {
  margin: 10px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.pwa-install-dialog-steps {
  margin: 14px 0 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.pwa-install-dialog-steps li + li {
  margin-top: 8px;
}

.pwa-install-dialog-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
}

.pwa-install-dialog-actions {
  margin-top: 16px;
}

.artifact-dialog {
  padding: 12px;
}

.app-dialog.artifact-dialog {
  z-index: 120;
}

.app-dialog-panel.artifact-dialog-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  width: min(calc(100vw - 48px), 960px);
  height: min(calc(100vh - 48px), 860px);
  max-height: min(calc(100vh - 48px), 860px);
  padding: 0;
  overflow: hidden;
}

.app-dialog-panel.artifact-dialog-panel-visual {
  grid-template-rows: auto auto auto;
  width: fit-content;
  max-width: min(calc(100vw - 24px), 96vw);
  height: auto;
  max-height: min(calc(100vh - 24px), 96vh);
  overflow: hidden;
  --artifact-media-max-width: min(calc(100vw - 48px), 1400px);
  --artifact-media-max-height: calc(100vh - 120px);
  --artifact-preview-max-height: var(--artifact-media-max-height);
}

.app-dialog-panel.artifact-dialog-panel-image {
  position: relative;
  display: inline-block;
  width: auto;
  height: auto;
  min-width: min(520px, calc(100vw - 24px));
  min-height: min(360px, calc(100vh - 24px));
  max-width: min(calc(100vw - 24px), 96vw);
  max-height: min(calc(100vh - 24px), 96vh);
  overflow: hidden;
  vertical-align: top;
}

.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-preview {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: min(520px, calc(100vw - 24px));
  min-height: min(360px, calc(100vh - 24px));
  max-width: min(calc(100vw - 24px), 96vw);
  max-height: min(calc(100vh - 24px), 96vh);
  overflow: hidden;
  background: #050505;
  line-height: 0;
}

.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-preview img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(100vw - 24px), 96vw);
  max-height: min(calc(100vh - 80px), 96vh);
  object-fit: contain;
}

.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-head {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='light-bg'] .artifact-dialog-head {
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='dark-bg'] .artifact-dialog-head {
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-actions {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  border-top: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image[data-actions-tone='light-bg'] .artifact-dialog-actions {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image[data-actions-tone='dark-bg'] .artifact-dialog-actions {
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='light-bg'] .artifact-dialog-close,
.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='light-bg'] .artifact-dialog-action {
  color: #fff;
  border-color: transparent;
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='dark-bg'] .artifact-dialog-close,
.app-dialog-panel.artifact-dialog-panel-image[data-head-tone='dark-bg'] .artifact-dialog-action,
.app-dialog-panel.artifact-dialog-panel-image[data-actions-tone='dark-bg'] .artifact-dialog-action {
  color: #fff;
  border-color: transparent;
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-image[data-actions-tone='light-bg'] .artifact-dialog-action {
  color: #fff;
  border-color: transparent;
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-close:hover,
.app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-action:hover {
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-visual .artifact-dialog-head {
  width: 100%;
  min-width: 0;
}

.app-dialog-panel.artifact-dialog-panel-visual .artifact-dialog-preview {
  display: block;
  width: fit-content;
  max-width: min(calc(100vw - 24px), 96vw);
  max-height: var(--artifact-preview-max-height);
  overflow: auto;
  background: transparent;
  line-height: 0;
}

.app-dialog-panel.artifact-dialog-panel-visual .artifact-dialog-preview video {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--artifact-media-max-width);
  max-height: var(--artifact-media-max-height);
  object-fit: contain;
}

.artifact-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0));
}

.artifact-dialog-head .app-dialog-title {
  margin: 0;
  padding-right: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #fff;
}

.artifact-dialog-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
}

.artifact-dialog-close svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.artifact-dialog-close:hover {
  background: transparent;
  color: #fff;
}

.artifact-dialog-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  min-height: 0;
  transform: translate3d(var(--artifact-swipe-x, 0), var(--artifact-swipe-y, 0), 0);
  opacity: var(--artifact-swipe-opacity, 1);
  transition: transform 180ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.artifact-dialog-stage.artifact-swipe-active {
  transition: none;
}

.artifact-dialog[data-preview-dismiss='dragging'] .app-dialog-backdrop {
  opacity: var(--artifact-swipe-opacity, 1);
}

.artifact-gallery-transition-active .artifact-dialog-preview {
  animation-duration: 220ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  animation-fill-mode: both;
}

.artifact-gallery-transition-next .artifact-dialog-preview {
  animation-name: artifact-gallery-slide-next;
}

.artifact-gallery-transition-prev .artifact-dialog-preview {
  animation-name: artifact-gallery-slide-prev;
}

@keyframes artifact-gallery-slide-next {
  from {
    opacity: 0.32;
    transform: translate3d(34px, 0, 0) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes artifact-gallery-slide-prev {
  from {
    opacity: 0.32;
    transform: translate3d(-34px, 0, 0) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.artifact-dialog-swipe-close-down .artifact-dialog-panel {
  animation: artifact-dialog-dismiss-down 170ms ease forwards;
}

.artifact-dialog-swipe-close-up .artifact-dialog-panel {
  animation: artifact-dialog-dismiss-up 170ms ease forwards;
}

.artifact-dialog-swipe-close-to-source .app-dialog-backdrop {
  animation: artifact-dialog-backdrop-fade 260ms ease forwards;
}

.artifact-dialog-swipe-close-to-source .artifact-dialog-stage {
  transition: none;
  transform: none;
  opacity: 1;
}

.artifact-dialog-swipe-close-to-source .artifact-dialog-panel {
  transform-origin: center;
  animation: artifact-dialog-dismiss-to-source 280ms cubic-bezier(0.19, 1, 0.22, 1) forwards;
  will-change: transform, opacity;
}

@keyframes artifact-dialog-dismiss-down {
  to {
    opacity: 0;
    transform: translate3d(0, 42px, 0) scale(0.985);
  }
}

@keyframes artifact-dialog-dismiss-up {
  to {
    opacity: 0;
    transform: translate3d(0, -42px, 0) scale(0.985);
  }
}

@keyframes artifact-dialog-backdrop-fade {
  to {
    opacity: 0;
  }
}

@keyframes artifact-dialog-dismiss-to-source {
  0% {
    opacity: 1;
    transform: translate3d(var(--artifact-dismiss-start-x, 0), var(--artifact-dismiss-start-y, 0), 0) scale(1);
  }

  62% {
    opacity: 0.58;
    transform: translate3d(var(--artifact-dismiss-mid-x, 0), var(--artifact-dismiss-mid-y, 0), 0) scale(0.72);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--artifact-dismiss-end-x, 0), var(--artifact-dismiss-end-y, 0), 0)
      scale(var(--artifact-dismiss-end-scale, 0.12));
  }
}

.artifact-gallery-nav {
  position: fixed;
  top: 50%;
  z-index: 90;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  color: var(--text);
  transform: translateY(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.artifact-gallery-nav[hidden] {
  display: none !important;
}

.artifact-gallery-prev {
  left: max(10px, env(safe-area-inset-left, 0px));
}

.artifact-gallery-next {
  right: max(10px, env(safe-area-inset-right, 0px));
}

.artifact-gallery-nav svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.artifact-gallery-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  z-index: 4;
  margin: 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.18);
  backdrop-filter: blur(18px) saturate(1.18);
  text-align: center;
  font-size: 12px;
  color: var(--text);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.artifact-dialog-preview {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: auto;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  touch-action: none;
}

.app-dialog-panel.artifact-dialog-panel-text {
  width: min(calc(100vw - 24px), 960px);
}

.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-head {
  color: var(--text);
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-head .app-dialog-title,
.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-close,
.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-action {
  color: var(--text);
}

.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-actions {
  color: var(--text);
  background: transparent;
}

.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-action:hover,
.app-dialog-panel.artifact-dialog-panel-text .artifact-dialog-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
}

.artifact-dialog-preview .artifact-code-block,
.artifact-dialog-preview .message-code-block {
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  align-self: stretch;
  max-height: min(calc(100vh - 160px), 720px);
}

.artifact-dialog-preview .message-code-block {
  margin: 0 12px 14px;
}

.artifact-dialog-preview .artifact-code-block .message-code-pre,
.artifact-dialog-preview .message-code-block .message-code-pre {
  max-height: min(calc(100vh - 200px), 680px);
}

.artifact-dialog-preview img,
.artifact-dialog-preview video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.artifact-dialog-preview-image.is-loading {
  display: none;
}

.artifact-dialog-preview-loading {
  display: inline-grid;
  place-items: center;
  min-width: min(320px, calc(100vw - 48px));
  min-height: 180px;
  margin: auto;
  padding: 18px;
  color: color-mix(in srgb, #fff 72%, transparent);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.artifact-preview-zoom-surface img {
  transform: translate3d(var(--artifact-preview-pan-x, 0), var(--artifact-preview-pan-y, 0), 0)
    scale(var(--artifact-preview-zoom, 1));
  transition: transform 140ms ease;
  will-change: transform;
}

.artifact-preview-zoom-surface.artifact-preview-zoomed img {
  cursor: grab;
  transition: none;
}

.artifact-dialog-preview audio {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
}

.artifact-dialog-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}

.artifact-dialog-preview pre.artifact-dialog-code {
  align-self: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  white-space: pre;
  word-break: normal;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

.artifact-dialog-preview pre.artifact-dialog-code code {
  display: block;
  min-width: min-content;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.artifact-dialog-preview-empty {
  padding: 18px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.chat-logs-dialog-panel {
  width: min(92vw, 720px);
  max-height: min(82vh, 760px);
}

.chat-logs-dialog-body {
  display: flex;
  min-height: 0;
  max-height: min(68vh, 620px);
  overflow: auto;
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
}

.chat-logs-dialog-body .artifact-dialog-preview-loading,
.chat-logs-dialog-body .artifact-dialog-preview-empty {
  width: 100%;
  padding: 24px 18px;
}

.chat-logs-pre {
  flex: 1 1 auto;
}

.chat-logs-line-error {
  color: var(--danger);
}

.chat-logs-line-warn {
  color: color-mix(in srgb, var(--danger) 72%, var(--text));
}

.chat-logs-line-thinking {
  color: var(--muted-strong);
}

.artifact-dialog-meta {
  display: grid;
  grid-template-columns: minmax(110px, 34%) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
  padding: 14px 18px 0;
  overflow: auto;
  background: #050505;
}

.artifact-dialog-meta dt {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  line-height: 1.35;
}

.artifact-dialog-meta dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.artifact-dialog-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0));
}

.artifact-dialog-action {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  min-width: 0;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #fff;
}

.artifact-dialog-action svg {
  display: block;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.artifact-dialog-action .artifact-dialog-menu-icon {
  width: 22px;
  height: 22px;
  stroke: none;
  fill: currentColor;
}

#artifactDialogMenuButton.artifact-dialog-action {
  transform: translateX(5px);
}

.artifact-dialog-action:hover {
  background: transparent;
  color: #fff;
}

.artifact-dialog-preview-loading {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 14px;
}

.artifact-dialog-preview .link-preview-card {
  width: min(100%, 760px);
  margin: 0 auto;
}

.artifact-dialog-preview .hljs-comment,
.artifact-dialog-preview .hljs-quote,
.message-text .hljs-comment,
.message-text .hljs-quote {
  color: var(--code-comment);
}

.artifact-dialog-preview .hljs-keyword,
.artifact-dialog-preview .hljs-selector-tag,
.artifact-dialog-preview .hljs-literal,
.artifact-dialog-preview .hljs-section,
.artifact-dialog-preview .hljs-link,
.message-text .hljs-keyword,
.message-text .hljs-selector-tag,
.message-text .hljs-literal,
.message-text .hljs-section,
.message-text .hljs-link {
  color: var(--code-keyword);
}

.artifact-dialog-preview .hljs-string,
.artifact-dialog-preview .hljs-title,
.artifact-dialog-preview .hljs-name,
.artifact-dialog-preview .hljs-type,
.artifact-dialog-preview .hljs-attribute,
.artifact-dialog-preview .hljs-symbol,
.artifact-dialog-preview .hljs-bullet,
.artifact-dialog-preview .hljs-addition,
.artifact-dialog-preview .hljs-template-tag,
.artifact-dialog-preview .hljs-template-variable,
.message-text .hljs-string,
.message-text .hljs-title,
.message-text .hljs-name,
.message-text .hljs-type,
.message-text .hljs-attribute,
.message-text .hljs-symbol,
.message-text .hljs-bullet,
.message-text .hljs-addition,
.message-text .hljs-template-tag,
.message-text .hljs-template-variable {
  color: var(--code-string);
}

.artifact-dialog-preview .hljs-number,
.artifact-dialog-preview .hljs-regexp,
.artifact-dialog-preview .hljs-variable,
.artifact-dialog-preview .hljs-template-variable,
.artifact-dialog-preview .hljs-attr,
.message-text .hljs-number,
.message-text .hljs-regexp,
.message-text .hljs-variable,
.message-text .hljs-template-variable,
.message-text .hljs-attr {
  color: var(--code-number);
}

.artifact-dialog-preview .hljs-built_in,
.artifact-dialog-preview .hljs-builtin-name,
.artifact-dialog-preview .hljs-class .hljs-title,
.message-text .hljs-built_in,
.message-text .hljs-builtin-name,
.message-text .hljs-class .hljs-title {
  color: var(--code-builtin);
}

.artifact-dialog-preview .hljs-meta,
.artifact-dialog-preview .hljs-deletion,
.message-text .hljs-meta,
.message-text .hljs-deletion {
  color: var(--code-meta);
}

.link-preview-card {
  display: grid;
  gap: 0;
  width: min(100%, 640px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.link-preview-image-wrap {
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-soft) 80%, transparent);
}

.link-preview-image {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.link-preview-body {
  display: grid;
  gap: 6px;
  padding: 14px 16px 16px;
}

.link-preview-site {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.link-preview-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.link-preview-description {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.file-thumb-has-link-image img {
  object-fit: cover;
}

.app-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.app-dialog[hidden] {
  display: none;
}

.app-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, #000 28%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.app-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 18px 18px 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  box-shadow: var(--shadow-card);
}

.app-dialog-panel-danger .app-dialog-confirm {
  background: color-mix(in srgb, var(--danger) 88%, #000 12%);
  color: #fff;
}

.app-dialog-panel-danger .app-dialog-confirm:hover {
  background: color-mix(in srgb, var(--danger) 88%, #000 12%);
  color: #fff;
}

.app-dialog-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
}

.app-dialog-message {
  margin: 10px 0 0;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.app-dialog-message:empty,
.app-dialog-message[hidden] {
  display: none;
}

.app-dialog-input {
  display: block;
  width: 100%;
  margin-top: 14px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.app-dialog-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.app-dialog-input[hidden] {
  display: none;
}

.app-dialog-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.app-dialog-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 14px;
}

.app-dialog-confirm {
  border-color: transparent;
  background: var(--button-contrast-bg);
  color: var(--button-contrast-text);
}

.app-dialog-confirm:hover {
  border-color: transparent;
  background: var(--button-contrast-bg);
  color: var(--button-contrast-text);
}

.context-menu {
  position: fixed;
  z-index: 220;
  min-width: 244px;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  box-shadow: 0 8px 24px color-mix(in srgb, #000 14%, transparent), 0 1px 3px color-mix(in srgb, #000 10%, transparent);
  backdrop-filter: blur(18px) saturate(1.12);
}

.context-menu[hidden] {
  display: none;
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 520;
  text-align: left;
}

.context-menu-item::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--context-menu-icon-mask) center / contain no-repeat;
  mask: var(--context-menu-icon-mask) center / contain no-repeat;
}

.context-menu-item[data-menu-icon='copy']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 7h10v10H7z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M4 13V4h9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='edit']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 20h4L19 9l-4-4L4 16v4z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M13 7l4 4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='share']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12h8' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M13 7l5 5-5 5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h2' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='pin']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 17v5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M7 10l7-7 7 7-4 1-5 5-1 4-4-4 4-1 5-5-5-5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='rename']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 7h10M4 12h8M4 17h6' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M15 18l5-5 2 2-5 5h-2v-2z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='project']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 7h7l2 2h9v11H3z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M16 12v5M13.5 14.5h5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='delete']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 7h14M10 11v6M14 11v6M8 7l1-3h6l1 3M7 7l1 14h8l1-14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='use']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 5v14M5 12h14' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='open']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 4h6v6M20 4l-9 9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M20 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='download']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 3v12M8 11l4 4 4-4M4 20h16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.context-menu-item[data-menu-icon='settings']::before {
  --context-menu-icon-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8z' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

.context-menu-item:hover,
.context-menu-item:focus-visible {
  background: color-mix(in srgb, var(--surface-soft) 82%, transparent);
  outline: none;
}

.context-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.context-menu-item-danger {
  color: var(--danger);
}

.context-menu-separator {
  height: 1px;
  margin: 8px 6px;
  background: color-mix(in srgb, var(--line) 88%, transparent);
}

.message {
  -webkit-touch-callout: none;
  user-select: text;
}

.message-text,
.message-text p,
.message-text li,
.message-text blockquote,
.message-text .message-code-content,
.message-text .message-code-pre,
.message-text pre,
.message-text pre code,
.message-text code {
  cursor: text;
}

.inline-math {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.message-header,
.message-role,
.message-actions {
  cursor: default;
}

@media (max-width: 760px) {
  .artifact-dialog-preview pre.artifact-dialog-code,
  .artifact-dialog-preview .artifact-code-block .message-code-pre,
  .artifact-dialog-preview .message-code-block .message-code-pre {
    font-size: 12px;
    line-height: 1.45;
  }

  :root {
    --sidebar-width: 0px;
  }

  .layout {
    grid-template-areas:
      'chat';
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr);
    min-height: 100dvh;
  }

  .topbar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 40;
    justify-content: center;
    width: 100%;
    min-height: 70px;
    height: 70px;
    padding: 0 74px;
    border-bottom: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .topbar-actions {
    position: absolute;
    right: 72px;
    z-index: 1;
    align-items: center;
  }

  .topbar-icon-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    box-shadow: none;
  }

  .topbar-link-button {
    min-height: 40px;
    box-shadow: none;
  }

  .thread-title {
    display: none;
  }

  .status-line {
    display: none;
  }

  .chat-list-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 41;
    width: min(328px, calc(100vw - 48px));
    max-height: none;
    min-height: 100dvh;
    padding: 66px 12px 16px;
    transform: translateX(calc(-100% - 18px));
    transition: transform 180ms ease;
    box-shadow: var(--shadow-card);
  }

  .mobile-drawer-button {
    position: fixed;
    top: 14px;
    z-index: 43;
    display: grid;
    place-items: center;
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--line-strong) 50%, transparent);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    color: var(--text);
    box-shadow: 0 10px 30px color-mix(in srgb, #000 10%, transparent);
    -webkit-backdrop-filter: blur(28px) saturate(1.18);
    backdrop-filter: blur(28px) saturate(1.18);
  }

  .mobile-drawer-button-left {
    left: 18px;
  }

  .mobile-drawer-button-right {
    right: 18px;
  }

  .mobile-drawer-button:hover,
  .mobile-drawer-button.active {
    background: color-mix(in srgb, var(--surface-soft) 86%, transparent);
  }

  .mobile-drawer-button-left span,
  .mobile-drawer-button-left span::before,
  .mobile-drawer-button-left span::after {
    width: 18px;
    height: 1.8px;
    border-radius: 999px;
    background: currentColor;
  }

  .mobile-drawer-button-left span {
    position: relative;
  }

  .mobile-drawer-button-left span::before,
  .mobile-drawer-button-left span::after {
    position: absolute;
    left: 0;
    content: '';
  }

  .mobile-drawer-button-left span::before {
    top: -6px;
  }

  .mobile-drawer-button-left span::after {
    top: 6px;
  }

  .mobile-drawer-button-right svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .chat-panel {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    min-height: 0;
    padding: 0;
  }

  .chat-panel::before {
    display: none;
  }

  .chat-panel::after {
    height: 96px;
    background: linear-gradient(
      0deg,
      color-mix(in srgb, var(--app-bg) 72%, transparent) 0%,
      color-mix(in srgb, var(--app-bg) 18%, transparent) 52%,
      transparent 100%
    );
  }

  .messages {
    padding-top: 82px;
    padding-right: 12px;
    padding-bottom: calc(var(--composer-height) + 16px);
    padding-left: 12px;
  }

  .toolbar {
    display: none;
  }

  .toolbar select {
    max-width: none;
    flex-basis: 100%;
  }

  .message-form {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 8px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    box-shadow:
      0 1px 0 color-mix(in srgb, var(--text) 6%, transparent) inset,
      0 4px 8px color-mix(in srgb, #000 10%, transparent);
    -webkit-backdrop-filter: blur(42px) saturate(1.28);
    backdrop-filter: blur(42px) saturate(1.28);
  }

  .new-messages-button {
    right: 18px;
    bottom: calc(var(--composer-height) + 44px);
  }

  .message-form textarea {
    flex: 1 1 58px;
    min-width: 58px;
    height: 42px;
    min-height: 42px;
    max-height: 42dvh;
    padding: 8px 4px;
    font-size: 16px;
  }

  .composer-controls {
    gap: 5px;
  }

  .composer-icon-button,
  .composer-send-button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .composer-selector-group {
    display: none;
    flex: 0 0 0;
    min-height: 44px;
    max-width: none;
    opacity: 0;
    pointer-events: none;
  }

  .message-form:hover .composer-selector-group,
  .message-form:focus-within .composer-selector-group,
  .composer-selector-group:has(.active) {
    display: none;
    flex: 0 0 0;
    opacity: 0;
    pointer-events: none;
  }

  .message-form.composer-multiline .composer-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
    grid-template-areas:
      "input input input input"
      "attach spacer speech send";
    gap: 8px 5px;
  }

  .message-form.composer-multiline .composer-selector-group {
    display: none;
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  .composer-selector-group > .composer-agent-pill,
  .composer-selector-group > .composer-mode-pill {
    min-height: 44px;
  }

  .composer-selector-group > .composer-agent-pill {
    display: none;
  }

  .composer-agent-pill #agentMenuButtonLabel,
  .composer-agent-pill .composer-chevron {
    display: none;
  }

  .composer-agent-pill .composer-agent-logo-wrap {
    margin-left: 0;
  }

  .composer-selector-group > .composer-mode-pill {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 15px;
    font-size: 14px;
  }

  .composer-mode-pill #modeMenuModeLabel[hidden] {
    display: none;
  }

  .composer-mode-pill.mode-only #modeMenuModelLabel {
    color: var(--text);
  }

  .composer-popover {
    position: fixed;
    right: 12px;
    left: 12px;
    --composer-menu-exit-y: calc(100% + 28px);
    width: auto;
    max-height: min(76vh, calc(100dvh - 24px));
    bottom: 0;
    border-bottom: 0;
    border-radius: 28px 28px 0 0;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    -webkit-backdrop-filter: blur(42px) saturate(1.28);
    backdrop-filter: blur(42px) saturate(1.28);
  }

  .composer-agent-menu-shortcut,
  .composer-mode-menu-shortcut {
    display: grid;
  }

  .composer-main-menu,
  .composer-agent-menu,
  .composer-mode-menu,
  .composer-popover-mode {
    padding-top: 28px;
  }

  .composer-main-menu::before,
  .composer-agent-menu::before,
  .composer-mode-menu::before,
  .composer-popover-mode::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 54px;
    height: 5px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--muted-strong) 72%, transparent);
    transform: translateX(-50%);
  }

  .composer-menu-back {
    position: sticky;
    bottom: 0;
    display: grid;
    margin-top: 8px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
  }

  @media (max-width: 360px) {
    .message-form:focus-within .composer-selector-group,
    .composer-selector-group:has(.active) {
      flex-basis: 96px;
    }
  }

  .message-artifact-image-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    width: 100%;
  }

  .artifact-gallery-nav {
    display: none !important;
  }

  .artifact-dialog {
    padding: 0;
  }

  .artifact-dialog .app-dialog-backdrop {
    background: rgba(0, 0, 0, 0.92);
  }

  .app-dialog-panel.artifact-dialog-panel,
  .app-dialog-panel.artifact-dialog-panel-visual,
  .app-dialog-panel.artifact-dialog-panel-image,
  .app-dialog-panel.artifact-dialog-panel-text {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
    background: #050505;
  }

  .app-dialog-panel.artifact-dialog-panel-image {
    grid-template-rows: minmax(0, 1fr);
  }

  .app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-stage {
    min-height: 0;
    height: 100%;
  }

  .artifact-dialog .app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-head,
  .artifact-dialog .artifact-dialog-head {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    color: #f7f7f7;
    border-bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0));
  }

  .app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-preview,
  .app-dialog-panel.artifact-dialog-panel-visual .artifact-dialog-preview,
  .artifact-dialog-preview {
    width: 100%;
    max-width: 100vw;
    height: 100%;
    max-height: none;
    overflow: hidden;
    background: #050505;
  }

  .app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-preview img,
  .artifact-dialog-preview img,
  .artifact-dialog-preview video {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100dvh;
    object-fit: contain;
  }

  .artifact-dialog-actions {
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
    border-top: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0));
  }

  .artifact-gallery-counter {
    max-width: min(44vw, 150px);
    color: #f7f7f7;
    background: rgba(0, 0, 0, 0.32);
  }

  .menu-row,
  .mode-menu-row,
  .model-menu-row,
  .agent-menu-row {
    min-height: 48px;
    font-size: 16px;
  }

  .files-panel {
    position: fixed;
    top: max(74px, calc(env(safe-area-inset-top, 0px) + 64px));
    right: max(8px, env(safe-area-inset-right, 0px));
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: max(8px, env(safe-area-inset-left, 0px));
    z-index: 41;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    width: auto;
    max-height: none;
    margin: 0;
    padding: 12px 14px max(10px, env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    border-radius: 18px;
    transform: translateX(calc(100% + 24px));
    transition: transform 180ms ease;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: blur(28px) saturate(1.18);
    backdrop-filter: blur(28px) saturate(1.18);
  }

  body.mobile-drawer-right,
  body[data-mobile-drawer='right'],
  body.mobile-drawer-left,
  body[data-mobile-drawer='left'] {
    overflow: hidden;
    height: 100dvh;
  }

  .files-panel .panel-head {
    padding: 0 2px;
  }

  .files-panel .panel-head h2 {
    font-size: 15px;
  }

  .files-panel .file-list {
    max-height: none;
    min-height: 0;
    padding-top: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .files-panel .preview {
    display: none;
  }

  .files-panel .pixel-cat-widget {
    margin-top: 0;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  }

  .files-panel .pixel-cat-sprite {
    width: 118px;
    height: 86px;
  }

  .files-panel .file-list .file-row-open {
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 6px 4px 6px 8px;
  }

  .files-panel .file-list .file-row-select {
    width: var(--file-meta-width);
    min-width: var(--file-meta-width);
    max-width: var(--file-meta-width);
    padding: 6px 8px;
  }

  .files-panel .file-list .file-row-meta {
    width: var(--file-meta-width);
    min-width: var(--file-meta-width);
    max-width: var(--file-meta-width);
    padding: 6px 8px;
  }

  .files-panel .file-list .file-meta {
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
  }

  .files-panel .file-list .file-row {
    min-height: 42px;
    border-radius: 10px;
  }

  .files-panel .file-list .file-thumb {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }

  .files-panel .file-list .file-name {
    font-size: 12px;
  }

  body[data-mobile-drawer='left'] .chat-list-panel,
  body.mobile-drawer-left .chat-list-panel {
    transform: translateX(0);
  }

  body[data-mobile-drawer='right'] .files-panel,
  body.mobile-drawer-right .files-panel {
    transform: translateX(0);
  }
}

@media (hover: none), (pointer: coarse) {
  button:hover,
  .user-choice-button:hover,
  .page-title-button:hover,
  .topbar-icon-button:hover,
  .topbar-link-button:hover,
  .chat-row:hover,
  .chat-row-menu-button:hover,
  .files-panel .file-list .file-row:hover,
  .files-panel .file-list .file-row:not(.file-row-active):hover,
  .files-panel .file-list .file-row-active:hover,
  .file-row-open:hover,
  .files-panel .file-list .file-row-active .file-row-open:hover,
  .file-row-select:hover,
  .message-copy-button:hover,
  .message-edit-button:hover,
  .message-menu-button:hover,
  .message-text a:hover,
  .message-artifact-html a:hover,
  .message-artifact-file:hover,
  .composer-attachment-remove:hover,
  .composer-selector-group > .composer-agent-pill:hover,
  .composer-selector-group > .composer-mode-pill:hover,
  .composer-send-button:hover,
  .menu-row:hover,
  .mode-menu-row:hover,
  .model-menu-row:hover,
  .agent-menu-row:hover,
  .agent-menu-row:disabled:hover,
  .pixel-cat-button:hover,
  .mobile-drawer-button:hover,
  .mobile-drawer-button-right:hover,
  .context-menu-item:hover {
    background: inherit;
    color: inherit;
    opacity: inherit;
    transform: none;
  }

  .chat-row:hover,
  .files-panel .file-list .file-row:hover,
  .files-panel .file-list .file-row:not(.file-row-active):hover {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
  }

  .files-panel .file-list .file-row-active {
    background: linear-gradient(
      90deg,
      color-mix(in srgb, var(--accent-soft) 72%, transparent),
      color-mix(in srgb, var(--surface-soft) 88%, transparent)
    );
    border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  }

  .file-row-select:hover,
  .file-row-select:focus-visible {
    background: transparent;
  }

  .chat-row-menu-button:hover {
    color: var(--muted);
  }

  .message-copy-button:hover,
  .message-edit-button:hover,
  .message-menu-button:hover,
  .message:focus-within .message-copy-button,
  .message:hover .message-copy-button,
  .message:focus-within .message-edit-button,
  .message:hover .message-edit-button,
  .message:focus-within .message-menu-button,
  .message:hover .message-menu-button {
    opacity: 1;
    background: transparent;
    border-color: transparent;
    color: var(--muted);
  }

  .message-copy-button.copied {
    color: var(--accent);
  }
}

@media (max-width: 1200px) {
  html.is-ios-pwa .topbar {
    top: env(safe-area-inset-top, 0px);
  }

  html.is-ios-pwa .files-panel {
    top: max(68px, calc(env(safe-area-inset-top, 0px) + 68px));
    bottom: max(10px, calc(env(safe-area-inset-bottom, 0px) + 10px));
  }

  html.is-ios-pwa .mobile-drawer-button-right {
    top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  }
}

@media (max-width: 760px) {
  html.is-ios-pwa,
  html.is-ios-pwa body,
  html.is-ios-pwa .layout,
  html.is-ios-pwa .chat-panel {
    height: 100vh;
    min-height: 100vh;
  }

  html.is-ios-pwa body {
    position: fixed;
    inset: 0;
    width: 100vw;
    overflow: hidden;
  }

  html.is-ios-pwa::before {
    position: fixed;
    top: calc(-1 * env(safe-area-inset-top, 0px));
    right: 0;
    left: 0;
    z-index: 39;
    height: calc(env(safe-area-inset-top, 0px) + 112px);
    pointer-events: none;
    background: linear-gradient(
      180deg,
      var(--app-bg) 0%,
      color-mix(in srgb, var(--app-bg) 78%, transparent) 52%,
      transparent 100%
    );
    content: '';
  }

  html.is-ios-pwa .topbar {
    top: 0;
    min-height: calc(70px + env(safe-area-inset-top, 0px));
    height: calc(70px + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  html.is-ios-pwa .chat-list-panel {
    bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
    min-height: calc(100vh + env(safe-area-inset-bottom, 0px));
    padding-top: calc(76px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  html.is-ios-pwa .mobile-drawer-button {
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 14px));
  }

  html.is-ios-pwa .messages {
    padding-top: calc(86px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--composer-height) + 16px);
  }

  html.is-ios-pwa .message-form {
    bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) - 28px));
  }

  html.is-ios-pwa .new-messages-button {
    bottom: calc(var(--composer-height) + 24px);
  }

  html.is-ios-pwa .files-panel {
    top: max(82px, calc(env(safe-area-inset-top, 0px) + 72px));
    bottom: max(4px, calc(env(safe-area-inset-bottom, 0px) - 28px));
    padding-bottom: 14px;
  }

  html.is-ios-pwa .artifact-dialog .app-dialog-panel.artifact-dialog-panel-image .artifact-dialog-head,
  html.is-ios-pwa .artifact-dialog .artifact-dialog-head {
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 12px));
  }

  html.is-ios-pwa .artifact-dialog-actions {
    padding-bottom: max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  }

  html.is-ios-pwa .artifact-gallery-counter {
    bottom: max(18px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  }
}

body.has-pwa-install-banner.has-notification-banner .notification-banner {
  bottom: calc(var(--composer-height) + 106px);
}

html.is-ios-pwa .pwa-install-banner {
  bottom: calc(var(--composer-height) + 18px + env(safe-area-inset-bottom, 0px));
}

html.is-ios-pwa body.has-pwa-install-banner.has-notification-banner .notification-banner {
  bottom: calc(var(--composer-height) + 106px + env(safe-area-inset-bottom, 0px));
}

@media (pointer: coarse) {
  :where(
    button,
    a,
    select,
    input,
    textarea,
    [role='button'],
    .chat-open-button,
    .context-menu-item,
    .mobile-drawer-button,
    .topbar-icon-button,
    .topbar-link-button,
    .composer-icon-button,
    .composer-send-button,
    .message-copy-button,
    .message-edit-button,
    .message-menu-button,
    .composer-attachment-remove,
    .file-row-open,
    .menu-row,
    .mode-menu-row,
    .model-menu-row,
    .agent-menu-row
  ):is(:focus, :focus-visible, :active) {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-focus-ring-color: transparent !important;
  }

  :where(
    button,
    a,
    select,
    input,
    textarea,
    [role='button'],
    .chat-open-button,
    .context-menu-item,
    .message-copy-button,
    .message-edit-button,
    .message-menu-button,
    .composer-attachment-remove,
    .file-row-open,
    .menu-row,
    .mode-menu-row,
    .model-menu-row,
    .agent-menu-row
  ):is(:focus, :focus-visible, :active) {
    box-shadow: none !important;
  }

  .mobile-drawer-button:is(:focus, :focus-visible, :active),
  .topbar-icon-button:is(:focus, :focus-visible, :active),
  .topbar-link-button:is(:focus, :focus-visible, :active),
  .composer-icon-button:is(:focus, :focus-visible, :active),
  .composer-send-button:is(:focus, :focus-visible, :active) {
    box-shadow: 0 10px 30px color-mix(in srgb, #000 10%, transparent) !important;
  }
}
@supports (height: 100dvh) {
  html:not(.is-ios-pwa) body,
  html:not(.is-ios-pwa) .layout {
    height: 100dvh;
    min-height: 100dvh;
  }
}

@media (hover: none), (pointer: coarse) {
  .user-gate,
  .drawer-backdrop,
  .topbar-icon-button,
  .topbar-link-button,
  .files-panel,
  .composer-selector-group > .composer-agent-pill,
  .composer-menu-panel,
  .context-menu,
  .app-dialog-backdrop,
  .notification-banner,
  .pwa-install-banner {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
