:root {
  color-scheme: light;
  --page: #ffffff;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f0f0ed;
  --text: #101011;
  --copy: #5f5f63;
  --muted: #929297;
  --line: #ddddda;
  --line-strong: #ccccca;
  --accent: #3fcfc5;
  --accent-dark: #0d8179;
  --accent-soft: rgba(63, 207, 197, 0.14);
  --sidebar: #ffffff;
  --shadow: 0 24px 70px rgba(20, 20, 20, 0.09);
  --chat-viewport-height: 100dvh;
  --chat-viewport-top: 0px;
  --chat-viewport-middle: 50dvh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 320px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--text);
  overscroll-behavior: none;
}

body {
  height: 100%;
}

button,
select,
textarea {
  font: inherit;
}

button,
a,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.chat-app {
  position: absolute;
  top: var(--chat-viewport-top);
  left: 0;
  display: grid;
  width: 100%;
  height: var(--chat-viewport-height);
  min-height: 0;
  grid-template-columns: 272px minmax(0, 1fr);
  overflow: hidden;
}

.chat-sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  height: 100%;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  padding: 22px 16px 16px;
  background: var(--sidebar);
}

.sidebar-top {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 6px;
}

.wordmark {
  color: #111;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.wordmark-ai {
  font-style: italic;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(20, 20, 20, 0.06);
}

.sidebar-close,
.sidebar-open {
  display: none;
}

.sidebar-dismiss-icon,
.sidebar-edge-reveal {
  display: none;
}

.new-chat-button {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 10px;
  margin-top: 23px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 0 14px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.new-chat-button:hover {
  border-color: #b8b8b5;
  box-shadow: 0 8px 24px rgba(20, 20, 20, 0.06);
  transform: translateY(-1px);
}

.conversation-search {
  display: grid;
  min-height: 42px;
  grid-template-columns: 18px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 7px 0 12px;
  background: var(--surface);
  color: var(--muted);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.conversation-search:focus-within {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.conversation-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.conversation-search input::placeholder {
  color: var(--muted);
}

.conversation-search input::-webkit-search-cancel-button {
  display: none;
}

.conversation-search button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.conversation-search button:hover {
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.conversation-section {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  margin-top: 20px;
  overflow: hidden;
}

.sidebar-label {
  margin: 0 9px 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.conversation-list {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  gap: 3px;
  padding-right: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.conversation-list::-webkit-scrollbar {
  width: 5px;
}

.conversation-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--line-strong);
}

.conversation-item {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 10px;
  padding: 3px 3px 3px 11px;
  color: #4f4f53;
  transition: background-color 150ms ease, color 150ms ease;
}

.conversation-item.is-active {
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.conversation-title {
  overflow: hidden;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.conversation-delete {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
}

.conversation-delete:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
  .conversation-item:hover {
    background: rgba(20, 20, 20, 0.06);
    color: var(--text);
  }
}

@media (hover: hover) and (pointer: fine) and (min-width: 1201px) {
  .conversation-item:hover .conversation-delete {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (hover: hover) and (pointer: fine) and (max-width: 1200px) {
  .conversation-item:hover .conversation-title {
    width: calc(100% - 52px);
    background: var(--surface-soft);
  }

  .conversation-item:hover .conversation-delete {
    opacity: 1;
    pointer-events: auto;
  }
}

.conversation-delete:hover {
  background: rgba(20, 20, 20, 0.07);
  color: var(--text);
}

@media (min-width: 1201px) {
  .conversation-title {
    transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .conversation-item.is-swiping .conversation-title {
    transform: translateX(var(--conversation-swipe-x, 0px));
    transition: none;
  }

  .conversation-item.is-delete-revealed .conversation-delete,
  .conversation-item.is-swiping .conversation-delete {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 861px) and (max-width: 1200px) {
  .conversation-item {
    position: relative;
    display: block;
    min-height: 38px;
    overflow: hidden;
    padding: 0;
    background: var(--sidebar);
    touch-action: pan-y;
  }

  .conversation-item.is-active {
    background: var(--sidebar);
  }

  .conversation-title {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    height: 38px;
    align-items: center;
    padding: 0 11px;
    background: var(--sidebar);
    line-height: 1.2;
    transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 150ms ease;
    touch-action: pan-y;
  }

  .conversation-item.is-active .conversation-title {
    background: var(--surface-soft);
  }

  .conversation-delete {
    position: absolute;
    z-index: 1;
    inset: 0 0 0 auto;
    width: 52px;
    height: auto;
    border-radius: 0 10px 10px 0;
    background: #111111;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 100ms ease;
  }

  .conversation-delete:hover {
    background: #111111;
    color: #ffffff;
  }

  .conversation-item.is-delete-revealed .conversation-title {
    width: calc(100% - 52px);
  }

  .conversation-item.is-delete-revealed .conversation-delete,
  .conversation-item.is-swiping .conversation-delete {
    opacity: 1;
    pointer-events: auto;
  }

  .conversation-item.is-swiping .conversation-title {
    width: calc(100% + var(--conversation-swipe-x, 0px));
    transform: none;
    transition: none;
  }
}

.conversation-empty {
  margin: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.sidebar-bottom {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.sidebar-link {
  display: flex;
  min-height: 39px;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
  padding: 0 10px;
  color: #656569;
  font-size: 12px;
  font-weight: 550;
}

.sidebar-link:hover,
.sidebar-link.is-active {
  background: rgba(20, 20, 20, 0.055);
  color: var(--text);
}

.theme-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.theme-icon {
  flex: 0 0 auto;
}

.theme-icon-sun {
  display: none;
}

.sidebar-scrim {
  display: none;
}

@media (min-width: 861px) {
  .chat-app {
    transition: grid-template-columns 240ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .chat-sidebar {
    width: 272px;
    transition: opacity 180ms ease, transform 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 180ms ease;
  }

  .sidebar-close {
    display: inline-grid;
  }

  .sidebar-collapse-icon {
    display: block;
  }

  :root.sidebar-collapsed .chat-app {
    grid-template-columns: minmax(0, 1fr);
  }

  :root.sidebar-collapsed .chat-sidebar {
    position: fixed;
    inset: var(--chat-viewport-top) auto auto 0;
    z-index: 40;
    height: var(--chat-viewport-height);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-101%);
  }

  :root.sidebar-collapsed.sidebar-peeking .chat-sidebar {
    box-shadow: 22px 0 70px rgba(20, 20, 20, 0.14);
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  .sidebar-edge-reveal {
    position: fixed;
    inset: var(--chat-viewport-top) auto auto 0;
    z-index: 39;
    width: 20px;
    height: var(--chat-viewport-height);
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: default;
    opacity: 0;
    pointer-events: none;
  }

  :root.sidebar-collapsed .sidebar-edge-reveal {
    display: grid;
    place-items: center;
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-edge-reveal span {
    display: grid;
    width: 18px;
    height: 42px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 0 999px 999px 0;
    background: transparent;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 140ms ease, transform 140ms ease, background 140ms ease, border-color 140ms ease;
  }

  .sidebar-edge-reveal:hover span,
  .sidebar-edge-reveal:focus-visible span {
    border-color: var(--line);
    background: var(--surface);
    opacity: 1;
    transform: translateX(0);
  }
}

.chat-main {
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 66px minmax(0, 1fr) auto;
  overflow: hidden;
  background: var(--page);
}

.chat-topbar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border-bottom: 0;
  padding: 0 24px;
  background: transparent;
  backdrop-filter: none;
}

.model-picker {
  display: inline-flex;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 7px 10px;
  background: transparent;
  color: #3f3f42;
}

.model-picker select {
  min-width: 0;
  max-width: 280px;
  border: 0;
  outline: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 9px;
}

.code-button {
  min-height: 38px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.code-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--text);
  padding: 0 14px;
  background: var(--text);
  color: #fff;
  cursor: pointer;
}

.code-button:disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: #a6a6a9;
  cursor: not-allowed;
}

.conversation {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.empty-state {
  display: grid;
  width: min(780px, calc(100% - 40px));
  min-height: 100%;
  align-content: center;
  justify-items: center;
  margin: 0 auto;
  padding: 48px 0 38px;
  text-align: center;
}

.message-list {
  width: min(820px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 38px;
}

.message {
  display: flex;
  width: 100%;
  padding: 13px 0;
}

.message + .message {
  border-top: 0;
}

.message-assistant {
  justify-content: flex-start;
}

.message-user {
  justify-content: flex-end;
}

.message-body {
  min-width: 0;
  max-width: 100%;
}

.message-assistant .message-body {
  width: 100%;
  padding: 0 6px;
}

.message-user .message-body {
  width: fit-content;
  max-width: min(78%, 640px);
  border: 1px solid rgba(205, 205, 201, 0.9);
  border-radius: 18px 18px 5px 18px;
  padding: 10px 14px;
  background: #e9e9e6;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.025);
}

.message-content {
  color: #303033;
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.message-user .message-content {
  color: #272729;
  line-height: 1.58;
}

.message-content p {
  margin: 0 0 12px;
}

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

.message-content a {
  color: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.message-content a:hover,
.message-content a:focus-visible {
  color: var(--accent-dark);
  text-decoration-color: currentColor;
}

.message-content code {
  border-radius: 5px;
  padding: 2px 5px;
  background: #e9e9e6;
  font-family: "Roboto Mono", monospace;
  font-size: 0.88em;
}

.message-content pre {
  overflow-x: auto;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #1d1d1e;
  color: #ededeb;
}

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

.message-error .message-content {
  color: #a23838;
}

.message-upgrade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100%, 620px);
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.message-upgrade a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 14px;
  background: var(--text);
  color: var(--page);
  font-weight: 700;
  text-decoration: none;
}

.message-upgrade a:hover,
.message-upgrade a:focus-visible {
  opacity: 0.82;
}

@media (max-width: 620px) {
  .message-upgrade {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .message-upgrade a {
    justify-content: center;
  }
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.message-attachment {
  display: grid;
  min-width: 52px;
  min-height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #efefed;
  color: var(--muted);
  font-size: 10px;
}

.message-attachment img {
  display: block;
  width: min(180px, 34vw);
  max-height: 180px;
  object-fit: cover;
}

.message-content.is-live {
  white-space: pre-wrap;
}

.stream-word {
  animation: stream-ink-reveal 360ms cubic-bezier(0.2, 0.72, 0.24, 1) both;
}

@keyframes stream-ink-reveal {
  0% {
    opacity: 0;
    filter: blur(3.5px);
  }
  55% { opacity: 0.82; }
  100% {
    opacity: 1;
    filter: blur(0);
  }
}

.message-content.is-thinking p {
  display: inline-block;
  margin: 0;
  background: linear-gradient(105deg, #a5a5a8 0 40%, #171719 48%, #171719 52%, #a5a5a8 60% 100%);
  background-size: 300% 100%;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: thinking-spotlight 1.65s linear infinite;
}

@keyframes thinking-spotlight {
  0% { background-position: 100% 50%; }
  100% { background-position: -50% 50%; }
}

.composer-shell {
  position: relative;
  z-index: 8;
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 18px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--page) 16px);
}

.composer-title {
  display: none;
}

.composer-brand-mark {
  display: none;
}

.quick-prompts {
  display: grid;
  width: min(560px, calc(100% - 28px));
  gap: 4px;
  margin: 0 auto 16px;
}

.quick-prompts[hidden] {
  display: none;
}

.quick-prompts button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: fit-content;
  border: 0;
  border-radius: 12px;
  padding: 8px 10px;
  background: transparent;
  color: #68686b;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.quick-prompts button:hover {
  background: rgba(20, 20, 20, 0.045);
  color: var(--text);
  transform: translateX(2px);
}

.quick-prompts svg {
  flex: 0 0 auto;
}

.composer {
  display: grid;
  width: min(544px, 100%);
  min-height: 58px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--surface);
  box-shadow: none;
  margin-inline: auto;
  transition: width 180ms ease, min-height 180ms ease, border-radius 180ms ease, padding 180ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within,
.composer.is-expanded,
.composer.has-attachments {
  width: 100%;
  min-height: 116px;
  grid-template-rows: minmax(42px, auto) auto auto;
  align-items: end;
  border-color: #a9a9a6;
  border-radius: 24px;
  padding: 14px 12px 10px;
  box-shadow: none;
}

.attachment-input {
  display: none;
}

.composer-tool {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #555558;
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease;
}

.composer-tool:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.composer-tool:hover {
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.attachment-button {
  grid-column: 1;
}

.composer textarea {
  display: block;
  grid-column: 2;
  width: 100%;
  min-height: calc(1.55em + 4px);
  max-height: 180px;
  resize: none;
  border: 0;
  outline: 0;
  align-self: center;
  padding: 0;
  overflow-y: hidden;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.composer:focus-within textarea,
.composer.is-expanded textarea,
.composer.has-attachments textarea {
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: start;
  padding: 0 4px 8px;
}

.composer textarea::placeholder {
  color: #929297;
}

.composer:not(:focus-within):not(.is-expanded):not(.has-attachments) textarea {
  height: 24px !important;
  min-height: 24px;
  max-height: 24px;
  padding: 0;
  line-height: 24px;
}

.composer-bottom {
  display: flex;
  grid-column: 3;
  min-height: 34px;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.dictation-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: transparent;
  color: #555558;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.dictation-button:hover {
  background: rgba(20, 20, 20, 0.055);
  color: #000;
}

.dictation-button.is-listening {
  background: #000;
  color: #fff;
  animation: dictation-pulse 1.2s ease-in-out infinite;
}

.dictation-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

@keyframes dictation-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0); }
}

.composer-model-picker {
  position: relative;
  display: none;
  width: min(250px, calc(100% - 42px));
  max-width: none;
  margin-left: auto;
  -webkit-tap-highlight-color: transparent;
}

.model-picker-trigger {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  border: 0;
  border-radius: 0;
  padding: 4px 0;
  outline: 0;
  background: transparent;
  color: #3f3f42;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  text-align: right;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.model-picker-trigger > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-picker-trigger svg {
  flex: 0 0 auto;
  transition: transform 160ms ease;
}

.composer-model-picker.is-open .model-picker-trigger svg {
  transform: rotate(180deg);
}

.model-picker-trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.model-menu-backdrop,
.model-menu-handle {
  display: none;
}

.model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: 40;
  width: min(300px, calc(100vw - 32px));
  max-height: min(430px, calc(100dvh - 190px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(207, 207, 203, 0.94);
  border-radius: 22px;
  padding: 7px;
  background: rgba(255, 255, 253, 0.97);
  box-shadow: 0 22px 60px rgba(20, 20, 20, 0.16), 0 3px 12px rgba(20, 20, 20, 0.06);
  opacity: 0;
  transform: translateY(7px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: opacity 140ms ease, transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.composer-model-picker.is-open .model-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.model-menu-option {
  display: grid;
  width: 100%;
  min-height: 50px;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 15px;
  padding: 8px 11px;
  outline: 0;
  background: transparent;
  color: #242426;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 120ms ease;
}

.model-menu-option:hover,
.model-menu-option:focus-visible {
  background: rgba(20, 20, 20, 0.055);
}

.model-menu-option[aria-selected="true"] {
  background: rgba(63, 207, 197, 0.1);
}

.model-menu-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.model-menu-copy strong,
.model-menu-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-menu-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.model-menu-copy small {
  color: #858589;
  font-size: 11px;
}

.model-menu-check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  color: #168c84;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
}

.model-menu-option[aria-selected="true"] .model-menu-check {
  opacity: 1;
}

.composer:focus-within .attachment-button,
.composer.is-expanded .attachment-button,
.composer.has-attachments .attachment-button {
  grid-column: 1;
  grid-row: 3;
}

.composer:focus-within .composer-bottom,
.composer.is-expanded .composer-bottom,
.composer.has-attachments .composer-bottom {
  grid-column: 2 / -1;
  grid-row: 3;
}

.composer:focus-within .composer-model-picker,
.composer.is-expanded .composer-model-picker,
.composer-model-picker.is-open,
.composer.has-attachments .composer-model-picker {
  display: inline-flex;
}

.attachment-tray {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 2px 4px 8px;
  overflow-x: auto;
}

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

.attachment-chip {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
  background: #efefed;
}

.attachment-chip img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  object-fit: cover;
}

.attachment-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid #fff;
  border-radius: 999px;
  padding: 0;
  background: #222;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.send-button {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #181819;
  color: #fff;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.send-button .voice-icon {
  display: none;
}

.send-button.is-voice-launcher {
  background: #000;
  color: #fff;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
}

.send-button.is-voice-launcher:hover {
  background: #000;
  transform: scale(1.035);
}

.send-button.is-voice-launcher .voice-icon {
  display: block;
}

.send-button.is-voice-launcher .send-icon,
.send-button.is-voice-launcher .stop-icon {
  display: none;
}

.send-button:disabled {
  background: #dededb;
  color: #a9a9a6;
  cursor: not-allowed;
}

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

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

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

.voice-stage[hidden] {
  display: none;
}

.voice-stage {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  min-width: 320px;
  min-height: 100dvh;
  place-items: center;
  overflow: hidden;
  padding: max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background: #fff;
  color: var(--text);
}

.voice-stage-close {
  position: absolute;
  top: max(20px, calc(env(safe-area-inset-top) + 10px));
  right: 22px;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #dededb;
  border-radius: 999px;
  padding: 0;
  background: #fff;
  color: #303033;
  cursor: pointer;
}

.voice-stage-content {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.voice-stage-kicker {
  margin: 0 0 34px;
  color: #79797d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.voice-stage-ai {
  font-style: italic;
}

.voice-orb {
  display: flex;
  width: clamp(154px, 25vw, 204px);
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 50%;
  background: #000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
  transform: translateZ(0);
  transition: background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.voice-orb span {
  width: 4px;
  height: 30px;
  border-radius: 999px;
  background: #fff;
  transform-origin: center;
}

.voice-orb span:nth-child(2),
.voice-orb span:nth-child(4) {
  height: 48px;
}

.voice-orb span:nth-child(3) {
  height: 66px;
}

.voice-stage.is-connecting .voice-orb span {
  animation: voice-bar-thinking 1s ease-in-out infinite alternate;
}

.voice-stage.is-connecting .voice-orb span:nth-child(2) { animation-delay: -0.2s; }
.voice-stage.is-connecting .voice-orb span:nth-child(3) { animation-delay: -0.4s; }
.voice-stage.is-connecting .voice-orb span:nth-child(4) { animation-delay: -0.6s; }
.voice-stage.is-connecting .voice-orb span:nth-child(5) { animation-delay: -0.8s; }

.voice-stage.is-speaking .voice-orb {
  animation: voice-orb-speaking 900ms ease-in-out infinite;
}

.voice-stage.is-speaking .voice-orb span {
  animation: voice-bar-speaking 560ms ease-in-out infinite alternate;
}

.voice-stage.is-speaking .voice-orb span:nth-child(2) { animation-delay: -0.12s; }
.voice-stage.is-speaking .voice-orb span:nth-child(3) { animation-delay: -0.24s; }
.voice-stage.is-speaking .voice-orb span:nth-child(4) { animation-delay: -0.36s; }
.voice-stage.is-speaking .voice-orb span:nth-child(5) { animation-delay: -0.48s; }

.voice-stage.is-error .voice-orb {
  background: #202022;
  box-shadow: 0 20px 54px rgba(20, 20, 20, 0.16);
}

@keyframes voice-orb-speaking {
  0%, 100% { transform: scale(1); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2); }
  50% { transform: scale(1.055); box-shadow: 0 30px 92px rgba(0, 0, 0, 0.32); }
}

@keyframes voice-bar-speaking {
  from { transform: scaleY(0.45); }
  to { transform: scaleY(1.12); }
}

@keyframes voice-bar-thinking {
  from { opacity: 0.55; transform: scaleY(0.75); }
  to { opacity: 1; transform: scaleY(1); }
}

.voice-stage-status {
  min-height: 1.5em;
  margin: 20px 0 0;
  color: #202022;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 550;
  letter-spacing: -0.02em;
}

.voice-stage-meta {
  margin: -4px 0 0;
  color: #8a8a8e;
  font-size: 12px;
}

.voice-stage-end {
  position: absolute;
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  left: 50%;
  min-height: 46px;
  border: 1px solid #d8d8d5;
  border-radius: 999px;
  padding: 0 22px;
  background: #fff;
  color: #353538;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transform: translateX(-50%);
}

body.voice-stage-open .chat-app {
  visibility: hidden;
}

.composer-note {
  margin: 9px 0 0;
  color: #a3a3a6;
  font-size: 9px;
  text-align: center;
}

@media (min-width: 621px) {
  .code-button,
  .quick-prompts,
  .composer-note {
    display: none !important;
  }

  .chat-main {
    position: relative;
  }

  .composer-shell {
    display: grid;
    width: 100%;
    justify-items: center;
    margin: 0;
    padding: 14px 24px 28px;
    background: transparent;
  }

  .composer {
    justify-self: center;
  }

  .composer:not(.has-attachments):not(.is-multiline):focus-within,
  .composer.is-expanded:not(.has-attachments):not(.is-multiline) {
    width: min(544px, 100%);
    min-height: 58px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: none;
    align-items: center;
    column-gap: 10px;
    border-radius: 999px;
    padding: 8px 10px;
  }

  .composer:not(.has-attachments):not(.is-multiline):focus-within textarea,
  .composer.is-expanded:not(.has-attachments):not(.is-multiline) textarea {
    grid-column: 2;
    grid-row: auto;
    height: 24px !important;
    min-height: 24px;
    max-height: 24px;
    align-self: center;
    padding: 0;
    overflow: hidden;
    line-height: 24px;
  }

  .composer:not(.has-attachments):not(.is-multiline):focus-within .attachment-button,
  .composer.is-expanded:not(.has-attachments):not(.is-multiline) .attachment-button {
    grid-column: 1;
    grid-row: auto;
  }

  .composer:not(.has-attachments):not(.is-multiline):focus-within .composer-bottom,
  .composer.is-expanded:not(.has-attachments):not(.is-multiline) .composer-bottom {
    grid-column: 3;
    grid-row: auto;
  }

  .composer:not(.has-attachments):not(.is-multiline):focus-within .composer-model-picker,
  .composer.is-expanded:not(.has-attachments):not(.is-multiline) .composer-model-picker {
    width: min(210px, 28vw);
  }

  .composer.is-multiline:not(.has-attachments) {
    width: min(544px, 100%);
    min-height: 106px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(38px, auto) auto;
    align-items: end;
    column-gap: 10px;
    border-radius: 27px;
    padding: 13px 10px 9px;
  }

  .composer.is-multiline:not(.has-attachments) textarea {
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 28px;
    max-height: min(360px, 42vh);
    align-self: start;
    padding: 0 4px 8px;
    overflow-x: hidden;
    overflow-y: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
  }

  .composer.is-multiline:not(.has-attachments) .attachment-button {
    grid-column: 1;
    grid-row: 2;
  }

  .composer.is-multiline:not(.has-attachments) .composer-bottom {
    grid-column: 2 / -1;
    grid-row: 2;
  }

  .composer.is-multiline:not(.has-attachments) .composer-model-picker {
    width: min(210px, 28vw);
  }

  .chat-main.is-empty-chat .composer-shell {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(860px, calc(100% - 48px));
    margin: 0;
    padding: 0;
    transform: translate(-50%, -50%);
  }

  .chat-main.is-empty-chat .composer-title {
    display: block;
    margin: 0 0 24px;
    color: var(--text);
    font-size: clamp(24px, 2.2vw, 34px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.15;
    text-align: center;
  }

  .chat-main.is-empty-chat .composer-brand-mark {
    display: block;
    margin: 0 0 14px;
    color: var(--text);
    font-size: 39px;
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.82;
    text-align: center;
  }
}

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

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

.dialog-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(20, 20, 20, 0.42);
  backdrop-filter: blur(6px);
}

.dialog-card {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 34px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.dialog-eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dialog-card h2 {
  max-width: 390px;
  margin: 0;
  font-size: 31px;
  font-weight: 450;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.dialog-card > p:not(.dialog-eyebrow) {
  margin: 18px 0 0;
  color: var(--copy);
  font-size: 14px;
  line-height: 1.65;
}

.dialog-command {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: #59595d;
}

.dialog-command code {
  font-family: "Roboto Mono", monospace;
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 12px;
  font-weight: 650;
}

.primary-button {
  border: 1px solid var(--text);
  background: var(--text);
  color: #fff;
  cursor: pointer;
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--copy);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  max-width: min(360px, calc(100% - 44px));
  border: 1px solid #303031;
  border-radius: 999px;
  padding: 11px 15px;
  background: #1d1d1e;
  color: #fff;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 860px) {
  .conversation-search input {
    font-size: 16px;
  }

  .conversation-list {
    padding-right: 0;
    scrollbar-width: none;
  }

  .conversation-list::-webkit-scrollbar {
    display: none;
  }

  .conversation-item {
    position: relative;
    display: block;
    min-height: 38px;
    overflow: hidden;
    padding: 0;
    background: var(--sidebar);
    touch-action: pan-y;
  }

  .conversation-item.is-active {
    background: var(--sidebar);
  }

  .conversation-title {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    height: 38px;
    align-items: center;
    padding: 0 11px;
    background: var(--sidebar);
    line-height: 1.2;
    transition: width 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 150ms ease;
    touch-action: pan-y;
  }

  .conversation-item.is-active .conversation-title {
    background: var(--surface-soft);
  }

  .conversation-delete {
    position: absolute;
    z-index: 1;
    inset: 0 0 0 auto;
    width: 52px;
    height: auto;
    border-radius: 0 10px 10px 0;
    background: #111111;
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 100ms ease;
  }

  .conversation-delete:hover {
    background: #111111;
    color: #ffffff;
  }

  .conversation-item.is-delete-revealed .conversation-title {
    width: calc(100% - 52px);
  }

  .conversation-item.is-delete-revealed .conversation-delete,
  .conversation-item.is-swiping .conversation-delete {
    opacity: 1;
    pointer-events: auto;
  }

  .conversation-item.is-swiping .conversation-title {
    width: calc(100% + var(--conversation-swipe-x, 0px));
    transition: none;
  }

  body.sidebar-visible {
    overflow: hidden;
  }

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

  .chat-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, calc(100% - 48px));
    box-shadow: none;
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  body.sidebar-visible .chat-sidebar {
    box-shadow: 20px 0 70px rgba(20, 20, 20, 0.2);
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 15;
    display: block;
    border: 0;
    background: rgba(20, 20, 20, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
  }

  body.sidebar-visible .sidebar-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-close,
  .sidebar-open {
    display: inline-grid;
  }

  .sidebar-collapse-icon {
    display: none;
  }

  .sidebar-dismiss-icon {
    display: block;
  }

  .chat-topbar {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 7px;
    padding: 0 14px;
  }

  .chat-topbar .sidebar-open {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .chat-topbar .sidebar-open:hover {
    background: transparent;
  }

}

@media (max-width: 620px) {
  .chat-main {
    position: relative;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .quick-prompts {
    display: none !important;
  }

  .chat-main.is-empty-chat .composer-shell {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(544px, calc(100% - clamp(48px, 15vw, 72px)));
    margin: 0;
    padding: 0;
    background: transparent;
    transform: translate(-50%, -50%);
  }

  .chat-main.is-empty-chat .composer-title {
    display: block;
    margin: 0 0 20px;
    color: var(--text);
    font-size: clamp(19px, 6vw, 28px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
  }

  .chat-main.is-empty-chat .composer-brand-mark {
    display: block;
    margin: 0 0 12px;
    color: var(--text);
    font-size: 35px;
    font-weight: 800;
    letter-spacing: -0.065em;
    line-height: 0.82;
    text-align: center;
  }

  .chat-main.is-empty-chat .composer {
    width: 100%;
  }

  .chat-topbar {
    position: fixed;
    inset: 12px auto auto 12px;
    display: block;
    width: auto;
    border: 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .chat-topbar .sidebar-open {
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .chat-topbar .sidebar-open:hover {
    background: transparent;
  }

  .chat-topbar .topbar-actions {
    display: none;
  }

  .composer-model-picker {
    width: min(230px, calc(100% - 42px));
    max-width: none;
    padding: 0;
  }

  .model-picker-trigger {
    font-size: 12px;
  }

  .model-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: block;
    border: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.24);
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(9px) saturate(0.82);
    -webkit-backdrop-filter: blur(9px) saturate(0.82);
    transition: opacity 180ms ease;
  }

  .composer-model-picker.is-open .model-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .model-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 80;
    width: auto;
    height: min(68dvh, 620px);
    max-height: calc(var(--chat-viewport-height) - 24px);
    border-radius: 32px;
    padding: 10px 10px 14px;
    background: #ffffff;
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.3), 0 3px 18px rgba(0, 0, 0, 0.1);
    transform: translateY(calc(100% + 32px)) scale(0.985);
    transform-origin: bottom center;
    backdrop-filter: blur(30px) saturate(1.08);
    -webkit-backdrop-filter: blur(30px) saturate(1.08);
    transition: opacity 180ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .composer-model-picker.is-open .model-menu {
    transform: translateY(0) scale(1);
  }

  .model-menu-handle {
    position: sticky;
    top: -10px;
    z-index: 2;
    display: grid;
    height: 30px;
    place-items: center;
    margin: -2px -2px 2px;
    background: inherit;
  }

  .model-menu-handle span {
    display: block;
    width: 46px;
    height: 4px;
    border-radius: 999px;
    background: #a8a8aa;
  }

  .model-menu-option {
    min-height: 54px;
    border-radius: 18px;
    padding: 9px 14px;
  }

  .model-menu-copy strong {
    font-size: 14px;
  }

  .model-menu-copy small {
    font-size: 12px;
  }

  .message-list {
    padding-top: 70px;
  }

  .code-button {
    width: 38px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .empty-state {
    width: min(100% - 28px, 520px);
    padding: 32px 0 24px;
  }

  .message-list {
    width: calc(100% - 28px);
    padding: 28px 0 20px;
  }

  .message {
    padding: 10px 0;
  }

  .message-assistant .message-body {
    padding: 0 4px;
  }

  .message-user .message-body {
    max-width: 84%;
    padding: 9px 13px;
  }

  .message-content {
    font-size: 13px;
    line-height: 1.67;
  }

  .composer-shell {
    width: calc(100% - 20px);
    padding: 10px 0 max(10px, env(safe-area-inset-bottom));
  }

  .quick-prompts {
    width: calc(100% - 28px);
    gap: 3px;
    margin-bottom: 12px;
  }

  .quick-prompts button {
    gap: 13px;
    padding: 7px 8px;
    font-size: 14px;
  }

  .composer {
    width: calc(100% - 44px);
    min-height: 56px;
    border-radius: 999px;
    column-gap: 7px;
    padding: 8px 9px;
  }

  .composer:focus-within,
  .composer.is-expanded,
  .composer.has-attachments {
    width: 100%;
    min-height: 114px;
    border-radius: 24px;
    padding: 14px 10px 9px;
  }

  .composer textarea {
    font-size: 16px;
    line-height: 1.25;
  }

  .composer-note {
    display: none;
  }

  .dialog-card {
    border-radius: 20px;
    padding: 28px 22px 22px;
  }

  .dialog-card h2 {
    padding-right: 22px;
    font-size: 27px;
  }

  .dialog-actions {
    display: grid;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000;
  --panel: #0c0c0d;
  --surface: #171718;
  --surface-soft: #202022;
  --text: #f7f7f5;
  --copy: #b8b8bd;
  --muted: #85858b;
  --line: #29292c;
  --line-strong: #3a3a3e;
  --accent-dark: #67ded6;
  --accent-soft: rgba(63, 207, 197, 0.18);
  --sidebar: #09090a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.54);
}

:root[data-theme="dark"] .wordmark {
  color: var(--text);
}

:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .composer-tool:hover,
:root[data-theme="dark"] .dictation-button:hover,
:root[data-theme="dark"] .quick-prompts button:hover,
:root[data-theme="dark"] .sidebar-link:hover,
:root[data-theme="dark"] .sidebar-link.is-active,
:root[data-theme="dark"] .conversation-item:hover,
:root[data-theme="dark"] .conversation-item.is-active,
:root[data-theme="dark"] .conversation-delete:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
}

:root[data-theme="dark"] .new-chat-button:hover {
  border-color: #55555a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .conversation-search button:hover {
  background: rgba(255, 255, 255, 0.09);
}

:root[data-theme="dark"] .conversation-item,
:root[data-theme="dark"] .sidebar-link {
  color: #aaaab0;
}

@media (max-width: 1200px) {
  :root[data-theme="dark"] .conversation-item,
  :root[data-theme="dark"] .conversation-item.is-active,
  :root[data-theme="dark"] .conversation-title {
    background: var(--sidebar);
  }

  :root[data-theme="dark"] .conversation-item.is-active .conversation-title {
    background: var(--surface-soft);
  }

  :root[data-theme="dark"] .conversation-item:hover .conversation-title {
    background: rgba(255, 255, 255, 0.09);
  }

  :root[data-theme="dark"] .conversation-delete,
  :root[data-theme="dark"] .conversation-delete:hover {
    background: #f7f7f5;
    color: #090909;
  }
}

:root[data-theme="dark"] .chat-topbar {
  border-bottom-color: transparent;
  background: transparent;
}

:root[data-theme="dark"] .model-picker,
:root[data-theme="dark"] .model-picker-trigger {
  color: #d7d7da;
}

:root[data-theme="dark"] .code-button {
  border-color: #f4f4f2;
  background: #f4f4f2;
  color: #090909;
}

:root[data-theme="dark"] .code-button:disabled {
  border-color: var(--line);
  background: var(--surface-soft);
  color: #6f6f74;
}

:root[data-theme="dark"] .message-user .message-body {
  border-color: #36363a;
  background: #171718;
  box-shadow: none;
}

:root[data-theme="dark"] .message-content,
:root[data-theme="dark"] .message-user .message-content {
  color: #e8e8e6;
}

:root[data-theme="dark"] .message-content.is-thinking p {
  background-image: linear-gradient(105deg, #55555a 0 40%, #ffffff 48%, #ffffff 52%, #55555a 60% 100%);
}

:root[data-theme="dark"] .message-content code,
:root[data-theme="dark"] .message-attachment,
:root[data-theme="dark"] .attachment-chip {
  background: #222224;
}

:root[data-theme="dark"] .message-error .message-content {
  color: #ff9e9e;
}

:root[data-theme="dark"] .message-upgrade {
  background: #151516;
}

:root[data-theme="dark"] .message-upgrade a {
  background: #f4f4f1;
  color: #000000;
}

:root[data-theme="dark"] .composer-shell {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--page) 16px);
}

:root[data-theme="dark"] .quick-prompts button {
  color: #a9a9ae;
}

:root[data-theme="dark"] .composer:focus-within,
:root[data-theme="dark"] .composer.is-expanded,
:root[data-theme="dark"] .composer.has-attachments {
  border-color: #55555a;
}

:root[data-theme="dark"] .composer-tool,
:root[data-theme="dark"] .dictation-button {
  color: #c3c3c7;
}

:root[data-theme="dark"] .composer textarea::placeholder {
  color: #ababaf;
}

:root[data-theme="dark"] .dictation-button.is-listening {
  background: #f7f7f5;
  color: #050505;
}

:root[data-theme="dark"] .model-menu {
  border-color: rgba(61, 61, 65, 0.96);
  background: #000000;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.58), 0 3px 12px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .model-menu-option {
  color: #ededeb;
}

:root[data-theme="dark"] .model-menu-option:hover,
:root[data-theme="dark"] .model-menu-option:focus-visible {
  background: rgba(255, 255, 255, 0.075);
}

:root[data-theme="dark"] .model-menu-option[aria-selected="true"] {
  background: rgba(63, 207, 197, 0.15);
}

:root[data-theme="dark"] .model-menu-copy small {
  color: #9a9aa0;
}

:root[data-theme="dark"] .model-menu-check {
  color: #67ded6;
}

:root[data-theme="dark"] .attachment-remove {
  border-color: #171718;
  background: #f2f2f0;
  color: #090909;
}

:root[data-theme="dark"] .send-button,
:root[data-theme="dark"] .send-button.is-voice-launcher,
:root[data-theme="dark"] .send-button.is-voice-launcher:hover {
  background: #f7f7f5;
  color: #050505;
  box-shadow: none;
}

:root[data-theme="dark"] .send-button:disabled {
  background: #2a2a2d;
  color: #6d6d72;
}

:root[data-theme="dark"] .voice-stage {
  background: #000;
  color: var(--text);
}

:root[data-theme="dark"] .voice-stage-close,
:root[data-theme="dark"] .voice-stage-end {
  border-color: #38383c;
  background: #171718;
  color: #e9e9e7;
}

:root[data-theme="dark"] .voice-stage-kicker,
:root[data-theme="dark"] .voice-stage-meta {
  color: #939398;
}

:root[data-theme="dark"] .voice-stage-status {
  color: #f5f5f3;
}

:root[data-theme="dark"] .voice-orb {
  background: #f7f7f5;
  box-shadow: 0 24px 70px rgba(255, 255, 255, 0.12);
}

:root[data-theme="dark"] .voice-orb span {
  background: #000;
}

:root[data-theme="dark"] .voice-stage.is-error .voice-orb {
  background: #d4d4d2;
  box-shadow: 0 20px 54px rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .voice-stage.is-speaking .voice-orb {
  animation-name: voice-orb-speaking-dark;
}

@keyframes voice-orb-speaking-dark {
  0%, 100% { transform: scale(1); box-shadow: 0 24px 70px rgba(255, 255, 255, 0.12); }
  50% { transform: scale(1.055); box-shadow: 0 30px 92px rgba(255, 255, 255, 0.2); }
}

:root[data-theme="dark"] .dialog-backdrop {
  background: rgba(0, 0, 0, 0.72);
}

:root[data-theme="dark"] .dialog-command {
  color: #c7c7cb;
}

:root[data-theme="dark"] .primary-button {
  border-color: #f7f7f5;
  background: #f7f7f5;
  color: #050505;
}

:root[data-theme="dark"] .toast {
  border-color: #d9d9d7;
  background: #f4f4f2;
  color: #080808;
}

:root[data-theme="dark"] .theme-icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-icon-sun {
  display: block;
}

@media (max-width: 860px) {
  :root[data-theme="dark"] .chat-topbar .sidebar-open {
    border-color: transparent;
    background: transparent;
    color: var(--text);
  }

  :root[data-theme="dark"] .chat-topbar .sidebar-open:hover {
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
