:root {
  --bg: #fff;
  --surface: #fff;
  --sidebar: #f7f7f7;
  --text: #222;
  --muted: #777;
  --line: #e5e5e5;
  --hover: #ededed;
  --accent: #222;
  --on-accent: #fff;
  --code: #f6f6f6;
  --user: #f2f2f2;
  --danger: #b43c36;
  font-family:
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #181818;
  --surface: #181818;
  --sidebar: #131313;
  --text: #eee;
  --muted: #999;
  --line: #333;
  --hover: #2a2a2a;
  --accent: #eee;
  --on-accent: #181818;
  --code: #202020;
  --user: #272727;
  --danger: #f18c83;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #181818;
    --surface: #181818;
    --sidebar: #131313;
    --text: #eee;
    --muted: #999;
    --line: #333;
    --hover: #2a2a2a;
    --accent: #eee;
    --on-accent: #181818;
    --code: #202020;
    --user: #272727;
    --danger: #f18c83;
    color-scheme: dark;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button,
input,
textarea,
select {
  font: inherit;
}
button {
  background: none;
  border: 0;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
[hidden] {
  display: none !important;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
  outline-offset: 3px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--text);
}
svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
span[data-icon] {
  display: inline-flex;
  flex-shrink: 0;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  color: var(--muted);
}
.icon-button:hover {
  color: var(--text);
  background: var(--hover);
}
.sidebar {
  width: 230px;
  padding: 22px 12px 12px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  z-index: 10;
}
.brand {
  font-size: 17px;
  font-weight: 600;
  padding: 0 10px;
  margin-bottom: 25px;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  text-align: left;
}
.new-chat:hover {
  background: var(--hover);
}
.search-wrap {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px;
  margin: 12px 0;
  color: var(--muted);
}
.sidebar .search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 12px;
  outline: none;
  padding: 0 !important;
}
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px 0 10px;
  color: var(--muted);
  font-size: 11px;
}
.history-heading .icon-button {
  height: 26px;
  width: 26px;
}
.history-heading svg {
  width: 14px;
  height: 14px;
}
.history-heading .active {
  color: var(--text);
  background: var(--hover);
}
.chat-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.history-group {
  padding: 20px 10px 5px;
  color: var(--muted);
  font-size: 10px;
}
.history-item {
  display: flex;
  align-items: center;
  margin: 2px 0;
  border-radius: 5px;
}
.history-item:hover,
.history-item.active {
  background: var(--hover);
}
.history-open {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 1;
  min-width: 0;
  padding: 10px;
  text-align: left;
  font-size: 12px;
}
.history-open > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-open svg {
  width: 13px;
  height: 13px;
  color: var(--muted);
}
.history-item .icon-button {
  opacity: 0;
  width: 25px;
  height: 25px;
  margin-right: 3px;
}
.history-item:hover .icon-button,
.history-item:focus-within .icon-button,
.history-item.active .icon-button {
  opacity: 1;
}
.history-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  padding: 15px 10px;
}
.sidebar-bottom {
  border-top: 1px solid var(--line);
  padding-top: 9px;
}
.sidebar-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 5px;
  padding: 9px 10px;
  text-align: left;
  font-size: 12px;
  color: var(--muted);
}
.sidebar-link:hover {
  background: var(--hover);
  color: var(--text);
}
.sidebar-link svg {
  width: 15px;
  height: 15px;
}
.main {
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1;
  min-width: 0;
}
.topbar {
  height: 65px;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar strong {
  font-size: 13px;
  font-weight: 500;
}
#toggle-sidebar {
  display: none;
}
.engine-status {
  font-size: 11px;
  color: var(--muted);
}
.engine-status.unavailable {
  color: var(--danger);
}
.engine-status.busy {
  color: var(--warning, #b7791f);
}
.conversation {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}
.main.empty .conversation {
  display: none;
}
.main.empty .composer-area {
  margin-top: auto;
  margin-bottom: auto;
}
.composer-area {
  width: 100%;
  max-width: 820px;
  flex-shrink: 0;
  margin: 0 auto;
  padding: 18px 28px 26px;
}
.composer {
  padding: 13px 13px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.composer:focus-within {
  border-color: var(--muted);
}
.composer textarea {
  resize: none;
  width: 100%;
  display: block;
  min-height: 30px;
  max-height: 190px;
  margin-bottom: 9px;
  padding: 0 3px;
  outline: none;
  border: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.composer-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.reasoning-button {
  padding: 5px 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-size: 11px;
  color: var(--muted);
}
.reasoning-button[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--line);
  background: var(--hover);
}
.composer-state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: var(--muted);
}
.send-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--on-accent);
}
.edit-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px;
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.messages {
  max-width: 820px;
  padding: 22px 28px 25px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 30px;
}
.message {
  min-width: 0;
}
.message-header {
  margin-bottom: 10px;
}
.message-header strong {
  font-size: 12px;
  font-weight: 550;
}
.message[data-role="user"] {
  align-self: flex-end;
  max-width: 88%;
  border-radius: 8px;
  background: var(--user);
  padding: 12px 16px 7px;
}
.message[data-role="user"] .message-body {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.message[data-role="assistant"] .message-body {
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.message-body > :first-child {
  margin-top: 0;
}
.message-body > :last-child {
  margin-bottom: 0;
}
.message-body p {
  margin: 0 0 13px;
}
.message-body h1,
.message-body h2,
.message-body h3,
.message-body h4 {
  font-family: inherit;
  font-weight: 600;
  line-height: 1.4;
  margin: 20px 0 10px;
}
.message-body h1 {
  font-size: 23px;
}
.message-body h2 {
  font-size: 20px;
}
.message-body h3 {
  font-size: 17px;
}
.message-body ol,
.message-body ul {
  padding-left: 23px;
}
.message-body li {
  margin: 4px 0;
}
.message-body blockquote {
  border-left: 2px solid var(--line);
  margin-left: 0;
  padding: 2px 16px;
  color: var(--muted);
}
.message-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px 0;
}
.message-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.message-body table {
  display: block;
  overflow: auto;
  max-width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 12px;
}
.message-body td,
.message-body th {
  border: 1px solid var(--line);
  padding: 8px 11px;
}
.message-body th {
  background: var(--code);
}
code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}
.message-body :not(pre) > code {
  background: var(--code);
  padding: 2px 4px;
  border-radius: 3px;
}
.message-body pre {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 15px 0;
  overflow: hidden;
  line-height: 1.6;
}
.message-body pre code {
  display: block;
  padding: 14px;
  overflow: auto;
  font-size: 12px;
  tab-size: 4;
}
.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 4px 10px;
  font-size: 10px;
  color: var(--muted);
}
.code-copy {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px;
  font-size: 10px;
}
.code-copy svg {
  width: 12px;
  height: 12px;
}
.message-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 9px;
  min-height: 24px;
}
.message-actions .icon-button {
  width: 25px;
  height: 25px;
}
.message-actions svg {
  width: 14px;
  height: 14px;
}
.message[data-role="user"] .message-actions {
  justify-content: flex-end;
  margin: 5px -3px -2px;
}
.message-meta {
  color: var(--muted);
  font-size: 9px;
  margin-left: 8px;
}
.message-error {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--danger);
  margin-top: 12px;
  font-size: 12px;
}
.thinking {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  margin: 0 0 15px;
  font-size: 12px;
}
.thinking summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  list-style: none;
  padding: 9px 12px;
  font-size: 11px;
}
.thinking summary::-webkit-details-marker {
  display: none;
}
.thinking summary::after {
  content: "⌄";
  margin-left: auto;
}
.thinking[open] summary::after {
  content: "⌃";
}
.thinking-content {
  padding: 0 12px 12px;
  white-space: pre-wrap;
  line-height: 1.7;
  max-height: 350px;
  overflow: auto;
  overflow-wrap: anywhere;
}
.stream-indicator {
  padding: 6px 0;
  color: var(--muted);
  font-size: 12px;
}
.attachments,
.message-attachments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.message-attachments {
  margin-top: 10px;
  margin-bottom: 0;
}
.attachments:empty {
  display: none;
}
.attachment-link,
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 11px;
}
.attachment-link svg,
.attachment-chip svg {
  width: 13px;
  height: 13px;
}
.attachment-link span,
.attachment-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment-chip button {
  display: flex;
  padding: 1px;
}
.attachment-chip.pending {
  opacity: 0.5;
}
.scroll-bottom {
  position: absolute;
  bottom: 155px;
  left: 50%;
  z-index: 2;
  background: var(--surface);
  border: 1px solid var(--line);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: 90vw;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 12px;
}
.dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  width: 410px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.dialog::backdrop {
  background: #0006;
}
.dialog h2 {
  font-size: 18px;
  font-weight: 550;
  margin: 0 0 13px;
}
.dialog h3 {
  font-size: 13px;
  font-weight: 550;
  margin: 22px 0 9px;
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.muted,
.field-note {
  color: var(--muted);
  line-height: 1.6;
  font-size: 11px;
}
.settings-dialog {
  width: 560px;
}
.tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  margin: 5px 0 18px;
}
.tabs button {
  padding: 10px 0;
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font-size: 12px;
}
.tabs button[aria-selected="true"] {
  color: var(--text);
  border-color: var(--text);
}
form label,
section > label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  margin: 16px 0;
}
input:not([type="checkbox"]),
select,
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  outline-color: var(--muted);
}
form textarea {
  line-height: 1.6;
  resize: vertical;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 9px !important;
}
.checkbox-label input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  margin: 0;
}
.form-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 5px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 12px;
}
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}
.secondary-button:hover {
  background: var(--hover);
}
.text-button {
  padding: 4px;
  color: var(--muted);
  font-size: 11px;
}
.text-button:hover {
  color: var(--text);
}
.danger,
.form-error {
  color: var(--danger) !important;
}
.form-error {
  line-height: 1.6;
  font-size: 12px;
}
.copy-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.copy-field code {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.api-model-line {
  color: var(--muted);
  font-size: 11px;
  display: flex;
  gap: 9px;
}
.api-key-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 12px 0;
}
.api-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 9px;
}
.api-key strong {
  font-size: 12px;
  font-weight: 500;
}
.api-key small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 5px;
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form input {
  min-width: 0;
}
.new-key {
  padding: 12px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 5px;
}
.new-key strong {
  font-size: 12px;
  font-weight: 550;
}
.new-key .text-button {
  margin-top: 8px;
}
.example-tabs {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
  border-bottom: 1px solid var(--line);
}
.example-tabs button {
  padding: 8px 2px;
  color: var(--muted);
  font-size: 11px;
}
.example-tabs .active {
  color: var(--text);
  border-bottom: 1px solid var(--text);
}
.example-tabs .icon-button {
  margin-left: auto;
}
.api-example {
  background: var(--code);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px;
  font-size: 11px;
  line-height: 1.7;
  overflow: auto;
}
.manage-dialog {
  width: 350px;
}
.manage-dialog form {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.manage-actions {
  display: flex;
  flex-direction: column;
  padding-top: 10px;
}
.manage-actions button,
.manage-actions a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 11px 5px;
  border-radius: 5px;
  font-size: 12px;
}
.manage-actions button:hover,
.manage-actions a:hover {
  background: var(--hover);
}
.manage-actions svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.sidebar-scrim {
  display: none;
}
.loading-panel,
.error-panel {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}
.error-panel {
  color: var(--danger);
}
.error-panel button {
  margin-top: 12px;
}
@media (max-width: 800px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 240px;
    transform: translateX(-100%);
  }
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: #0006;
    z-index: 9;
  }
  #toggle-sidebar {
    display: inline-flex;
  }
  .topbar {
    height: 58px;
    padding: 0 14px;
  }
  .topbar-left,
  .topbar-right {
    gap: 8px;
  }
  .composer-area {
    padding: 14px 18px 20px;
  }
  .messages {
    padding: 20px 22px;
  }
  .history-item .icon-button {
    opacity: 1;
  }
}
@media (max-width: 480px) {
  .topbar {
    padding: 0 10px;
  }
  .topbar strong {
    font-size: 12px;
  }
  .engine-status {
    font-size: 10px;
  }
  .composer-area {
    padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  }
  .composer textarea {
    font-size: 16px;
  }
  .composer-state {
    max-width: 110px;
    font-size: 9px;
  }
  .messages {
    padding: 18px 16px;
    gap: 26px;
  }
  .message[data-role="user"] {
    max-width: 93%;
  }
  .dialog {
    padding: 20px;
  }
  .field-grid {
    gap: 10px;
  }
  .inline-form {
    flex-wrap: wrap;
  }
  .inline-form input {
    flex: 1;
    min-width: 150px;
  }
  .scroll-bottom {
    bottom: 140px;
  }
}

/* The experiment ledger uses the existing chat palette in both themes. */
.configuration-chip { border:1px solid var(--line); background:var(--sidebar); color:var(--text); border-radius:20px; padding:6px 12px; font-size:12px; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
.experiments-dialog { width:min(1440px,96vw); max-width:1440px; max-height:94dvh; padding:24px; overflow-y:auto; }
.experiments-dialog .dialog-header { position:sticky; top:-24px; padding:16px 0; background:var(--surface); z-index:3; }
.lab-eyebrow { font-size:10px; letter-spacing:.15em; color:var(--muted); margin:0 0 5px; }
.lab-intro { color:var(--muted); line-height:1.6; margin:0 0 16px; }
.lab-selection { padding:12px 16px; background:var(--sidebar); border:1px solid var(--line); border-radius:10px; line-height:1.6; margin-bottom:18px; }
.lab-tabs { display:flex; gap:8px; border-bottom:1px solid var(--line); margin-bottom:20px; overflow-x:auto; }
.lab-tabs button { white-space:nowrap; color:var(--muted); background:none; border:0; border-bottom:2px solid transparent; padding:12px; cursor:pointer; }
.lab-tabs button[aria-selected="true"] { color:var(--text); border-bottom-color:var(--text); }
.lab-featured { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin:16px 0 24px; }
.lab-card { text-align:left; display:flex; flex-direction:column; align-items:flex-start; gap:9px; border:1px solid var(--line); background:var(--surface); color:var(--text); padding:18px; border-radius:12px; cursor:pointer; }
.lab-card:hover { background:var(--sidebar); border-color:var(--muted); }
.lab-card>span { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
.lab-card strong { font-size:18px; letter-spacing:-.025em; }
.lab-card small { color:var(--muted); line-height:1.5; }
.lab-card em { font-style:normal; font-size:12px; margin-top:auto; padding-top:8px; }
.lab-filters { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:16px 0 12px; }
.experiments-dialog label { display:flex; flex-direction:column; gap:7px; color:var(--muted); font-size:12px; }
.lab-search { flex:1; min-width:220px; }
.experiments-dialog input:not([type="checkbox"]), .experiments-dialog select, .experiments-dialog textarea { border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:7px; padding:10px; font:inherit; font-size:13px; min-height:38px; }
.lab-filters select { max-width:360px; }
.experiments-dialog textarea { resize:vertical; line-height:1.6; }
.lab-note { color:var(--muted); font-size:12px; line-height:1.7; }
.lab-table-wrap { width:100%; overflow-x:auto; border:1px solid var(--line); border-radius:10px; }
.lab-table { width:100%; border-collapse:collapse; text-align:left; font-size:12px; line-height:1.55; }
.lab-table th { background:var(--sidebar); font-size:10px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); white-space:nowrap; }
.lab-table th,.lab-table td { padding:14px; border-bottom:1px solid var(--line); vertical-align:top; }
.lab-table tr:last-child td { border-bottom:0; }
.lab-table td:first-child { min-width:230px; max-width:340px; }
.lab-table td:nth-child(3),.lab-table td:nth-child(4) { min-width:130px; }
.lab-table td small { display:block; color:var(--muted); font-size:10px; line-height:1.5; margin-top:3px; }
.lab-rate { margin-bottom:10px; }
.lab-rate strong { font-size:16px; font-variant-numeric:tabular-nums; }
.lab-badge { display:table; margin:7px 0; padding:2px 7px; border-radius:5px; background:var(--sidebar); border:1px solid var(--line); font-size:10px; }
.lab-bad { color:var(--danger); }
.lab-muted { color:var(--muted); }
.lab-quality { min-width:240px; max-width:330px; }
.lab-quality>div { margin-bottom:8px; }
.lab-selected-row { background:var(--sidebar); }
.lab-detail { margin-top:10px; }
.lab-detail summary,.lab-report summary,.lab-batch-result summary { cursor:pointer; color:var(--text); }
.lab-detail pre { overflow:auto; max-width:340px; padding:10px; font-size:10px; background:var(--code); }
.lab-values { white-space:pre-line; }
.measurements-table td { max-width:390px; overflow-wrap:anywhere; }
.lab-report,.lab-batch-result { margin:12px 0; padding:16px; border:1px solid var(--line); border-radius:10px; }
.lab-report article { padding:20px 6px 0; line-height:1.75; overflow-x:auto; }
.lab-report article table { border-collapse:collapse; min-width:500px; }
.lab-report article td,.lab-report article th { padding:8px; border:1px solid var(--line); }
.lab-report pre,.lab-batch-result pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.lab-checkbox { flex-direction:row!important; align-items:center; margin:14px 0; }
.lab-run-actions { display:flex; align-items:center; gap:12px; margin:16px 0; }
#lab-run-status { color:var(--muted); font-size:12px; }
@media(max-width:800px) { .experiments-dialog { width:100vw; max-width:100vw; max-height:100dvh; height:100dvh; padding:16px; border-radius:0; } .experiments-dialog .dialog-header { top:-16px; } .lab-featured { grid-template-columns:1fr; } .lab-filters { align-items:stretch; } .lab-filters label { flex:1 1 140px; } .lab-filters select { max-width:100%; width:100%; } .configuration-chip { max-width:135px; font-size:10px; } .topbar-left { flex-wrap:wrap; } }

/* Seinari brand: Lato, red #be1236 (bright red #d6203f on charcoal #1a1a1a), black, white and silver; round-capped controls. */
@font-face { font-family: "Lato"; font-weight: 400; font-display: swap; src: url("./fonts/lato-400.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 700; font-display: swap; src: url("./fonts/lato-700.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-weight: 900; font-display: swap; src: url("./fonts/lato-900.woff2") format("woff2"); }
:root {
  font-family: "Lato", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #ffffff; --surface: #ffffff; --sidebar: #f4f4f4; --text: #16181d; --muted: #56585d;
  --line: #dedede; --hover: #ececec; --accent: #be1236; --on-accent: #ffffff; --code: #f4f4f4; --user: #f4f4f4;
  --danger: #be1236; --warning: #56585d; --red: #be1236;
}
:root[data-theme="dark"] {
  --bg: #1a1a1a; --surface: #1a1a1a; --sidebar: #141414; --text: #ffffff; --muted: #a6a6a6;
  --line: #333333; --hover: #2a2a2a; --accent: #d6203f; --on-accent: #ffffff; --code: #242424; --user: #262626;
  --danger: #d6203f; --warning: #c0c0c0; --red: #d6203f;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #1a1a1a; --surface: #1a1a1a; --sidebar: #141414; --text: #ffffff; --muted: #a6a6a6;
    --line: #333333; --hover: #2a2a2a; --accent: #d6203f; --on-accent: #ffffff; --code: #242424; --user: #262626;
    --danger: #d6203f; --warning: #c0c0c0; --red: #d6203f;
  }
}
body { font-size: 15px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.brand .mark { width: auto; height: 28px; color: var(--red); fill: none; stroke: none; flex: none; }
.brand .mark path[fill="none"] { stroke: currentColor; }
.topbar strong { font-weight: 700; }
.message-header strong, .message-body h1, .message-body h2, .message-body h3, .message-body h4 { font-weight: 700; }
button:focus-visible, a:focus-visible { outline-color: var(--red); }
.icon-button, .new-chat, .history-item, .sidebar-link, .reasoning-button, .send-button, .text-button,
.primary-button, .secondary-button, .danger-button, .configuration-chip, .lab-badge, .scroll-bottom { border-radius: 999px; }
.new-chat { font-weight: 700; padding: 10px 14px; }
.history-open, .sidebar-link { padding-left: 14px; padding-right: 14px; }
.send-button { width: 34px; height: 34px; }
.reasoning-button { padding: 5px 11px; }
.reasoning-button[aria-pressed="true"] { color: var(--red); border-color: var(--red); background: transparent; }
.composer { border-radius: 22px; padding: 14px 14px 9px 18px; }
.composer:focus-within { border-color: var(--red); }
.message[data-role="user"] { border-radius: 18px; }
.engine-status.busy { color: var(--warning); }
.topbar-mark { display: none; }
.topbar-mark .mark { width: auto; height: 26px; color: var(--red); fill: none; stroke: none; }
@media (max-width: 800px) { .topbar-mark { display: inline-flex; } .topbar-left { gap: 8px; } }
@media (max-width: 800px) { .topbar { height: auto; min-height: 56px; padding-top: 8px; padding-bottom: 8px; } }
@media (max-width: 480px) { .topbar-mark .mark { height: 22px; } .topbar-left { gap: 6px; } .topbar-right { gap: 6px; } }

/* No grey or blue box when a control is tapped on Android: focus rings and press styles are the feedback. */
html, a, button, input, select, textarea, summary, label, [role="button"] { -webkit-tap-highlight-color: transparent; }
