:root {
  color-scheme: dark;
  --bg: #212121;
  --sidebar: #171717;
  --surface: #2f2f2f;
  --surface-hover: #383838;
  --surface-active: #424242;
  --border: rgba(255, 255, 255, 0.09);
  --text: #ececec;
  --muted: #a9a9a9;
  --faint: #777;
  --accent: #fff;
  --accent-text: #161616;
  --danger: #ff6b6b;
  --sidebar-width: 278px;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f7f7f8;
  --surface: #f0f0f0;
  --surface-hover: #e8e8e8;
  --surface-active: #dedede;
  --border: rgba(0, 0, 0, 0.1);
  --text: #202123;
  --muted: #6f6f6f;
  --faint: #8a8a8a;
  --accent: #202123;
  --accent-text: #ffffff;
  --danger: #d83a3a;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.loading-screen,
.auth-shell {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.055), transparent 32%),
    #171717;
}

.loading-screen {
  align-content: center;
  gap: 18px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: #f1f1f1;
  color: #151515;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.04em;
}

.loading-dots {
  display: flex;
  gap: 5px;
}

.loading-dots i {
  width: 6px;
  height: 6px;
  animation: pulse 1.1s infinite;
  border-radius: 50%;
  background: #777;
}

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

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

@keyframes pulse {
  0%,
  70%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  35% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.auth-card {
  width: min(100%, 410px);
  padding: 34px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(36, 36, 36, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.auth-card .brand-mark {
  margin: 0 auto 24px;
}

.auth-card h1 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.035em;
  text-align: center;
}

.auth-card > p {
  margin: 10px 0 28px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.field label {
  color: #cfcfcf;
  font-size: 13px;
}

.field input,
.modal-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  background: #191919;
  color: var(--text);
  transition: border-color 0.15s;
}

.field input:focus,
.modal-card input:focus {
  border-color: rgba(255, 255, 255, 0.34);
}

.primary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  font-weight: 650;
  transition:
    transform 0.12s,
    opacity 0.12s;
}

.primary-button:hover {
  opacity: 0.92;
}

.primary-button:active {
  transform: scale(0.985);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.45;
}

.auth-card .primary-button {
  width: 100%;
  margin-top: 22px;
}

.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: #ff8a8a;
  font-size: 13px;
  text-align: center;
}

.app-shell {
  display: grid;
  height: 100%;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.icon-button:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar-actions {
  display: grid;
  gap: 7px;
  margin: 4px 10px 14px;
}

.new-chat-button,
.new-project-button {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  color: #e7e7e7;
}

.new-project-button {
  border-color: rgba(80, 136, 255, 0.42);
  background: rgba(65, 116, 217, 0.11);
  color: #dbe7ff;
}

.new-chat-button:hover,
.new-project-button:hover {
  background: var(--surface);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.projects {
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 0 8px 12px;
}

.project {
  margin-bottom: 5px;
}

.project-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border-radius: 9px;
  color: #cfcfcf;
}

.project-row.active,
.project-row:hover {
  background: #232323;
  color: var(--text);
}

.project-select {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.project-select span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-add-chat {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--faint);
}

.project-add-chat:hover {
  background: var(--surface);
  color: var(--text);
}

.project-block {
  margin-bottom: 2px;
}

.project-toggle {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--faint);
  transition: transform 0.15s ease;
}

.project-toggle.collapsed {
  transform: rotate(-90deg);
}

.project-toggle:hover {
  color: var(--text);
}

.project-chats {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 26px;
}

.project-empty {
  padding: 4px 10px;
}

.chat-list {
  display: grid;
  gap: 2px;
  margin: 2px 0 9px 23px;
}

.chat-row {
  display: flex;
  min-width: 0;
  align-items: center;
  border-radius: 9px;
}

.chat-row.active {
  background: var(--surface);
}

.chat-select {
  min-width: 0;
  flex: 1;
  padding: 9px 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #bdbdbd;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-row.active .chat-select,
.chat-select:hover {
  color: var(--text);
}

.chat-delete {
  display: none;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  margin-right: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
}

.chat-row:hover .chat-delete {
  display: grid;
}

.chat-delete:hover {
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}

.sidebar-account-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle {
  display: flex;
  width: 100%;
  height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.admin-link {
  display: flex;
  width: 100%;
  height: 40px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.admin-link:hover {
  background: var(--surface);
  color: var(--text);
}

.theme-toggle:hover {
  background: var(--surface);
  color: var(--text);
}

.account-info {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  color: #cfcfcf;
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #58c777;
  box-shadow: 0 0 0 3px rgba(88, 199, 119, 0.1);
}

.main {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  display: flex;
  height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
}

.topbar-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-menu {
  display: none;
}

.topbar-controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.model-switcher {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(20, 20, 20, 0.45);
}

.model-button {
  min-width: 54px;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.model-button.active {
  background: var(--surface-active);
  color: var(--text);
}

.reasoning-switcher {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 7px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--faint);
  font-size: 12px;
}

.reasoning-switcher select {
  max-width: 130px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.reasoning-switcher option {
  background: var(--surface);
  color: var(--text);
}

.conversation {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.empty-state {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 80px 24px 170px;
  text-align: center;
}

.empty-state h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 620;
  letter-spacing: -0.04em;
}

.empty-state p {
  max-width: 520px;
  margin: 12px auto 0;
  color: var(--muted);
  line-height: 1.55;
}

.messages {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 22px 22px 170px;
}

.message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 13px;
  margin: 20px 0 30px;
}

.message.user {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  margin-bottom: 18px;
}

.message.user .message-content {
  display: inline-block;
  width: fit-content;
  min-width: 0;
  max-width: min(78%, 620px);
  padding: 8px 12px;
  border-radius: 15px;
  background: var(--surface);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.assistant-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #f1f1f1;
  color: #171717;
  font-size: 12px;
  font-weight: 750;
}

.assistant-body {
  min-width: 0;
  padding-top: 3px;
  line-height: 1.68;
}

.assistant-body p {
  margin: 0 0 15px;
}

.assistant-body h1,
.assistant-body h2,
.assistant-body h3 {
  margin: 25px 0 10px;
  line-height: 1.3;
}

.assistant-body h1 {
  font-size: 22px;
}

.assistant-body h2 {
  font-size: 19px;
}

.assistant-body h3 {
  font-size: 17px;
}

.assistant-body ul,
.assistant-body ol {
  margin: 10px 0 16px;
  padding-left: 24px;
}

.assistant-body li {
  margin: 6px 0;
}

.assistant-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.09);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.assistant-body pre {
  position: relative;
  margin: 15px 0;
  padding: 15px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #151515;
}

.assistant-body pre code {
  padding: 0;
  background: transparent;
  font-size: 13px;
}

.assistant-body a {
  color: #9ecbff;
}

.assistant-body .artifact-link {
  display: flex;
  width: min(100%, 520px);
  min-height: 66px;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-decoration: none;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.assistant-body .artifact-link:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.075);
}

.artifact-link-icon,
.artifact-generation-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: rgba(72, 118, 224, 0.16);
  color: #9dbbff;
}

.artifact-link-label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-link-action {
  color: var(--muted);
  font-size: 13px;
}

.assistant-image {
  width: fit-content;
  max-width: min(100%, 680px);
  margin: 16px 0 20px;
}

.assistant-image a {
  display: block;
}

.assistant-image img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 680px;
  border: 1px solid var(--border);
  border-radius: 14px;
  object-fit: contain;
  background: #171717;
}

.assistant-image figcaption {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.thinking {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.thinking-spinner {
  width: 16px;
  height: 16px;
  animation: spin 0.85s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: #ddd;
  border-radius: 50%;
}

.image-generation-state {
  width: min(100%, 560px);
}

.artifact-generation-state {
  width: min(100%, 520px);
}

.artifact-generation-skeleton {
  position: relative;
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  isolation: isolate;
}

.artifact-generation-skeleton::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  animation: image-shimmer 1.8s ease-in-out infinite;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.025) 38%,
    rgba(255, 255, 255, 0.11) 50%,
    rgba(255, 255, 255, 0.025) 62%,
    transparent 80%
  );
  content: "";
  transform: translateX(-110%);
}

.artifact-generation-lines {
  display: grid;
  width: min(70%, 320px);
  gap: 8px;
}

.artifact-generation-lines i {
  display: block;
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.11);
}

.artifact-generation-lines i:nth-child(2) {
  width: 82%;
}

.artifact-generation-lines i:nth-child(3) {
  width: 58%;
}

.image-generation-caption {
  margin: 12px 0 16px;
  color: var(--muted);
  line-height: 1.45;
}

.image-generation-skeleton {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.11) 1px, transparent 1.5px)
      0 0 / 18px 18px,
    #2d2d2d;
  isolation: isolate;
}

.image-generation-skeleton::before {
  position: absolute;
  z-index: 2;
  inset: 0;
  animation: image-shimmer 1.8s ease-in-out infinite;
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.035) 38%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.035) 62%,
    transparent 80%
  );
  content: "";
  transform: translateX(-110%);
}

.image-generation-skeleton::after {
  position: absolute;
  z-index: 0;
  right: -18%;
  bottom: -14%;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.07),
    transparent 68%
  );
  content: "";
}

.image-generation-mark {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 66px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  transform: translate(-50%, -50%);
}

.image-generation-mark::before {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  content: "";
}

.image-generation-mark::after {
  position: absolute;
  right: 8px;
  bottom: 8px;
  left: 8px;
  height: 24px;
  background: rgba(255, 255, 255, 0.18);
  clip-path: polygon(0 100%, 30% 42%, 48% 68%, 66% 28%, 100% 100%);
  content: "";
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes image-shimmer {
  to {
    transform: translateX(110%);
  }
}

.composer-wrap {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 20px 22px max(22px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 28%);
}

.attachment-preview {
  display: none;
  width: min(100%, 820px);
  margin: 0 auto 9px;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-preview.visible {
  display: flex;
}

.composer {
  position: relative;
  display: flex;
  width: min(100%, 820px);
  align-items: flex-end;
  gap: 7px;
  margin: 0 auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #303030;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  transition:
    border-color 0.15s,
    background 0.15s;
}

.composer.dragging {
  border-color: rgba(255, 255, 255, 0.42);
  background: #383838;
}

.composer-tools {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.composer-end-tools {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
}

.composer-tool-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b6b6b6;
  cursor: pointer;
}

.composer-tool-button:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.composer-tool-button.listening {
  animation: microphone-pulse 1.2s ease-in-out infinite;
  background: rgba(255, 78, 78, 0.2);
  color: #ff7474;
}

.voice-recorder {
  display: none;
  min-width: 0;
}

.composer.voice-recording .voice-recorder {
  display: contents;
}

.composer.voice-recording {
  display: grid;
  min-height: 106px;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: 48px 40px;
  align-items: center;
  column-gap: 4px;
  padding: 9px 12px 8px;
}

.composer.voice-recording .composer-tools {
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.composer.voice-recording .composer-tools .composer-tool-button {
  border-color: transparent;
}

.composer.voice-recording > textarea,
.composer.voice-recording > .composer-end-tools {
  display: none;
}

.voice-waveform {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 1;
  min-width: 0;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  overflow: hidden;
  color: var(--muted);
}

.voice-waveform-bar {
  display: block;
  width: 3px;
  min-width: 3px;
  max-width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.3;
  transition:
    height 90ms linear,
    opacity 140ms ease;
}

.voice-waveform-bar.level-1 {
  height: 3px;
  opacity: 0.22;
}

.voice-waveform-bar.level-2 {
  height: 6px;
  opacity: 0.54;
}

.voice-waveform-bar.level-3 {
  height: 10px;
  opacity: 0.66;
}

.voice-waveform-bar.level-4 {
  height: 15px;
  opacity: 0.72;
}

.voice-waveform-bar.level-5 {
  height: 21px;
  opacity: 0.78;
}

.voice-waveform-bar.level-6 {
  height: 28px;
  opacity: 0.84;
}

.voice-waveform-bar.level-7 {
  height: 35px;
  opacity: 0.9;
}

.voice-waveform-bar.level-8 {
  height: 42px;
  opacity: 0.96;
}

.composer.voice-recording:not(.voice-live) .voice-waveform-bar {
  animation: voice-awaiting 1.4s ease-in-out infinite alternate;
}

.voice-recorder-actions {
  display: flex;
  grid-column: 2;
  grid-row: 2;
  flex: 0 0 auto;
  align-items: center;
  justify-self: end;
  gap: 4px;
}

.voice-recorder-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.voice-recorder-button:hover {
  background: var(--surface-active);
}

.voice-recorder-button:disabled {
  cursor: wait;
  opacity: 0.35;
}

.voice-recorder-button.cancel svg {
  width: 17px;
  height: 17px;
}

.voice-recorder-button.confirm {
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

@keyframes voice-awaiting {
  from {
    height: 3px;
    opacity: 0.16;
  }

  to {
    height: 3px;
    opacity: 0.34;
  }
}

@keyframes microphone-pulse {
  50% {
    box-shadow: 0 0 0 5px rgba(255, 78, 78, 0.1);
  }
}

.composer textarea {
  display: block;
  field-sizing: content;
  min-width: 0;
  width: auto;
  min-height: 28px;
  max-height: min(300px, 44dvh);
  flex: 1;
  padding: 4px 0;
  resize: none;
  overflow-y: hidden;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
}

.composer textarea.is-scrollable {
  overflow-y: auto;
  scrollbar-color: rgba(128, 128, 128, 0.5) transparent;
  scrollbar-width: thin;
}

.composer textarea::placeholder {
  color: #8d8d8d;
}

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f0f0f0;
  color: #171717;
  cursor: pointer;
}

.send-button:disabled {
  background: #4b4b4b;
  color: #8d8d8d;
  cursor: default;
}

.composer-note {
  margin: 8px auto 0;
  color: var(--faint);
  font-size: 11px;
  text-align: center;
}

.attachment-item {
  position: relative;
  min-width: 0;
  max-width: 270px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #292929;
  overflow: hidden;
}

.attachment-item > a {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 8px 34px 8px 9px;
  color: var(--text);
  text-decoration: none;
}

.attachment-item.image > a {
  align-items: flex-start;
}

.attachment-item img {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 8px;
  object-fit: cover;
  background: #171717;
}

.attachment-file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.08);
  color: #cfcfcf;
}

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

.attachment-meta strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 570;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.attachment-item > button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 15, 15, 0.82);
  color: #cfcfcf;
  cursor: pointer;
}

.message-attachments {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

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

.message.user .attachment-item {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
}

.user-text {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
}

.modal-overlay {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.modal-card {
  width: min(100%, 430px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #262626;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.modal-card h2 {
  margin: 0;
  font-size: 21px;
}

.modal-card p {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.secondary-button {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
}

.codex-auth-code {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #171717;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: 380px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #303030;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
}

.sidebar-backdrop {
  display: none;
}

svg {
  display: block;
}

:root[data-theme="light"] .loading-screen,
:root[data-theme="light"] .auth-shell {
  background:
    radial-gradient(circle at 50% 30%, rgba(0, 0, 0, 0.035), transparent 32%),
    #f7f7f8;
}

:root[data-theme="light"] .brand-mark,
:root[data-theme="light"] .assistant-avatar {
  background: #202123;
  color: #ffffff;
}

:root[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .field label,
:root[data-theme="light"] .new-chat-button,
:root[data-theme="light"] .project-row,
:root[data-theme="light"] .chat-select,
:root[data-theme="light"] .account-info,
:root[data-theme="light"] .attachment-file-icon {
  color: var(--text);
}

:root[data-theme="light"] .field input,
:root[data-theme="light"] .modal-card input {
  background: #ffffff;
}

:root[data-theme="light"] .field input:focus,
:root[data-theme="light"] .modal-card input:focus {
  border-color: rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .project-row.active,
:root[data-theme="light"] .project-row:hover {
  background: #ececec;
}

:root[data-theme="light"] .new-project-button {
  border-color: rgba(42, 91, 190, 0.28);
  background: rgba(42, 91, 190, 0.08);
  color: #2851a3;
}

:root[data-theme="light"] .model-switcher {
  background: rgba(245, 245, 245, 0.9);
}

:root[data-theme="light"] .assistant-body code,
:root[data-theme="light"] .attachment-file-icon {
  background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .assistant-body pre,
:root[data-theme="light"] .assistant-image img,
:root[data-theme="light"] .attachment-item img,
:root[data-theme="light"] .codex-auth-code {
  background: #f7f7f8;
}

:root[data-theme="light"] .assistant-body a {
  color: #0969da;
}

:root[data-theme="light"] .assistant-body .artifact-link,
:root[data-theme="light"] .artifact-generation-skeleton {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.025);
  color: var(--text);
}

:root[data-theme="light"] .assistant-body .artifact-link:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.045);
}

:root[data-theme="light"] .artifact-link-icon,
:root[data-theme="light"] .artifact-generation-icon {
  background: rgba(42, 91, 190, 0.1);
  color: #2851a3;
}

:root[data-theme="light"] .artifact-generation-lines i {
  background: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .thinking-spinner {
  border-color: rgba(0, 0, 0, 0.16);
  border-top-color: #555555;
}

:root[data-theme="light"] .image-generation-skeleton {
  background:
    radial-gradient(circle, rgba(0, 0, 0, 0.1) 1px, transparent 1.5px) 0 0 /
      18px 18px,
    #eeeeef;
}

:root[data-theme="light"] .image-generation-skeleton::before {
  background: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.2) 38%,
    rgba(255, 255, 255, 0.78) 50%,
    rgba(255, 255, 255, 0.2) 62%,
    transparent 80%
  );
}

:root[data-theme="light"] .image-generation-skeleton::after {
  background: radial-gradient(circle, rgba(0, 0, 0, 0.055), transparent 68%);
}

:root[data-theme="light"] .image-generation-mark {
  border-color: rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] .image-generation-mark::before {
  background: rgba(0, 0, 0, 0.22);
}

:root[data-theme="light"] .image-generation-mark::after {
  background: rgba(0, 0, 0, 0.16);
}

:root[data-theme="light"] .composer,
:root[data-theme="light"] .attachment-item,
:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .toast {
  background: #ffffff;
}

:root[data-theme="light"] .composer {
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
}

:root[data-theme="light"] .composer.dragging {
  border-color: rgba(0, 0, 0, 0.35);
  background: #f5f5f5;
}

:root[data-theme="light"] .composer-tool-button {
  color: #6f6f6f;
}

:root[data-theme="light"] .composer-tool-button:hover {
  background: rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .composer textarea::placeholder {
  color: #8a8a8a;
}

:root[data-theme="light"] .send-button {
  background: #202123;
  color: #ffffff;
}

:root[data-theme="light"] .send-button:disabled {
  background: #dedede;
  color: #999999;
}

:root[data-theme="light"] .attachment-item > button {
  background: rgba(255, 255, 255, 0.92);
  color: #555555;
}

:root[data-theme="light"] .message.user .attachment-item {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.55);
}

:root[data-theme="light"] .modal-overlay {
  background: rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] .modal-card,
:root[data-theme="light"] .toast {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .image-generation-skeleton::before {
    animation: none;
    transform: none;
  }
}

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

  .sidebar {
    position: fixed;
    z-index: 40;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(86vw, var(--sidebar-width));
    transform: translateX(-102%);
    transition: transform 0.2s ease;
  }

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

  .sidebar-backdrop {
    position: fixed;
    z-index: 35;
    inset: 0;
    display: block;
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
    transition: opacity 0.2s;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 10px;
  }

  .topbar-title {
    flex: 1;
  }

  .topbar-controls {
    gap: 5px;
  }

  .model-button {
    min-width: 46px;
    padding: 0 7px;
  }

  .reasoning-switcher {
    padding: 0 6px;
  }

  .reasoning-switcher > span {
    display: none;
  }

  .reasoning-switcher select {
    max-width: 108px;
  }

  .messages {
    padding-right: 16px;
    padding-left: 16px;
  }

  .message.user .message-content {
    max-width: 88%;
  }

  .image-generation-skeleton {
    border-radius: 20px;
  }

  .composer-wrap {
    padding-right: 10px;
    padding-left: 10px;
  }
}

/* ChatGPT-inspired interface refresh */
:root {
  --bg: #000000;
  --sidebar: #000000;
  --surface: #212121;
  --surface-hover: #1f1f1f;
  --surface-active: #2f2f2f;
  --border: rgba(255, 255, 255, 0.13);
  --text: #f2f2f2;
  --muted: #a7a7a7;
  --faint: #777777;
  --accent: #ffffff;
  --accent-text: #111111;
  --sidebar-width: 260px;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

:root[data-theme="light"] {
  --bg: #ffffff;
  --sidebar: #f9f9f9;
  --surface: #f2f2f2;
  --surface-hover: #ececec;
  --surface-active: #e7e7e7;
  --border: rgba(0, 0, 0, 0.1);
  --text: #181818;
  --muted: #6e6e6e;
  --faint: #9a9a9a;
  --accent: #000000;
  --accent-text: #ffffff;
}

html,
body,
#app {
  min-height: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app-shell {
  min-height: 0;
  height: 100%;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
}

.sidebar-header {
  min-height: 58px;
  padding: 0 14px;
}

.brand {
  gap: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.035em;
}

.sidebar-scroll {
  min-height: 0;
  flex: 1 1 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 8px 20px;
  scrollbar-color: rgba(128, 128, 128, 0.35) transparent;
  scrollbar-width: thin;
}

.sidebar-actions {
  display: block;
  margin: 4px 0 17px;
}

.new-chat-button {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
}

.new-chat-button:hover {
  background: var(--surface-hover);
}

.new-chat-button svg {
  width: 19px;
  height: 19px;
}

.new-project-button {
  display: none;
}

.sidebar-group {
  margin-top: 11px;
}

.pinned-group {
  margin-top: 0;
}

.sidebar-section-title {
  min-height: 34px;
  padding: 7px 10px 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

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

.section-add-button:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.section-add-button svg {
  width: 17px;
  height: 17px;
}

.sidebar-empty {
  padding: 6px 10px 8px;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.35;
}

.projects {
  min-height: auto;
  overflow: visible;
  padding: 0;
}

.project-row,
.chat-row {
  min-height: 38px;
  border-radius: 9px;
  color: var(--text);
}

.project-row {
  gap: 4px;
  padding: 0 4px 0 10px;
}

.project-row.active,
.project-row:hover,
.chat-row.active,
.chat-row:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.project-select {
  gap: 10px;
  padding: 8px 0;
  font-size: 14px;
}

.project-select svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.project-add-chat {
  opacity: 0;
}

.project-row:hover .project-add-chat,
.project-row:focus-within .project-add-chat {
  opacity: 1;
}

.chat-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
}

.chat-row {
  padding-left: 2px;
}

.chat-select {
  padding: 9px 10px;
  color: var(--text);
  font-size: 14px;
}

.chat-row.active .chat-select,
.chat-select:hover {
  color: var(--text);
}

.chat-delete {
  margin-right: 4px;
}

.chat-pin {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.14s ease, background-color 0.14s ease, color 0.14s ease;
}

.chat-row:hover .chat-pin,
.chat-row:focus-within .chat-pin,
.chat-row.active .chat-pin,
.chat-pin.pinned {
  opacity: 1;
}

.chat-pin:hover {
  background: var(--surface);
  color: var(--text);
}

.chat-pin.pinned {
  color: var(--muted);
}

.chat-pin svg {
  width: 17px;
  height: 17px;
}

.pinned-list {
  margin-bottom: 7px;
}

.sidebar-footer {
  flex: 0 0 auto;
  gap: 7px;
  padding: 9px 8px max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--sidebar);
}

.sidebar-utilities {
  display: flex;
  gap: 4px;
}

.admin-link,
.theme-toggle {
  width: auto;
  min-width: 0;
  height: 34px;
  flex: 1;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}

.admin-link:hover,
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-account-row {
  min-height: 48px;
  justify-content: flex-start;
  gap: 9px;
  padding: 4px 4px 4px 7px;
  border-radius: 10px;
}

.sidebar-account-row:hover {
  background: var(--surface-hover);
}

.account-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: #5181d8;
  color: #ffffff;
  font-size: 11px;
  font-weight: 650;
}

.account-info {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
  color: var(--text);
  font-size: 13px;
}

.account-info strong,
.account-info span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-info strong {
  font-weight: 560;
}

.account-info span {
  color: var(--muted);
  font-size: 11px;
}

.sidebar-account-row .icon-button {
  width: 32px;
  height: 32px;
}

.status-dot {
  display: none;
}

.main {
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.topbar {
  min-height: 60px;
  height: 60px;
  padding: 0 18px;
}

.topbar-start {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.topbar-title {
  max-width: 320px;
  color: var(--text);
  font-size: 14px;
  font-weight: 560;
}

.topbar-controls {
  gap: 8px;
}

.model-switcher {
  padding: 3px;
  border: 0;
  border-radius: 12px;
  background: var(--surface);
}

.model-button {
  min-width: 58px;
  height: 32px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
}

.model-button.active {
  background: var(--surface-active);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14);
}

.mobile-reasoning,
.mobile-new-chat {
  display: none;
}

.conversation {
  background: var(--bg);
}

.empty-state {
  min-height: 100%;
  padding: 80px 24px 176px;
}

.empty-state > div {
  transform: translateY(28px);
}

.empty-state h1 {
  font-size: clamp(27px, 3.2vw, 34px);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.empty-state p {
  max-width: 570px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.messages {
  width: min(100%, 768px);
  padding: 34px 18px 178px;
}

.message {
  display: block;
  margin: 24px 0 34px;
}

.message.user {
  margin: 12px 0 34px;
}

.message.user .message-content {
  max-width: min(76%, 580px);
  padding: 9px 14px;
  border-radius: 20px;
  background: var(--surface);
  font-size: 15px;
  line-height: 1.48;
}

.assistant-avatar {
  display: none;
}

.assistant-body {
  padding-top: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.62;
}

.assistant-body p {
  margin: 0 0 16px;
}

.assistant-body > :last-child {
  margin-bottom: 0;
}

.assistant-body h1 {
  font-size: 24px;
}

.assistant-body h2 {
  font-size: 20px;
}

.assistant-body h3 {
  font-size: 17px;
}

.assistant-body pre {
  border-radius: 14px;
  background: #171717;
}

.assistant-image img {
  border-radius: 18px;
}

.thinking {
  font-size: 15px;
}

.composer-wrap {
  padding: 24px 24px max(18px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 32%);
}

.attachment-preview {
  width: min(100%, 768px);
}

.composer {
  width: min(100%, 768px);
  min-height: 58px;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: 29px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.22);
}

.composer-tools,
.composer-end-tools {
  align-items: center;
}

.composer-tool-button {
  width: 40px;
  height: 40px;
  color: var(--text);
}

.composer-tools .composer-tool-button {
  border: 1px solid var(--border);
}

.composer-tool-button:hover {
  background: var(--surface-active);
}

.composer textarea {
  min-height: 28px;
  padding: 3px 4px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.42;
}

.composer textarea::placeholder {
  color: var(--muted);
}

.reasoning-switcher {
  height: 38px;
  gap: 4px;
  padding: 0 3px 0 9px;
  border: 0;
  border-radius: 19px;
  color: var(--muted);
}

.reasoning-switcher > span {
  display: none;
}

.reasoning-switcher select {
  max-width: 116px;
  padding-right: 3px;
  color: var(--muted);
  font-size: 13px;
}

.reasoning-switcher:hover {
  background: var(--surface-active);
}

.send-button {
  width: 40px;
  height: 40px;
  background: var(--accent);
  color: var(--accent-text);
}

.send-button:disabled {
  display: none;
}

.composer-note {
  margin-top: 8px;
  color: var(--faint);
  font-size: 11px;
}

.attachment-item {
  background: var(--surface);
}

.modal-card {
  border-radius: 24px;
  background: var(--surface);
}

:root[data-theme="light"] .project-row.active,
:root[data-theme="light"] .project-row:hover,
:root[data-theme="light"] .chat-row.active,
:root[data-theme="light"] .chat-row:hover {
  background: var(--surface-hover);
}

:root[data-theme="light"] .composer,
:root[data-theme="light"] .attachment-item {
  background: #ffffff;
}

:root[data-theme="light"] .composer {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .composer-tools .composer-tool-button {
  border-color: transparent;
}

:root[data-theme="light"] .assistant-body pre {
  background: #f7f7f8;
}

:root[data-theme="light"] .message.user .message-content {
  background: #f4f4f4;
}

:root[data-theme="light"] .modal-card {
  background: #ffffff;
}

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

  .sidebar {
    width: min(84vw, 350px);
    border-right: 0;
    box-shadow: 18px 0 60px rgba(0, 0, 0, 0.38);
  }

  .sidebar-header {
    min-height: 70px;
    padding: max(12px, env(safe-area-inset-top)) 18px 4px;
  }

  .brand {
    font-size: 23px;
  }

  .sidebar-scroll {
    padding: 8px 13px 24px;
  }

  .sidebar-actions {
    margin-bottom: 21px;
  }

  .new-chat-button {
    height: 48px;
    font-size: 16px;
  }

  .sidebar-group {
    margin-top: 20px;
  }

  .sidebar-section-title {
    min-height: 38px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 15px;
  }

  .project-row,
  .chat-row {
    min-height: 45px;
    border-radius: 12px;
  }

  .project-select,
  .chat-select {
    font-size: 15px;
  }

  .chat-pin {
    width: 34px;
    height: 34px;
    opacity: 1;
  }

  .sidebar-footer {
    padding: 9px 13px max(12px, env(safe-area-inset-bottom));
  }

  .admin-link,
  .theme-toggle {
    height: 38px;
    font-size: 13px;
  }

  .sidebar-account-row {
    min-height: 54px;
  }

  .sidebar-backdrop {
    background: rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(2px);
  }

  .topbar {
    min-height: 64px;
    height: 64px;
    padding: 7px 11px;
  }

  .topbar-start {
    flex: 0 0 auto;
  }

  .topbar-title {
    display: none;
  }

  .mobile-menu,
  .mobile-new-chat {
    display: inline-grid;
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
  }

  .mobile-new-chat {
    margin-left: 1px;
  }

  .topbar-controls {
    min-width: 0;
    margin-left: auto;
    gap: 5px;
  }

  .model-switcher {
    flex: 0 1 auto;
    border-radius: 12px;
  }

  .model-button {
    min-width: 47px;
    height: 30px;
    padding: 0 6px;
    font-size: 12px;
  }

  .mobile-reasoning {
    display: inline-flex;
    height: 36px;
    padding-left: 5px;
    background: var(--surface);
  }

  .mobile-reasoning select {
    max-width: 76px;
    font-size: 12px;
  }

  .desktop-reasoning {
    display: none;
  }

  .empty-state {
    padding: 64px 22px 132px;
  }

  .empty-state > div {
    transform: translateY(12px);
  }

  .empty-state h1 {
    font-size: 27px;
  }

  .empty-state p {
    max-width: 330px;
    font-size: 14px;
  }

  .messages {
    width: 100%;
    padding: 32px 17px 132px;
  }

  .message {
    margin: 22px 0 32px;
  }

  .message.user {
    margin-bottom: 31px;
  }

  .message.user .message-content {
    max-width: 88%;
    padding: 9px 13px;
    border-radius: 19px;
    font-size: 16px;
  }

  .assistant-body {
    font-size: 16px;
    line-height: 1.6;
  }

  .image-generation-skeleton {
    border-radius: 22px;
  }

  .composer-wrap {
    padding: 16px 10px max(11px, env(safe-area-inset-bottom));
  }

  .composer {
    width: 100%;
    min-height: 56px;
    padding: 7px 8px;
    border-radius: 28px;
  }

  .composer textarea {
    max-height: min(220px, 32dvh);
    font-size: 16px;
  }

  .composer.voice-recording {
    min-height: 104px;
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-rows: 46px 40px;
    padding: 9px 8px 8px;
  }

  .voice-waveform {
    height: 44px;
    gap: 2px;
  }

  .voice-recorder-actions {
    gap: 0;
  }

  .composer-tool-button,
  .send-button,
  .voice-recorder-button {
    width: 40px;
    height: 40px;
  }

  .composer-note {
    display: none;
  }

  .attachment-preview {
    margin-bottom: 7px;
  }
}

@media (max-width: 430px) {
  .topbar {
    padding-right: 8px;
    padding-left: 8px;
  }

  .topbar-controls {
    gap: 3px;
  }

  .mobile-menu,
  .mobile-new-chat {
    width: 42px;
    height: 42px;
  }

  .model-button {
    min-width: 44px;
    padding: 0 5px;
  }

  .mobile-reasoning select {
    max-width: 69px;
  }

  .composer {
    gap: 3px;
  }

  .composer textarea {
    padding-right: 1px;
    padding-left: 1px;
  }

}
