.topbar-actions { display: flex; gap: 4px; }
.topbar-actions .icon-btn { min-width: 44px; min-height: 44px; }
.side-kicker {
  margin: 14px 8px 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rg-muted);
}
.side-link.on { background: var(--rg-surface-2); font-weight: 700; }
.sidebar-footer {
  margin-top: auto;
  padding: 8px 4px max(8px, env(safe-area-inset-bottom));
  border-top: 0;
  background: transparent;
  flex-shrink: 0;
}
.sidebar-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rg-text);
  color: #fff;
  font-weight: 700;
}
.user-info { min-width: 0; flex: 1; }
.user-name, .user-email { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-email { color: var(--rg-muted); font-size: 12px; }
.user-settings-btn { border: 0; background: transparent; color: inherit; min-width: 44px; min-height: 44px; }
#chat-options-menu {
  position: absolute;
  right: 8px;
  top: 48px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
  box-shadow: var(--rg-shadow);
}
#chat-options-menu button { text-align: left; border: 0; background: transparent; padding: 10px 12px; min-height: 44px; }
#memory-capsule {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--rg-bg, #F5F7FA);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#memory-capsule[hidden] { display: none; }
#memory-capsule header { display: flex; align-items: center; gap: 8px; }
#memory-list { flex: 1; }
#view-studio .CodeMirror,
#view-studio .CodeMirror-gutters {
  background: #0d1117;
  border-right-color: #242938;
  color: #e6edf3;
}
#view-studio .CodeMirror-linenumber { color: #6e7681; padding: 0 8px 0 4px; }
#view-studio .CodeMirror-cursor { border-left: 2px solid #58a6ff; }
.studio-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; gap: 8px; flex-wrap: wrap; }
.studio-tabs { display: inline-flex; background: var(--rg-surface-2, #f0f2f5); padding: 3px; border-radius: 999px; gap: 2px; }
.quick-toggle[hidden] { display: none; }
.studio-tabs button {
  padding: 5px 14px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--rg-muted);
  border-radius: 999px;
}
.studio-files { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 8px; }
.studio-files button, #studio-zip {
  flex: 0 0 auto;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
}
.studio-files button.on { background: var(--rg-text); color: #fff; border-color: var(--rg-text); }
#studio-copy, #studio-clear {
  font-size: 12px;
  color: var(--rg-text);
  background: var(--rg-surface-2);
  border: 1px solid var(--rg-line);
  padding: 5px 12px;
  border-radius: 8px;
}
.btn-run-primary, #coll-new-note, #project-create-sheet {
  background: var(--rg-text);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 13px;
  width: fit-content;
}
.studio-terminal { border: 1px solid #242938; border-radius: 12px; background: #0d0f14; color: #d7deea; padding: 8px; }
.studio-terminal-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px solid #242938; font-size: 12px; color: #8b949e; }
#studio-console { background: transparent; color: inherit; border: 0; margin: 0; min-height: 36px; }
.attach-kicker { margin: 12px 16px 4px; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rg-muted); }
.project-templates { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.project-templates button {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--rg-text);
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
}
.project-grid { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.artifact-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  list-style: none;
  padding: 0;
  margin: 0;
}
.project-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--rg-surface);
}
.artifact-card-page {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--rg-line);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: var(--rg-surface);
}
.artifact-preview {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--rg-surface-2, #f3f3f0);
  color: var(--rg-muted);
}
.artifact-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 8px;
}
.artifact-card-page strong { font-size: 15px; font-weight: 650; }
.artifact-time { font-size: 12px; font-weight: 500; color: var(--rg-muted); }
.artifact-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}
.artifact-actions button { flex: 1 1 0; }
.artifact-card-page button {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface-2);
}
.project-card .project-open {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--rg-text);
  text-align: left;
  cursor: pointer;
}
.project-card .project-del {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface-2);
  color: var(--rg-text);
  cursor: pointer;
}
.coll-filters, #artifact-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.coll-filters::-webkit-scrollbar, #artifact-filters::-webkit-scrollbar { display: none; }
#artifact-filters button, .coll-filters button {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
  font-size: 12px;
  color: var(--rg-text);
  flex: 0 0 auto;
}
#artifact-filters button.on, .coll-filters button.on { background: var(--rg-text); color: #fff; border-color: var(--rg-text); }
.project-drop, .coll-empty {
  border: 1px dashed var(--rg-line);
  border-radius: 14px;
  padding: 16px;
  color: var(--rg-muted);
}
.hub-search-box { display: flex; align-items: center; gap: 8px; }
.hub-search-input { flex: 1; }
.hub-card.live { box-shadow: none; }
.hub-connected-badge {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--rg-muted, #6b7280);
  background: transparent;
  padding: 0;
}
.zen-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--rg-text);
  animation: zen 2s ease-in-out infinite;
}
@keyframes zen { 50% { transform: scale(1.6); opacity: 0.45; } }
.refine-bubble { position: absolute; z-index: 5; display: flex; gap: 4px; flex-wrap: wrap; background: #fff; border: 1px solid var(--rg-line); border-radius: 12px; padding: 6px; }
.refine-bubble button { border-radius: 999px; border: 1px solid var(--rg-line); background: #F5F7FA; padding: 6px 10px; }
.memory-card { border: 1px solid var(--rg-line); border-radius: 12px; padding: 10px; margin: 8px 0; background: var(--rg-surface); }
.quiz-card { border: 1px solid var(--rg-line); border-radius: 14px; padding: 12px; margin: 8px 0; background: var(--rg-surface); display: flex; flex-direction: column; gap: 8px; }
.quiz-card button { text-align: left; border: 1px solid var(--rg-line); border-radius: 10px; padding: 8px 10px; background: var(--rg-surface-2); }
#composer { background: transparent; box-shadow: none; border: none; }
@media (max-width: 640px) {
  #btn-command-palette { display: none; }
}
.quick-toggle { position: relative; }
.quick-toggle.on { color: var(--rg-accent); }
.quick-toggle.on::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rg-text);
}
.msg-actions { display: flex; align-items: center; gap: 2px; position: relative; max-width: 100%; }
.msg-action-btn.icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.msg-action-btn.icon-only.on { color: var(--rg-accent); }
.msg-more-pop {
  position: absolute;
  right: 0;
  bottom: 36px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  box-shadow: var(--rg-shadow);
}
.msg-more-pop[hidden] { display: none; }
.msg-more-pop button { text-align: left; padding: 10px 12px; background: transparent; border: 0; }
.coll-item-text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.coll-item-tag[data-tag], .coll-note-tags button.on { background: var(--rg-text); color: #fff; }
.coll-note-tags { display: flex; gap: 6px; overflow-x: auto; }
.coll-note-tags button { border-radius: 999px; border: 1px solid var(--rg-line); padding: 6px 10px; background: var(--rg-surface); }
.app-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  background: rgba(10, 12, 16, 0.48);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.app-modal[hidden] { display: none; }
.app-modal-card {
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
  margin: auto;
  background: var(--rg-surface, #ffffff);
  border: 1px solid var(--rg-line, #e4e4e4);
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.app-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app-modal-card h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--rg-text, #111);
}
.app-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--rg-line, #e4e4e4);
  background: var(--rg-surface-2, #f4f4f5);
  color: var(--rg-muted, #5c6570);
  font-size: 18px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.app-modal-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--rg-muted, #5c6570);
}
.app-modal-card input, .app-modal-card textarea, .memory-form input, .memory-form select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--rg-line, #d8dce3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  background: var(--rg-bg, #F5F7FA);
  color: inherit;
}
.app-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.app-modal-actions button {
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--rg-line, #e4e4e4);
  background: var(--rg-surface-2, #f4f4f5);
  color: var(--rg-text, #111);
}
.app-modal-actions .btn-modal-primary {
  background: var(--rg-text);
  border-color: var(--rg-text);
  color: #ffffff;
}
.app-modal-actions .btn-modal-danger {
  margin-right: auto;
  background: #fef2f2;
  border-color: #fecaca;
  color: #b42318;
}
.memory-tabs, .memory-form { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.memory-tabs button { border-radius: 999px; border: 1px solid var(--rg-line); padding: 6px 10px; background: transparent; }
.memory-tabs button.on { background: var(--rg-text); color: var(--rg-bg); border-color: var(--rg-text); }
.project-card.on { border-color: var(--rg-text); }
#artifact-inline { width: 100%; min-height: 180px; border: 0; border-radius: 12px; background: #fff; margin-top: 8px; }
#messages, .settings-page { -webkit-overflow-scrolling: touch; }

.studio-toolbar { flex-direction: column; align-items: stretch; }
.studio-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.studio-util { display: flex; gap: 6px; flex: none; }
.studio-files { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; overflow: hidden; margin: 0; }
.studio-files button { min-width: 0; text-align: center; }
.studio-files[hidden], #studio-zip[hidden] { display: none; }
#view-studio, #view-studio .settings-page { overflow-x: hidden; max-width: 100%; }
#studio-terminal-status.studio-status-ok {
  background: #e8f6ee;
  color: #146c43;
  border-radius: 999px;
  padding: 2px 10px;
  font-weight: 600;
}
.project-templates { display: flex; flex-wrap: wrap; max-width: 100%; gap: 8px; padding-bottom: 4px; }
.project-templates button { flex: 0 0 auto; white-space: nowrap; }
.project-create-row { display: flex; gap: 8px; align-items: center; margin: 8px 0 12px; }
.project-create-row input { flex: 1; min-width: 0; }
.project-instruction-box { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
.project-label { font-size: 12px; font-weight: 600; color: var(--rg-muted); }
.project-textarea {
  width: 100%;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: var(--rg-surface);
  color: var(--rg-text);
}
.memory-count-badge {
  margin-left: auto;
  margin-right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--rg-text);
  background: var(--rg-surface-2);
  border: 1px solid var(--rg-line);
  border-radius: 999px;
  padding: 2px 8px;
}
.coll-empty-card {
  border: 1px dashed var(--rg-line);
  border-radius: 16px;
  padding: 28px 16px;
  text-align: center;
  color: var(--rg-muted);
  background: var(--rg-surface);
}
.coll-empty-card strong { display: block; color: var(--rg-text); margin-bottom: 6px; }
.memory-badge { align-self: flex-start; text-transform: capitalize; }
.artifact-format {
  flex: none;
  text-transform: uppercase;
  background: var(--rg-surface-2);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
}
.artifact-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.artifact-time { text-transform: none; font-weight: 500; }
.artifact-actions button, .btn-art-open, .btn-art-save { color: var(--rg-text); background: var(--rg-surface-2); border: 1px solid var(--rg-line); }
.artifact-actions .btn-art-save { background: var(--rg-text); color: var(--rg-bg); border-color: var(--rg-text); }
.artifact-meta { font-size: 11px; color: var(--rg-muted); font-weight: 600; }
#memory-capsule {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--rg-bg, #F5F7FA);
  display: flex;
  flex-direction: column;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#memory-capsule[hidden] { display: none; }
.memory-tabs { flex-wrap: nowrap; overflow-x: auto; }
.memory-form-card {
  background: var(--rg-surface, #fff);
  border: 1px solid var(--rg-line, #e5e7eb);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 16px;
}
.memory-select, .memory-input {
  width: 100%;
  border: 1px solid var(--rg-line, #e4e4e4);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  background: var(--rg-surface-2, #f9fafb);
  color: var(--rg-text, #111);
}
.memory-form-grid { display: flex; gap: 8px; }
@media (max-width: 480px) { .memory-form-grid { flex-direction: column; } }
.memory-submit-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--rg-text);
  color: var(--rg-bg);
  border: 0;
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
}
.memory-card { align-items: flex-start; }
.memory-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.memory-card-body strong { font-size: 13px; }
.memory-card-body span { font-size: 12.5px; color: var(--rg-muted); }
.memory-del-btn { background: transparent; color: #b42318; border: 0; font-size: 12px; font-weight: 600; }
.memory-footer { margin-top: 24px; display: flex; justify-content: center; }
.memory-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: #b42318;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
}

.project-create-card[hidden], #project-active-panel[hidden], .coll-filters[hidden], #coll-new-note[hidden], #studio-preview[hidden], #studio-files[hidden] { display: none; }
.project-create-card { border: 1px solid var(--rg-line); border-radius: 16px; padding: 12px; background: var(--rg-surface); }
.project-files { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
#project-pin-btn { width: fit-content; border: 1px solid var(--rg-line); border-radius: 999px; padding: 7px 14px; background: var(--rg-surface); font-weight: 600; font-size: 12.5px; }
.project-file-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.project-file-list li { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 13px; }
.project-backup-hint { font-size: 12px; color: var(--rg-muted); margin: 8px 0 12px; }

html, body { overflow-x: hidden; }
.attach-card { min-height: 44px; }
.project-new-btn { border: 1px solid var(--rg-line); border-radius: 999px; padding: 8px 14px; background: var(--rg-surface); font-weight: 600; }
.artifact-filters { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; margin: 8px 0 12px; }
.artifact-filters button { border: 1px solid var(--rg-line); border-radius: 999px; padding: 8px 12px; background: var(--rg-surface); }
.artifact-filters button.on { background: var(--rg-text); color: #fff; border-color: var(--rg-text); }
.artifact-format.pptx, .artifact-format.ppt { background: #f97316; color: #fff; }
.artifact-format.docx, .artifact-format.doc { background: #2563eb; color: #fff; }
.artifact-format.code, .artifact-format.js { background: #7c3aed; color: #fff; }
.artifact-format.csv { background: #0f766e; color: #fff; }
.artifact-format.svg { background: #15803d; color: #fff; }
.msg-photo { display: block; width: auto; max-width: min(70vw, 256px); max-height: 280px; object-fit: cover; border-radius: 20px 20px 6px 20px; border: none; margin: 0; cursor: zoom-in; }
.msg.user:has(.msg-photo) { width: fit-content; max-width: min(82vw, 320px); padding: 0; background: transparent; border: none; box-shadow: none; }
.image-lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(8,10,14,.92); display: flex; align-items: center; justify-content: center; }
.image-lightbox[hidden] { display: none; }
.image-lightbox img { max-width: 94vw; max-height: 86vh; border-radius: 12px; }
#image-lightbox-close { position: absolute; top: 16px; right: 16px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; min-height: 44px; padding: 0 14px; }
.attach-ocr { display: block; font-size: 12px; color: var(--rg-muted); }
.cite-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cite-chip { font-size: 12px; border: 1px solid var(--rg-line); border-radius: 999px; padding: 4px 10px; text-decoration: none; color: inherit; }
.msg-edit { font-size: 12px; color: var(--rg-accent); background: transparent; border: 0; min-height: 44px; }
.profile-badge { font-size: 12px; font-weight: 600; color: var(--rg-accent); }
.storage-meter { height: 6px; border-radius: 999px; background: var(--rg-surface-2, #eceff3); overflow: hidden; margin-top: 8px; }
#storage-meter-bar { display: block; height: 100%; width: 0; background: var(--rg-text); }
.attach-plain-label small { display: block; font-weight: 400; color: var(--rg-muted); }
@media (min-width: 960px) {
  #view-artifacts .settings-page { display: flex; flex-direction: column; }
  #artifact-inline { min-height: 360px; }
}

body.is-generating #btn-stop { display: flex; }
body.is-generating #btn-send { display: none; }
.offline-pill { font-size: 12px; font-weight: 600; color: #146c43; background: #e8f6ee; border-radius: 999px; padding: 4px 10px; }
.offline-pill[hidden] { display: none; }
.attach-card { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 88px; }
.attach-orb { width: 44px; height: 44px; border-radius: 999px; display: block; }
.tone-blue .attach-orb,
.tone-violet .attach-orb,
.tone-green .attach-orb,
.tone-orange .attach-orb {
  background: var(--rg-surface-2, #f3f4f6);
  color: var(--rg-text, #111827);
  box-shadow: none;
}
.project-hero-card { border: 1px solid var(--rg-line); border-radius: 18px; padding: 18px 16px; background: var(--rg-surface); }
.project-hero-card h2 { margin: 8px 0 4px; font-size: 18px; }
.project-hero-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: #eff6ff; color: var(--rg-text); }
.model-hub { display: grid; gap: 8px; margin: 8px 0 12px; }
.model-hub button { text-align: left; border: 1px solid var(--rg-line); border-radius: 14px; padding: 10px 12px; background: var(--rg-surface); min-height: 44px; }
.model-hub button small { display: block; color: var(--rg-muted); font-weight: 400; }
.model-hub button.on { border-color: var(--rg-text); box-shadow: inset 0 0 0 1px var(--rg-text); }

.attach-orb { display: grid; place-items: center; }
.attach-orb svg { display: block; }
.skill-pick { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--rg-muted); min-height: 44px; }
.skill-pick select { border: 1px solid var(--rg-line); border-radius: 999px; background: transparent; color: inherit; min-height: 36px; padding: 0 8px; }
.md-fence { margin: 8px 0; border: 1px solid var(--rg-line); border-radius: 12px; overflow: hidden; }
.md-fence-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; }
.md-fence-bar button, .cowork-bar button, .cowork-tabs button { min-height: 36px; border-radius: 999px; border: 1px solid var(--rg-line); background: transparent; padding: 4px 10px; }
.md-lang { font-size: 12px; font-weight: 700; }
.md-pre { margin: 0; padding: 8px 10px; overflow: auto; white-space: pre; }
.md-ln { display: inline-block; width: 2.2em; color: var(--rg-muted); }
.md-diff { padding: 8px 10px; font-family: ui-monospace, monospace; font-size: 13px; }
.md-diff-line { display: block; }
.md-diff-line.add { background: #e8f6ee; }
.md-diff-line.del { background: #fde8e8; }
.md-console { margin: 0; padding: 8px 10px; background: #0f172a; color: #e2e8f0; }
#cowork[hidden] { display: none; }
#cowork { display: flex; flex-direction: column; min-height: 220px; border-top: 1px solid var(--rg-line); background: var(--rg-surface); }
#cowork-editor { min-height: 180px; padding: 12px; outline: none; white-space: pre-wrap; overflow: auto; }
.cowork-bar, .cowork-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px; }
.cowork-tabs button.on { border-color: var(--rg-text); color: var(--rg-text); }
@media (max-width: 1023px) {
  #cowork { max-height: 70vh; }
}
@media (min-width: 1024px) {
  #view-chat.with-cowork { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  #view-chat.with-cowork #cowork { grid-column: 2; grid-row: 1 / span 4; border-top: 0; border-left: 1px solid var(--rg-line); }
}
@media (max-width: 1023px) {
  #view-chat.pane-canvas #messages,
  #view-chat.pane-canvas #empty-state { display: none; }
  #view-chat.pane-chat #cowork-editor,
  #view-chat.pane-chat .cowork-bar { display: none; }
}

body.is-generating #btn-voice-input { display: none; }
#btn-send.is-idle,
#btn-send:disabled { opacity: 0.45; cursor: default; }
#topbar h1.header-model-name { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; }
.header-model-name { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
#model-status, #model-status.active { display: none; }
.model-solo { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--rg-line); border-radius: 14px; }
.model-experimental { font-size: 11px; letter-spacing: 0.04em; color: var(--rg-muted); }
.model-speed, .model-speed-label select {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border-radius: 12px;
  border: 1px solid var(--rg-line);
  background: transparent;
  color: var(--rg-text);
  font-weight: 650;
  text-align: left;
  padding: 0 14px;
}
.model-speed-label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--rg-muted); }
.studio-panes {
  display: flex;
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: var(--rg-surface-2, #f4f4f4);
}
.studio-panes button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--rg-text);
  font-weight: 650;
}
.studio-panes button.on { background: var(--rg-bg, #fff); color: var(--rg-text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
#studio-diff-view { margin: 8px 0; max-height: 280px; overflow: auto; }
.msg.user { max-width: 82%; padding: 10px 16px; }
@media (min-width: 1024px) { .msg.user { max-width: 68%; } }
.fork-nav { font-size: 12px; color: var(--rg-muted, #5c6570); margin-top: 4px; }
.starter-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.coll-empty-card { grid-column: 1 / -1; width: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 36px 24px; border-radius: 18px; border: 1px dashed var(--rg-line); background: var(--rg-surface); text-align: center; }
.coll-empty-card p { margin: 0; max-width: 440px; font-size: 13.5px; line-height: 1.5; color: var(--rg-muted); }
.coll-empty-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: rgba(26, 75, 140, 0.08); color: var(--rg-text); margin-bottom: 4px; }
.artifact-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 10px; }
.art-filter-count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(15, 23, 42, 0.08); color: inherit; }
#artifact-filters button.on .art-filter-count { background: rgba(255, 255, 255, 0.22); color: #fff; }
.starter-grid button, .research-actions button { min-height: 36px; border-radius: 999px; border: 1px solid #cbd5e1; background: var(--rg-surface); padding: 6px 14px; }
.research-card { padding: 12px 14px; }
.research-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#attach-sheet { max-height: 75vh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 16px; }
html, body { overscroll-behavior-y: none; }
#attach-sheet .attach-plain svg { width: 20px; height: 20px; flex: none; }
.model-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; }
.model-item small, .hub-local-item { color: var(--rg-muted, #5c6570); font-size: 12px; }
#view-studio.pane-preview .studio-toolbar,
#view-studio.pane-preview .studio-editor,
#view-studio.pane-preview .CodeMirror,
#view-studio.pane-preview .studio-actions,
#view-studio.pane-preview #studio-terminal,
#view-studio.pane-console .studio-toolbar,
#view-studio.pane-console .studio-editor,
#view-studio.pane-console .CodeMirror,
#view-studio.pane-console .studio-actions,
#view-studio.pane-console #studio-preview-frame,
#view-studio.pane-editor #studio-preview-frame,
#view-studio.pane-editor #studio-terminal { display: none; }
@media (min-width: 1024px) {
  #view-studio.pane-preview .studio-toolbar,
  #view-studio.pane-preview .studio-editor,
  #view-studio.pane-preview .CodeMirror,
  #view-studio.pane-preview .studio-actions,
  #view-studio.pane-console .studio-toolbar,
  #view-studio.pane-console .studio-editor,
  #view-studio.pane-console .CodeMirror,
  #view-studio.pane-console .studio-actions,
  #view-studio.pane-editor #studio-preview-frame,
  #view-studio.pane-editor #studio-terminal { display: revert; }
  .studio-panes { display: none; }
}
.studio-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio-actions .studio-side { margin-left: auto; display: flex; gap: 8px; }
.studio-files button { display: inline-flex; align-items: center; gap: 6px; }
.studio-file-x { opacity: 0.55; }
.art-doc.markdown-body { font-size: 16px; line-height: 1.7; }
.art-doc.markdown-body h1,
.art-doc.markdown-body h2,
.art-doc.markdown-body h3 { line-height: 1.3; margin: 1.1em 0 0.4em; }
.art-doc.markdown-body h1 { font-size: 1.5rem; }
.art-doc.markdown-body h2 { font-size: 1.25rem; }
.art-doc.markdown-body h3 { font-size: 1.05rem; }
.art-doc.markdown-body { white-space: normal; word-break: normal; overflow-wrap: break-word; }
.art-doc.markdown-body .md-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--rg-line, #e2e8f0); border-radius: 12px; margin: 12px 0; background: var(--rg-surface, #fff); }
.art-doc.markdown-body table { width: 100%; border-collapse: collapse; margin: 0; table-layout: auto; white-space: normal; word-break: normal; overflow-wrap: normal; }
.art-doc.markdown-body th { background: var(--rg-surface-2, #f8fafc); border-bottom: 1.5px solid var(--rg-line, #e2e8f0); border-right: 1px solid var(--rg-line, #e2e8f0); padding: 9px 11px; text-align: left; font-weight: 650; white-space: normal; word-break: normal; overflow-wrap: normal; }
.art-doc.markdown-body td { border-bottom: 1px solid var(--rg-line, #e2e8f0); border-right: 1px solid var(--rg-line, #e2e8f0); padding: 9px 11px; text-align: left; vertical-align: top; word-break: normal; overflow-wrap: normal; }
.art-doc.markdown-body th:last-child, .art-doc.markdown-body td:last-child { border-right: none; }
.art-doc.markdown-body tbody tr:nth-child(even) { background: var(--rg-surface-2, #f6f6f6); }

body.has-attach-draft #messages {
  padding-bottom: calc(var(--composer-pad-bottom, 188px) + env(safe-area-inset-bottom, 0px));
}

.artifact-card {
  margin: 10px 0 6px;
  border: 1px solid var(--rg-line, #e2e8f0);
  border-radius: 16px;
  background: var(--rg-surface, #ffffff);
  box-shadow: 0 4px 14px -4px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  padding: 12px 14px;
}

.artifact-card-svg {
  width: 100%;
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

.artifact-card-svg svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
}

.artifact-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.artifact-card-head strong {
  font-size: 14px;
  font-weight: 650;
  color: var(--rg-text);
}

.artifact-card-head span {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--rg-muted);
}

.artifact-card-actions {
  display: flex;
  gap: 8px;
}

.artifact-card-actions button {
  flex: 1;
  min-height: 38px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--rg-line);
  background: var(--rg-surface-2);
  color: var(--rg-text);
}

.artifact-card-actions button:last-child {
  background: var(--rg-text);
  color: #ffffff;
  border-color: var(--rg-text);
}

.thought-fail {
  margin: 8px 0 4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--rg-surface-2);
  border: 1px solid var(--rg-line);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--rg-text);
}

.artifact-preview {
  position: relative;
  overflow: hidden;
}

.artifact-preview .artifact-format {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.artifact-preview-svg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  background: #ffffff;
}

.artifact-preview-svg svg {
  width: 100%;
  height: 100%;
  max-height: 98px;
  object-fit: contain;
}

.artifact-card-slide {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.artifact-slide-hero {
  position: relative;
  border-radius: 12px;
  padding: 16px 18px;
  min-height: 152px;
  background: linear-gradient(135deg, #0f172a 0%, var(--rg-text) 60%, var(--rg-text) 100%);
  color: #f8fafc;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 4px 14px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.artifact-slide-hero[data-kind="body"] {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.artifact-slide-hero[data-kind="close"] {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
}

.artifact-slide-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.artifact-slide-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: inherit;
}

.artifact-slide-hero[data-kind="body"] .artifact-slide-badge {
  background: var(--rg-surface-2);
  color: var(--rg-text);
}

.artifact-slide-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.82;
}

.artifact-slide-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}

.artifact-slide-bullets {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.94;
}

.artifact-slide-bullets li {
  margin-bottom: 4px;
}

.artifact-slide-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.artifact-slide-pills::-webkit-scrollbar {
  display: none;
}

.artifact-slide-pill {
  flex: 0 0 auto;
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--rg-line, #cbd5e1);
  background: var(--rg-surface, #ffffff);
  color: var(--rg-muted, #475569);
  cursor: pointer;
}

.artifact-slide-pill.on {
  background: var(--rg-text);
  border-color: var(--rg-text);
  color: #ffffff;
}

.artifact-card-table-wrap {
  border-radius: 10px;
  border: 1px solid var(--rg-line, #e2e8f0);
  background: var(--rg-surface, #ffffff);
  overflow-x: auto;
}

.artifact-card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.artifact-card-table th,
.artifact-card-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--rg-line, #e2e8f0);
  text-align: left;
}

.artifact-card-table th {
  background: #f1f5f9;
  font-weight: 700;
  color: #1e293b;
}

.artifact-card-table td.num-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.artifact-card-table tr.is-total-row td {
  background: #eff6ff;
  font-weight: 700;
  color: var(--rg-text);
  border-bottom: none;
}

.artifact-card-doc {
  max-height: 170px;
  overflow: hidden;
  position: relative;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--rg-line, #e2e8f0);
  background: var(--rg-surface, #ffffff);
  font-size: 13px;
  line-height: 1.5;
  color: var(--rg-text, #0f172a);
}

.artifact-card-doc::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--rg-surface, #ffffff));
  pointer-events: none;
}

.artifact-card-doc h1,
.artifact-card-doc h2,
.artifact-card-doc h3 {
  margin: 0 0 6px;
  font-size: 14.5px;
  line-height: 1.3;
}

.artifact-card-doc p,
.artifact-card-doc ul {
  margin: 0 0 6px;
}

.slide-frame {
  padding: 0;
  border: none;
  background: transparent;
}

.art-slide.on {
  min-height: 210px;
  border-radius: 14px;
  padding: 18px 20px;
  background: var(--rg-surface, #FFFFFF);
  border: 1px solid var(--rg-line, rgba(15, 20, 28, 0.09));
  box-shadow: 0 4px 16px rgba(15, 20, 28, 0.05);
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--rg-text, #0F141C);
}

.art-slide.on.kind-cover,
.art-slide.on.kind-close {
  background: var(--rg-surface, #FFFFFF);
  color: var(--rg-text, #0F141C);
  border-color: var(--rg-line, rgba(15, 20, 28, 0.14));
}

.art-slide-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.art-slide-badge,
.art-slide.on.kind-cover .art-slide-badge,
.art-slide.on.kind-close .art-slide-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--rg-surface-2, #EBEEF3);
  color: var(--rg-text, #0F141C);
  border: 1px solid var(--rg-line, rgba(15, 20, 28, 0.09));
}

.art-slide-step {
  font-size: 11.5px;
  font-weight: 700;
  opacity: 0.75;
}

.art-slide.on h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
}

.art-slide.on ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0;
}

.slide-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--rg-line, #cbd5e1);
  background: var(--rg-surface, #ffffff);
  color: var(--rg-text, #0f172a);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.slide-dot.on {
  background: var(--rg-text);
  border-color: var(--rg-text);
  color: #ffffff;
}

.artifact-preview-visual {
  width: 100%;
  height: 100%;
  min-height: 98px;
  padding: 12px 14px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.artifact-preview-visual.kind-slide {
  background: linear-gradient(135deg, #0f172a 0%, var(--rg-text) 75%, #2563eb 100%);
  color: #f8fafc;
}

.art-pv-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.art-pv-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  color: inherit;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-pv-sub {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.35;
  opacity: 0.86;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.art-pv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #ffffff;
  border-radius: 6px;
  overflow: hidden;
}

.art-pv-table th,
.art-pv-table td {
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.art-pv-table th {
  background: #f1f5f9;
  font-weight: 700;
}

.art-pv-doc {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
}

.art-pv-doc strong {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
  color: #0f172a;
}

.art-pv-doc p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#composer::before,
#composer::after {
  content: none;
  display: none;
  background: transparent;
}

.artifact-card-html {
  margin-bottom: 10px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--rg-line, #e2e8f0);
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.artifact-html-chrome {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.artifact-html-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.artifact-html-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #ef4444;
}

.artifact-html-dots i:nth-child(2) {
  background: #f59e0b;
}

.artifact-html-dots i:nth-child(3) {
  background: #10b981;
}

.artifact-html-url {
  flex: 1;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-html-frame {
  display: block;
  width: 100%;
  height: 250px;
  border: 0;
  background: #ffffff;
}

#view-collection .settings-page > hr.divider {
  display: none;
}

.hub-search-box {
  position: relative;
  display: block;
  margin: 10px 0 14px;
}

.hub-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rg-muted);
  pointer-events: none;
}

.hub-search-input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--rg-line, #e4e4e4);
  border-radius: 999px;
  padding: 0 14px 0 40px;
  font: inherit;
  font-size: 13px;
  background: var(--rg-surface, #fff);
  color: var(--rg-text);
  outline: none;
}

.hub-search-input:focus {
  border-color: var(--rg-text);
  box-shadow: 0 0 0 3px rgba(26, 75, 140, 0.12);
}

.coll-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 600;
}

.hub-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hub-card-name {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#artifact-filters,
.artifact-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  margin: 10px 0 16px;
  padding-bottom: 0;
}

#artifact-filters button,
.artifact-filters button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: var(--rg-surface, #ffffff);
  color: #334155;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

#artifact-filters button:not(.on):hover,
.artifact-filters button:not(.on):hover,
.coll-filters button:not(.on):hover,
.coll-filter-chip:not(.on):hover {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #0f172a;
}

#artifact-filters button.on,
.artifact-filters button.on,
.coll-filters button.on,
.coll-filter-chip.on {
  background: var(--rg-text);
  color: #ffffff;
  border-color: var(--rg-text);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(26, 75, 140, 0.22);
}

.starter-chip,
#view-artifacts .starter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.starter-chip:hover,
#view-artifacts .starter-chip:hover {
  border-color: var(--rg-text);
  color: var(--rg-text);
  background: #eff6ff;
}

.project-templates button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 550;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.project-templates button:hover {
  border-color: var(--rg-text);
  color: var(--rg-text);
  background: #eff6ff;
}

.project-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0 0;
}

.project-create-row input,
#project-name-sheet {
  flex: 1;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: var(--rg-surface, #ffffff);
  font-size: 13px;
  color: var(--rg-text);
  box-sizing: border-box;
}

#project-create-sheet {
  width: auto;
  height: 40px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--rg-text);
  background: var(--rg-text);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(26, 75, 140, 0.22);
  cursor: pointer;
}

#view-project .project-grid {
  margin-top: 12px;
}

.project-empty {
  margin: 0;
  padding: 18px 16px;
  text-align: center;
  color: var(--rg-muted);
  font-size: 13px;
  line-height: 1.5;
  background: var(--rg-surface);
  border: 1px dashed var(--rg-line);
  border-radius: 16px;
  list-style: none;
}

.project-files {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 12px;
}

.project-files .project-file-list {
  flex-basis: 100%;
  width: 100%;
}

.project-new-btn,
#project-pin-btn,
#project-folder-btn,
#project-folder-save,
#project-open-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 600;
  width: fit-content;
  cursor: pointer;
}

#project-open-chat {
  background: var(--rg-text);
  color: #ffffff;
  border-color: var(--rg-text);
}

#view-project #project-active-panel:not([hidden]) {
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
  border-radius: 18px;
  padding: 18px 16px;
  margin-top: 12px;
  box-shadow: 0 2px 10px -2px rgba(15, 23, 42, 0.03);
}

#view-connect .hub-card {
  gap: 14px;
  padding: 16px 18px;
}

.coll-note-tags {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.coll-note-tags button {
  width: 100%;
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  cursor: pointer;
}

#coll-note-save {
  background: var(--rg-text);
  border-color: var(--rg-text);
  color: #ffffff;
}

@media (max-width: 859px) {
  #view-artifacts #artifact-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    margin: 10px 0 14px;
    padding: 0;
  }

  #view-artifacts #artifact-filters button {
    width: 100%;
    height: 32px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  #view-artifacts .coll-empty-card {
    padding: 28px 14px;
  }

  #view-artifacts .artifact-empty-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin: 12px auto 0;
  }

  #view-artifacts .artifact-empty-actions .starter-chip {
    flex: 1 1 auto;
    height: 32px;
    min-height: 32px;
    padding: 0 9px;
    font-size: 11.5px;
  }

  #view-collection .coll-filters {
    gap: 6px;
    margin: 4px 0 14px;
    padding: 0;
  }

  #view-collection .coll-filter-chip,
  #view-collection .coll-filters button {
    flex: 1 1 auto;
    height: 32px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 11.5px;
    justify-content: center;
    text-align: center;
  }

  #view-project .project-templates {
    gap: 8px;
    margin: 10px 0 14px;
    padding: 0;
  }

  #view-project .project-templates button {
    flex: 1 1 calc(50% - 4px);
    max-width: calc(50% - 4px);
    height: 34px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
    justify-content: center;
    text-align: center;
  }

  #view-project .project-files button {
    flex: 1 1 auto;
    padding: 0 10px;
    font-size: 11.5px;
    justify-content: center;
    text-align: center;
  }
}

#view-artifacts,
#view-collection,
#view-project,
#view-settings,
#view-connect {
  background: var(--rg-bg);
  color: var(--rg-text);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

#view-connect .settings-page,
#view-artifacts .settings-page,
#view-collection .settings-page,
#view-project .settings-page,
#view-settings .settings-page {
  width: 100%;
  max-width: 720px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 16px calc(44px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-x: hidden;
}

#view-artifacts .settings-header,
#view-collection .settings-header,
#view-project .settings-header,
#view-settings .settings-header,
#view-connect .settings-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0 8px;
  background: var(--rg-bg);
  color: var(--rg-text);
}

#view-artifacts .settings-page > hr.divider,
#view-collection .settings-page > hr.divider,
#view-project .settings-page > hr.divider,
#view-settings .settings-page > hr.divider {
  display: none;
}

#view-project .project-templates {
  display: flex;
  flex-wrap: wrap;
  max-width: 100%;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
}

#view-project .project-templates .hub-card {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 859px) {
  #view-connect .settings-header,
  #view-artifacts .settings-header,
  #view-collection .settings-header,
  #view-project .settings-header,
  #view-settings .settings-header {
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px 0;
    padding: 0 2px;
    box-sizing: border-box;
  }
}

#view-connect .hub-card {
  gap: 12px;
  padding: 13px 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#artifact-filters[hidden],
#coll-filters[hidden],
#artifact-filters:empty,
#coll-filters:empty {
  display: none;
}


.project-card .project-open {
  order: 1;
  font-weight: 600;
  font-size: 15px;
}

.project-card .project-del {
  order: 2;
  margin-left: auto;
}

.project-card > p {
  order: 3;
  flex: 1 1 100%;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--rg-muted);
}

.project-file-list {
  margin: 10px 0 6px;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--rg-muted);
}

#cowork-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--rg-muted);
  pointer-events: none;
  display: block;
}

.vault-conflict-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 950;
}

.vault-conflict-dialog {
  width: 100%;
  max-width: 540px;
  background: var(--rg-surface, #ffffff);
  color: var(--rg-text, #0f141c);
  border: 1px solid var(--rg-line, rgba(15, 20, 28, 0.12));
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.vault-conflict-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vault-conflict-top h3 {
  margin: 0;
  font-size: 16px;
}

.vault-conflict-sub {
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--rg-muted, #5b6472);
}

.conflict-diff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 14px;
}

.conflict-diff-card {
  border: 1px solid var(--rg-line, rgba(15, 20, 28, 0.1));
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--rg-bg, #f5f7fa);
}

.conflict-diff-head {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
}

.conflict-diff-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}

.conflict-col em {
  display: block;
  font-style: normal;
  font-weight: 600;
  color: var(--rg-muted, #5b6472);
  margin-bottom: 2px;
}

.conflict-col p {
  margin: 0;
}

.vault-conflict-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.conflict-btn {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--rg-line, rgba(15, 20, 28, 0.14));
  background: var(--rg-surface-2, #ebeef3);
  color: var(--rg-text, #0f141c);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.conflict-btn.primary {
  background: var(--rg-text, #0f141c);
  color: var(--rg-surface, #ffffff);
  border-color: var(--rg-text, #0f141c);
  font-weight: 600;
}

#view-settings .set-row > span:first-child { white-space: nowrap; flex-shrink: 0; }
