:root {
  color-scheme: light;
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background: #ffffff;
  color: #292b2e;
  font-synthesis: none;
  --muted: #777b80;
  --line: #e7e8ea;
  --accent: #8a6242;
}
* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #c8ccd1 transparent;
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #c8ccd1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #aeb3b9;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
  text-align: center;
}
.startup-card {
  max-width: 360px;
}
.startup-brand {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px;
}
#startup-message {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
#startup-retry {
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--accent);
}
.startup-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: startup-spin 1s linear infinite;
}
@keyframes startup-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .startup-spinner {
    animation: none;
  }
}
#app[data-initializing="true"] {
  visibility: hidden;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
select,
.upload-button {
  cursor: pointer;
}
button {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 10px 14px;
  transition: background 0.15s;
}
button:hover {
  background: #edeef0;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
select {
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 8px;
  max-width: 100%;
  font-size: 13px;
}
.icon-button {
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 22px;
  flex-shrink: 0;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #eaddca;
  color: var(--accent);
  font-weight: 750;
  font-size: 20px;
}
.login-card {
  width: min(420px, calc(100% - 40px));
  margin: min(16vh, 140px) auto 40px;
  text-align: center;
}
.login-card > .brand-mark {
  width: 54px;
  height: 54px;
  font-size: 30px;
  border-radius: 18px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 2px;
  margin-top: 24px;
}
.login-card h1 {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -1px;
  margin: 16px 0;
}
.login-description {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 32px;
}
.login-card form {
  display: grid;
  gap: 12px;
  text-align: left;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 32px #292b2e05;
}
.login-card label {
  font-size: 13px;
  font-weight: 600;
}
#code {
  width: 100%;
  border: 1px solid #d9dde1;
  border-radius: 10px;
  padding: 14px;
  font-size: 24px;
  letter-spacing: 8px;
  text-align: center;
}
.login-card button {
  background: var(--accent);
  color: white;
  padding: 13px;
  font-weight: 600;
}
.login-card button:hover {
  background: #6c4931;
}
#login-error {
  font-size: 13px;
  color: #b13c3c;
  margin: 0;
  line-height: 1.5;
}
#login-error:empty {
  display: none;
}
.app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: #f6f7f8;
  padding: 22px 14px 16px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #edeef0;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.4px;
  padding: 0 8px;
  margin-bottom: 28px;
}
#close-sidebar {
  display: none;
  margin-left: auto;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 550;
  font-size: 13px;
  text-align: left;
  border: 1px solid #e0e2e5;
  background: #ffffff;
  padding: 8px 12px;
  box-shadow: 0 2px 3px #20242a03;
}
.new-chat span {
  font-size: 21px;
  line-height: 1;
}
.sidebar-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 8px 4px;
  font-size: 11px;
  color: var(--muted);
}
#chat-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  gap: 3px;
}
.project-group {
  flex-shrink: 0;
}
.project-group + .project-group {
  margin-top: 10px;
}
.project-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
}
.project-heading::-webkit-details-marker {
  display: none;
}
.project-heading:hover {
  background: #edeef0;
}
.project-heading:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.project-chevron {
  width: 14px;
  height: 14px;
  transition: transform 0.15s;
}
.project-group[open] .project-chevron {
  transform: rotate(90deg);
}
.project-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-count {
  margin-left: auto;
  font-size: 10px;
  font-weight: 400;
  background: #edeef0;
  padding: 1px 5px;
  border-radius: 4px;
}
.project-chats {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 3px;
}
#chat-list button,
#chat-list .chat-link {
  text-align: left;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 11px 12px;
  flex-shrink: 0;
}
#chat-list .chat-link.active {
  background: #e3d4bf;
  color: #6c4931;
  font-weight: 550;
}
.sidebar-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 16px 4px 0;
  margin-top: 16px;
}
.account-open {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12px;
  text-align: left;
}
.account-open:hover {
  background: #f1eee9;
  color: #755436;
}
.account-actions {
  flex-wrap: wrap;
  justify-content: flex-start;
}
.account-actions button {
  font-size: 12px;
  padding: 8px 12px;
}
.account-limit {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.account-limit progress {
  width: 100%;
  height: 6px;
  accent-color: #9d8063;
}
.account-limit span,
.account-limit small {
  display: block;
  font-size: 12px;
  margin: 4px 0;
  color: var(--muted);
}
#logout {
  margin-left: auto;
  font-size: 19px;
}
.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
  position: relative;
}
.chat-header {
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 32px;
}
.chat-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
#chat-title {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.header-subtitle {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#toggle-sidebar {
  display: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
#project-select {
  max-width: 170px;
  color: var(--muted);
}
#toggle-files {
  display: none;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  font-size: 12px;
  white-space: nowrap;
}
#file-count {
  background: #f0f1f3;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
}
#app-status {
  margin: 0 24px;
  color: #a84635;
  font-size: 13px;
  line-height: 1.5;
}
#app-status:not(:empty) {
  background: #fceee4;
  border-radius: 10px;
  padding: 12px 16px;
}
.conversation {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 32px 28px;
  scroll-behavior: smooth;
}
.welcome {
  max-width: 720px;
  margin: clamp(24px, 12vh, 130px) auto 40px;
  text-align: center;
}
.welcome-badge {
  background: #f4ecdf;
  border: 1px solid #e5d5bf;
  color: var(--accent);
  padding: 7px 12px;
  font-size: 11px;
  border-radius: 30px;
}
.welcome h1 {
  margin: 26px 0 12px;
  font-size: clamp(30px, 4vw, 42px);
  letter-spacing: -1.5px;
  font-weight: 550;
}
.welcome > p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 38px;
}
.suggestions button {
  text-align: left;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}
.suggestions button:hover {
  background: #f7f8fa;
  border-color: #d0b797;
}
.suggestions span {
  display: block;
  font-size: 23px;
  color: var(--accent);
  margin-bottom: 18px;
}
.suggestions strong {
  display: block;
  font-size: 13px;
  font-weight: 550;
}
.suggestions small {
  display: block;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
  margin-top: 6px;
}
#messages {
  max-width: 760px;
  margin: auto;
}
article {
  margin: 0 0 32px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
article small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-bottom: 8px;
}
article p {
  white-space: pre-wrap;
  margin: 0;
  font-size: 15px;
}
article.user-message {
  margin-left: auto;
  max-width: 85%;
  width: fit-content;
}
.user-message .message-bubble {
  box-shadow: 0px 12px 25px -20px rgba(0, 0, 0, 0.4);
  background: #eee4d6;
  padding: 14px 20px;
  border-radius: 20px 20px 5px 20px;
}
article.assistant-message {
  padding: 6px 0;
}
article.assistant-message small {
  color: var(--accent);
}
article .message-action {
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  transition: background 0.15s;
}
.message-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 30px;
  margin-top: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.user-message .message-actions {
  justify-content: flex-end;
}
.user-message .message-actions .copy-button {
  margin-right: auto;
}
.message-actions .message-star {
  margin-left: 4px;
}
.message-actions.has-starred {
  opacity: 1;
}
.message-actions.has-starred > :not(.message-star) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.message-actions.has-starred > .message-star {
  pointer-events: auto;
}
article[data-timeline-type="message"]:hover
  .message-actions.has-starred
  > :not(.message-star),
article[data-timeline-type="message"]:focus-within
  .message-actions.has-starred
  > :not(.message-star) {
  opacity: 1;
  pointer-events: auto;
}
.message-time {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  margin-right: 0;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: default;
}
.message-time:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}
.assistant-message .message-time {
  margin-left: 0;
  margin-right: 0;
}
.message-action-separator {
  color: #b2b6bc;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.message-meta {
  margin-left: auto;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
article[data-timeline-type="message"]:hover .message-actions,
article[data-timeline-type="message"]:focus-within .message-actions {
  opacity: 1;
  pointer-events: auto;
}
article .copy-button.copied {
  color: var(--accent);
}
article .message-star[aria-pressed="true"] {
  color: #9d713d;
}
@media (hover: none), (pointer: coarse) {
  article .message-actions {
    opacity: 1;
    pointer-events: auto;
  }
  article .message-actions.has-starred > :not(.message-star) {
    opacity: 1;
    pointer-events: auto;
  }
}
.progress {
  color: var(--muted);
  font-size: 13px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid #dfccb2;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.message-error {
  color: #b13c3c;
}
.composer-area {
  flex-shrink: 0;
  padding: 0 32px 18px;
}
.pending-files {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
}
.pending-file {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 6px 4px 10px;
  background: #f6f4f1;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
}
.pending-file > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#message-form {
  max-width: 760px;
  margin: auto;
  padding: 16px 12px 10px;
  border: 1px solid #dfe2e5;
  border-radius: 24px;
  box-shadow: 0 4px 20px #20242a05;
  background: #ffffff;
}
#message-form:focus-within {
  border-color: #b79a79;
  box-shadow: 0 4px 20px #8a624208;
}
textarea {
  display: block;
  width: 100%;
  min-height: 36px;
  max-height: 180px;
  padding: 0 8px;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  line-height: 1.6;
  font-size: 15px;
}
textarea:focus-visible {
  outline: none;
}
textarea::placeholder {
  color: #92979e;
}
.composer-toolbar,
.composer-tools {
  display: flex;
  align-items: center;
  gap: 5px;
}
.composer-toolbar {
  justify-content: space-between;
  margin-top: 8px;
}
.composer-tools {
  min-width: 0;
}
#model-select {
  max-width: 260px;
  font-size: 12px;
  color: #697079;
}
#send-message {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  background: #79543a;
  color: #fff;
  font-size: 24px;
  flex-shrink: 0;
}
#send-message:hover {
  background: var(--accent);
}
.composer-hint {
  text-align: center;
  font-size: 10px;
  color: #92979e;
  margin: 10px 0 0;
}
#files-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 300px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  padding: 24px 20px;
  overflow: hidden;
  background: #ffffff;
}
.files-heading {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 20px;
}
#files-back {
  display: none;
}
.files-tabs {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #f3f4f5;
}
.files-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border-radius: 8px;
}
.files-tabs button[aria-selected="true"] {
  color: #755436;
  background: #fff;
  box-shadow: 0 1px 4px #20242a0c;
}
.files-tabs #file-count,
.files-tabs #starred-count {
  padding: 1px 4px;
  font-size: 10px;
}
.files-tabs .ui-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.files-heading h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
}
.files-heading p,
.file-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin: 6px 0 0;
}
.upload-button {
  display: block;
  flex-shrink: 0;
  border: 1px dashed #ccb497;
  color: var(--accent);
  padding: 14px;
  text-align: center;
  border-radius: 12px;
  font-size: 12px;
  background: #fafafa;
  position: relative;
  overflow: hidden;
}
#file-upload {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-button:focus-within {
  outline: 2px solid var(--accent);
}
.file-hint {
  flex-shrink: 0;
  margin: 12px 0 20px;
}
#file-list {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  align-content: start;
  gap: 8px;
}
#notes-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 14px;
}
#note-add {
  flex-shrink: 0;
  background: #f6f4f1;
  color: var(--accent);
  font-size: 12px;
  text-align: left;
}
#notes-list {
  overflow-y: auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}
.notes-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.chat-note {
  border: 1px solid #e6e8eb;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.chat-note-text {
  margin: 0 0 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.6;
}
.chat-note-footer {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
}
.chat-note-footer > span {
  flex: 1;
  white-space: pre-line;
}
#note-text {
  width: 100%;
  resize: vertical;
  min-height: 140px;
  margin-top: 8px;
}
#note-error {
  color: #b43737;
  font-size: 12px;
}
.files-tabs button {
  flex: 1 0 auto;
  padding-inline: 3px;
  font-size: 10px;
  gap: 2px;
}
.files-tabs #file-count,
.files-tabs #starred-count {
  padding-inline: 2px;
}
.file-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 12px;
  background: #ffffff;
}
.file-row button {
  padding: 5px;
  font-size: 19px;
  color: #9d713d;
}
.file-row a {
  color: #43484e;
  text-decoration: none;
  font-size: 12px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.file-row a:hover {
  text-decoration: underline;
}
.file-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.file-size,
.file-date,
.file-meta-dot {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.starred-message-card {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.starred-message-jump {
  display: block;
  width: 100%;
  padding: 14px 40px 12px 12px;
  color: #43484e;
  background: transparent;
  text-align: left;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
}
.starred-message-jump:hover {
  background: #faf8f5;
}
.starred-message-preview {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.starred-message-jump time {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 8px;
}
.starred-message-star {
  position: absolute;
  top: 7px;
  right: 7px;
  color: #9d8063;
}
.message-highlight > .message-content,
.message-highlight > .message-bubble {
  outline: 2px solid #b3987a;
  outline-offset: 5px;
  border-radius: 10px;
}
.file-info {
  grid-column: 1 / -1;
}
.file-badge,
.file-format {
  border-radius: 6px;
  background: #eaddca;
  color: #6c4931;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
}
.file-badge {
  background: #eef0f2;
  color: #626970;
}
.file-row .file-star {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
}
.file-row .file-star[aria-pressed="true"] {
  color: #9d713d;
  opacity: 1;
}
.timeline-file {
  width: min(420px, 100%);
  margin: 0 0 24px;
  line-height: 1.5;
}
.timeline-file.uploaded-file {
  margin-left: auto;
}
.timeline-file .file-name {
  font-size: 14px;
  font-weight: 550;
}
.files-empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 12px;
  font-size: 12px;
  line-height: 1.8;
}
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  border-radius: 0;
  background: #20242a30;
}
.panel-backdrop:hover {
  background: #20242a30;
}
@media (max-width: 1100px) {
  #toggle-files,
  #files-back {
    display: inline-flex;
  }
  #toggle-files {
    border: 0;
  }
  #files-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    z-index: 30;
    box-shadow: -10px 0 40px #20242a08;
  }
}
@media (max-width: 760px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.2s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  #toggle-sidebar,
  #close-sidebar {
    display: inline-flex;
  }
  .chat-header {
    padding: 0 14px;
    height: 68px;
    gap: 10px;
  }
  .header-subtitle {
    display: none;
  }
  .header-subtitle[data-assistant="true"] {
    display: block;
  }
  .header-actions {
    gap: 2px;
  }
  #project-select {
    max-width: 100px;
    font-size: 11px;
  }
  #toggle-files {
    padding: 8px;
  }
  .conversation {
    padding: 20px 18px;
  }
  .welcome {
    margin: 55px auto 20px;
  }
  .welcome h1 {
    font-size: 34px;
  }
  .suggestions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 26px;
  }
  .suggestions button {
    padding: 14px 16px;
    display: grid;
    grid-template-columns: 28px 1fr;
    column-gap: 10px;
  }
  .suggestions span {
    grid-row: span 2;
    margin: 0;
    align-self: center;
  }
  .suggestions small {
    margin-top: 3px;
  }
  .composer-area {
    padding: 0 12px 12px;
  }
  #message-form {
    border-radius: 20px;
  }
  article p {
    font-size: 14px;
  }
  article.user-message {
    max-width: 92%;
  }
  .user-message .message-bubble {
    padding: 12px 16px;
  }
  #model-select {
    max-width: 200px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
dialog {
  width: min(420px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 80px #20242a15;
}
dialog::backdrop {
  background: #20242a45;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}
dialog p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
dialog label {
  display: block;
  font-size: 12px;
  font-weight: 550;
  margin: 22px 0 10px;
}
dialog input,
dialog select {
  width: 100%;
  padding: 12px;
  border: 1px solid #d9dde1;
  border-radius: 10px;
  font-size: 14px;
}
dialog #project-select {
  max-width: none;
  font-size: 14px;
  background: #fff;
}
.primary-button {
  width: 100%;
  background: var(--accent);
  color: white;
  margin-top: 16px;
}
.primary-button:hover {
  background: #6c4931;
}
#project-error {
  color: #b13c3c;
}
#project-error:empty {
  display: none;
}
.chat-list-row {
  display: flex;
  align-items: center;
  border-radius: 10px;
}
.chat-list-row:hover,
.chat-list-row:focus-within {
  background: #edeef0;
}
#chat-list .chat-link {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-link-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.chat-badge {
  flex-shrink: 0;
  border-radius: 5px;
  background: #eef0f2;
  color: #626970;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
}
.chat-link-meta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
}
.chat-link-meta .ui-icon {
  width: 14px;
  height: 14px;
}
.chat-running {
  color: #8a6242;
}
.chat-running .ui-icon {
  animation: chat-spin 1.2s linear infinite;
}
@keyframes chat-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chat-running .ui-icon {
    animation: none;
  }
}
#chat-list .chat-rename {
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 17px;
  color: var(--muted);
  opacity: 0;
}
.chat-list-row:hover .chat-rename,
.chat-list-row:focus-within .chat-rename {
  opacity: 1 !important;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}
.dialog-actions .primary-button {
  margin: 0;
  width: auto;
  padding-inline: 24px;
}
.dialog-error {
  color: #b13c3c;
}
.dialog-error:empty {
  display: none;
}
.file-info {
  min-width: 0;
  flex: 1;
}
.file-details {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.file-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 10px;
}
.ai-source {
  color: var(--accent);
  background: #f4ecdf;
  border-radius: 5px;
  padding: 2px 5px;
}
.file-row .file-download {
  font-size: 11px;
  color: var(--accent);
  margin-left: auto;
}
.drag-ready::after,
.drag-blocked::after {
  content: attr(data-drop-message);
  position: absolute;
  inset: 12px;
  z-index: 10;
  border: 2px dashed #8a6242;
  border-radius: 18px;
  background: rgba(247, 240, 231, 0.94);
  color: #6c4931;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 16px;
  font-weight: 550;
  pointer-events: none;
}
.drag-blocked::after {
  background: rgba(246, 247, 248, 0.94);
  border-color: #9ca1a8;
  color: #697079;
}
.chat-main.drag-ready #message-form,
#files-panel.drag-ready .upload-button {
  border-color: #8a6242;
  background: #f4ecdf;
  box-shadow: 0 0 0 3px #8a62421a;
}
#files-panel.drag-ready {
  background: #fbf6ef;
  box-shadow: inset 0 0 0 2px #8a6242;
}
.sidebar-logo {
  object-fit: contain;
  flex-shrink: 0;
}
.chat-link {
  display: block;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}
.ui-icon {
  display: block;
  flex-shrink: 0;
  vertical-align: middle;
}
.markdown-body {
  min-width: 0;
  overflow-wrap: anywhere;
}
.markdown-body .code-block {
  margin: 14px 0;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #e1e4e8;
  border-radius: 12px;
  overflow: hidden;
  background: #f8f9fa;
}
.code-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  background: #eef0f2;
  font: 11px system-ui;
  color: #626970;
}
.code-copy,
.diagram-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 5px;
  font-size: 11px;
  background: transparent;
  color: inherit;
}
.code-copy .ui-icon {
  width: 14px;
  height: 14px;
}
.markdown-body .code-block pre {
  margin: 0;
  border: 0;
  border-radius: 0;
  padding: 14px;
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
}
.markdown-body .code-block pre code {
  white-space: pre;
  overflow-wrap: normal;
}
.markdown-body .markdown-table {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
}
.markdown-body .markdown-table table {
  min-width: 100%;
  width: max-content;
  max-width: none;
}
.markdown-body .math-block {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  padding: 4px 0;
}
.math-block .katex-display {
  margin: 0.6em 0;
  text-align: left;
}
.math-inline .katex {
  font-size: 1.05em;
}
.mermaid-frame {
  display: block;
  width: 100%;
  height: 320px;
  border: 0;
  background: white;
}
.code-block details summary {
  padding: 8px 12px;
  color: #626970;
  font-size: 12px;
  cursor: pointer;
}
.file-preview-dialog {
  width: min(1000px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  height: min(860px, calc(100dvh - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
}
.file-preview-dialog[open] {
  display: flex;
  flex-direction: column;
}
.preview-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid #e1e4e8;
}
.preview-heading h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.preview-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #f3f4f5;
  padding: 16px;
  text-align: center;
}
.preview-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: auto;
}
.pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px;
}
.pdf-toolbar[hidden] {
  display: none;
}
.pdf-page {
  font-size: 12px;
  min-width: 60px;
  text-align: center;
}
.pdf-canvas {
  background: white;
  box-shadow: 0 2px 10px #20242a15;
  max-width: none;
}
.preview-status {
  padding: 8px 16px;
  margin: 0;
  font-size: 13px;
  color: #626970;
}
@media (max-width: 600px) {
  .file-preview-dialog {
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .preview-content {
    padding: 8px;
  }
}
.icon-button .ui-icon {
  width: 18px;
  height: 18px;
}
#send-message .ui-icon {
  width: 20px;
  height: 20px;
}
#send-message > span {
  display: flex;
  align-items: center;
  justify-content: center;
}
.new-chat > span {
  display: flex;
  align-items: center;
}
.file-download {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  flex-shrink: 0;
}
.file-download .ui-icon {
  width: 16px;
  height: 16px;
}
.file-download:hover {
  background: #edeef0;
}
.upload-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.upload-button .ui-icon {
  width: 16px;
  height: 16px;
}
.markdown-body {
  font-size: 15px;
  line-height: 1.75;
}
.markdown-body p {
  white-space: normal;
  margin: 0 0 14px;
}
.markdown-body > :first-child {
  margin-top: 0;
}
.markdown-body > :last-child {
  margin-bottom: 0;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  line-height: 1.35;
  margin: 26px 0 12px;
  font-weight: 650;
}
.markdown-body h1 {
  font-size: 26px;
}
.markdown-body h2 {
  font-size: 22px;
}
.markdown-body h3 {
  font-size: 18px;
}
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: 16px;
}
.markdown-body ul,
.markdown-body ol {
  padding-left: 24px;
  margin: 12px 0 18px;
}
.markdown-body li {
  padding-left: 3px;
  margin: 5px 0;
}
.markdown-body li > p {
  margin-bottom: 6px;
}
.markdown-body blockquote {
  border-left: 3px solid #cbb294;
  padding: 4px 18px;
  color: #697079;
  margin: 18px 0;
  background: #f7f8fa;
  border-radius: 0 8px 8px 0;
}
.markdown-body a {
  color: #79543a;
  text-underline-offset: 3px;
}
.markdown-body code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.88em;
  background: #f0f1f3;
  border-radius: 5px;
  padding: 2px 5px;
}
.markdown-body pre {
  max-width: 100%;
  overflow-x: auto;
  background: #f6f7f8;
  border: 1px solid #e7e8ea;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
  line-height: 1.6;
  white-space: pre;
  overflow-wrap: normal;
}
.markdown-body pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  font-size: 13px;
}
.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.markdown-table {
  max-width: 100%;
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.markdown-body table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.markdown-body th,
.markdown-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.markdown-body th {
  background: #f6f7f8;
  font-weight: 600;
}
.markdown-body tr:last-child td {
  border-bottom: 0;
}
.markdown-body th[align="center"],
.markdown-body td[align="center"] {
  text-align: center;
}
.markdown-body th[align="right"],
.markdown-body td[align="right"] {
  text-align: right;
}
.markdown-body mark {
  background: #f4e4b8;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.markdown-body .markdown-alert {
  border-radius: 6px;
  background: #f5f7f9;
  border-left-color: #69819a;
}
.markdown-body .alert-warning,
.markdown-body .alert-caution {
  background: #fbf6ec;
  border-left-color: #aa7b3f;
}
.markdown-alert-title {
  display: block;
  margin-bottom: 6px;
}
.markdown-body .markdown-details {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid #e2e4e7;
  border-radius: 8px;
}
.markdown-details > summary {
  cursor: pointer;
  font-weight: 600;
}
.markdown-details[open] > summary {
  margin-bottom: 10px;
}
.markdown-body .footnote-reference {
  padding: 0 2px;
}
.markdown-body .markdown-footnotes {
  font-size: 0.9em;
  color: #62666d;
}
.diagram-expand {
  margin-left: auto;
  margin-right: 12px;
}
.markdown-body input[type="checkbox"] {
  accent-color: var(--accent);
  margin-right: 6px;
}
.markdown-fallback {
  white-space: pre-wrap;
}
@media (max-width: 760px) {
  .markdown-body,
  .markdown-body p {
    font-size: 14px;
  }
}
@media (hover: none) {
  #chat-list .chat-rename {
    opacity: 1;
  }
}
.history-status {
  text-align: center;
  color: #777;
  font-size: 12px;
  height: 0;
  margin: 0;
  position: relative;
  top: -18px;
}
.conversation {
  overflow-anchor: none;
  scroll-behavior: auto;
}
.chat-down {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid #dfe2e6;
  border-radius: 50%;
  background: #fff;
  color: #626970;
  width: 40px;
  height: 40px;
  box-shadow: 0 2px 8px #20242a14;
  cursor: pointer;
  z-index: 2;
}
.conversation-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}
.chat-down:hover {
  background: #f6f4f1;
  color: var(--accent);
  border-color: #ccb497;
}
.chat-down:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.chat-down .ui-icon {
  display: block;
  width: 18px;
  height: 18px;
}
@media (pointer: coarse) {
  .chat-down {
    width: 44px;
    height: 44px;
  }
}
.chat-down[hidden] {
  display: none;
}
.account-stat {
  color: #865e40;
  font-size: 13px;
  padding: 8px 12px;
  margin-left: auto;
  text-decoration: none;
}
.account-stat:hover {
  text-decoration: underline;
}
.account-stat[hidden] {
  display: none;
}
.assistant-sidebar {
  padding: 0 12px 8px;
}
#assistants-open {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  color: var(--muted);
  padding: 8px 4px;
  font-size: 13px;
  text-align: left;
}
#assistant-list {
  max-height: 150px;
  overflow-y: auto;
}
.assistant-shortcut {
  display: block;
  width: 100%;
  padding: 7px 10px;
  text-align: left;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assistant-shortcut:hover {
  background: #f2eee8;
}
#assistants-dialog,
#assistant-editor {
  width: min(660px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.assistant-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.assistant-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.assistant-row-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.assistant-row-text strong,
.assistant-row-text small {
  display: block;
}
.assistant-row-text small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}
.assistant-row button,
.assistant-file button {
  font-size: 12px;
  padding: 7px 9px;
}
#assistant-form label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
}
#assistant-form input,
#assistant-form textarea {
  width: 100%;
  box-sizing: border-box;
}
#assistant-instructions {
  resize: vertical;
  min-height: 150px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.assistant-file {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.assistant-file a {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
  color: #865e40;
}
.assistant-file small {
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .assistant-row {
    flex-wrap: wrap;
  }
  .assistant-row-text {
    flex-basis: 100%;
  }
  .assistant-file {
    flex-wrap: wrap;
  }
  .assistant-file a {
    flex-basis: 100%;
  }
}
