body {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    Segoe UI,
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  margin: 0;
  min-height: 100vh;
  background: #f3f4f6;
  color: #111827;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 1rem 0.85rem;
  background: #111827;
  color: #f9fafb;
  border-right: 1px solid #1f2937;
  box-sizing: border-box;
}

.sidebar-brand {
  margin-bottom: 1rem;
  padding: 0.2rem 0.2rem 0.8rem 0.2rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.sidebar-brand strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.sidebar-brand span {
  display: block;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
}

.sidebar-nav {
  display: grid;
  gap: 0.35rem;
}

.sidebar-nav-btn {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  background: transparent;
  color: #cbd5e1;
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.sidebar-nav-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
}

.sidebar-nav-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.app-main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(243, 244, 246, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
}

.header-copy h1 {
  margin: 0;
  font-size: 1.45rem;
}

.header-copy p {
  margin: 0.3rem 0 0 0;
  max-width: 74ch;
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  padding: 0.22rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 600;
}

.header-slot {
  min-width: 0;
}

.header-slot .auth-box {
  margin: 0;
  padding: 0.85rem;
  box-shadow: none;
  border-radius: 0.6rem;
}

.app-content {
  min-width: 0;
  padding: 1.25rem;
}

.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

.view-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.9rem;
}

.view-head h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #111827;
}

.view-subtle {
  margin: 0.25rem 0 0 0;
  color: #6b7280;
  font-size: 0.84rem;
  line-height: 1.5;
}

.workspace-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.95rem;
  box-sizing: border-box;
}

.overview-grid {
  display: grid;
  gap: 1rem;
}

.summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.9rem;
}

.summary-card strong,
.metric-summary-card strong {
  display: block;
  font-size: 0.75rem;
  color: #4b5563;
  margin-bottom: 0.2rem;
}

.summary-value {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.2rem;
}

.summary-label {
  display: block;
  font-size: 0.76rem;
  color: #6b7280;
  line-height: 1.45;
}

.overview-main {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
}

.overview-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.overview-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.overview-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.overview-loaded-list {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.7rem;
}

.quick-link-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.quick-link-card {
  border: 1px solid #dbeafe;
  border-radius: 0.7rem;
  background: #f8fbff;
  padding: 0.85rem;
  display: grid;
  gap: 0.4rem;
}

.quick-link-card button {
  justify-self: start;
}

.tests-shell {
  display: grid;
  gap: 1rem;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 70vh;
}

.tests-nav {
  display: grid;
  gap: 0.4rem;
  align-content: start;
}

.test-nav-btn {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #374151;
  text-align: left;
  padding: 0.7rem 0.8rem;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}

.test-nav-btn.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tests-workspace {
  min-width: 0;
}

.test-panel {
  display: none;
}

.test-panel.active {
  display: block;
}

.metrics-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 0.85rem;
}

.metric-sparkline {
  margin-top: 0.5rem;
}

.metric-sparkline svg {
  display: block;
  width: 100%;
  height: 56px;
}

.metric-sparkline .resource-chart-wrap {
  padding: 0.12rem;
  overflow: hidden;
}

.metric-sparkline .resource-chart {
  min-width: 0;
  height: 56px;
}

.metrics-detail-shell {
  display: grid;
  gap: 1rem;
}

.placeholder-card {
  border: 1px dashed #cbd5e1;
  border-radius: 0.75rem;
  background: #ffffff;
  padding: 1rem;
  color: #475569;
}

.legacy-module-source {
  display: none;
}

/* Thin, styled scrollbars (supported in Chromium/Safari/Edge + Firefox fallback) */
* {
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #e2e8f0;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 100%);
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7f8ea3 0%, #475569 100%);
}

h1 {
  margin-bottom: 0.25rem;
}

p {
  color: #374151;
}

.muted {
  color: #6b7280;
}

ul {
  line-height: 1.7;
}

code {
  background: #f3f4f6;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

pre {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.9rem;
  overflow-x: auto;
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  display: block;
  white-space: pre;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.section {
  margin-top: 1.25rem;
}

.smoke-actions {
  margin-bottom: 0.5rem;
}

.copy-btn {
  background: #e5e7eb;
  color: #374151;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.15s;
}

.copy-btn:hover {
  background: #d1d5db;
}

.copy-btn:active {
  background: #c4c8cc;
}

.test-item {
  margin-bottom: 1rem;
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.test-label {
  font-size: 0.9rem;
  color: #6b7280;
  font-weight: 500;
}

.test-item pre {
  margin: 0;
}

.visual-groups {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

.visual-group {
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #ffffff;
  padding: 0.8rem;
}

.visual-group h3 {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  color: #1f2937;
}

.section-caution {
  margin: -0.2rem 0 0.6rem 0;
  color: #ff8244;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.4;
}

.visual-stack {
  display: grid;
  gap: 0.75rem;
}

.visual-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.9rem;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}

.visual-card h4 {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
}

.visual-form {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.visual-form label {
  font-size: 0.8rem;
  color: #4b5563;
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.field-help {
  font-size: 0.72rem;
  color: #6b7280;
  line-height: 1.35;
}

.range-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.range-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1f2937;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 0.35rem;
  padding: 0.12rem 0.42rem;
  min-width: 2.8rem;
  text-align: center;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.71rem;
  color: #6b7280;
  margin-top: 0.1rem;
}

.visual-form input,
.visual-form select,
.visual-form textarea {
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.visual-form input[type="range"] {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  accent-color: #2563eb;
}

.visual-form textarea {
  min-height: 72px;
  resize: vertical;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: block;
  box-sizing: border-box;
}

.chat-compact-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  align-items: start;
}

.compact-field {
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  padding: 0.45rem;
  background: #fcfcfd;
  min-width: 0;
}

.compact-field .compact-title {
  font-size: 0.72rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.25rem;
}

.compact-field .slider-scale {
  margin-top: 0.2rem;
  font-size: 0.68rem;
}

.compact-field input[type="number"] {
  width: 100%;
}

.compact-field .compact-number-input {
  width: fit-content;
  max-width: 10.5rem;
}

.compact-field .compact-optional-input {
  width: 100%;
}

.long-attachment {
  margin-top: 0.35rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.long-attachment-chip {
  border: 1px solid #cbd5e1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #1f2937;
  border-radius: 0.85rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.78rem;
  cursor: pointer;
  max-width: 100%;
  text-align: left;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.long-attachment-chip:hover {
  background: #f1f5f9;
}

.chat-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.95fr);
  gap: 0.9rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.chat-pane {
  border: 1px solid #e5e7eb;
  border-radius: 0.8rem;
  background:
    radial-gradient(circle at top left, rgba(191, 219, 254, 0.35), transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  padding: 0.75rem;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

.chat-banner {
  display: none;
  margin-bottom: 0.6rem;
  border: 1px solid #f9a8d4;
  background: #fdf2f8;
  color: #9d174d;
  border-radius: 0.8rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.8rem;
  line-height: 1.4;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.chat-banner.visible {
  display: flex;
}

.chat-banner-message {
  flex: 1;
  min-width: 0;
}

.chat-thread {
  min-height: 360px;
  max-height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.2rem;
}

.chat-empty {
  color: #6b7280;
  font-size: 0.8rem;
  padding: 0.7rem;
  text-align: center;
}

.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.user {
  justify-content: flex-end;
}

.chat-row.assistant,
.chat-row.summary,
.chat-row.activity {
  justify-content: flex-start;
}

.chat-row.aux-label {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: min(84%, 760px);
  border-radius: 1.15rem;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.chat-turn-bubble {
  position: relative;
}

.chat-bubble.user {
  background: #ffffff;
  color: #111827;
  border: 1px solid #dbe4f0;
  border-bottom-right-radius: 0.3rem;
}

.chat-bubble.assistant {
  background: #ffffff;
  color: #111827;
  border: 1px solid #dbe4f0;
  border-bottom-left-radius: 0.3rem;
}

.chat-bubble.summary,
.chat-bubble.activity {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #dbe4f0;
  box-shadow: none;
}

.chat-bubble.activity {
  max-width: min(90%, 760px);
}

.chat-row.aux-label .aux-label-item {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: min(90%, 760px);
}

.chat-row.aux-label .aux-label-item summary {
  cursor: pointer;
  list-style: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.69rem;
  line-height: 1.25;
  font-weight: 600;
  color: #334155;
  letter-spacing: 0.01em;
}

.chat-row.aux-label .aux-label-item summary::-webkit-details-marker {
  display: none;
}

.chat-row.aux-label.exception .aux-label-item summary,
.chat-row.aux-label.exception .aux-label-text {
  color: #dc2626;
}

.aux-label-arrow {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.62rem;
  color: #64748b;
  transform: translateY(-0.5px);
  transition: transform 0.16s ease;
}

.chat-row.aux-label.exception .aux-label-arrow {
  color: #dc2626;
}

.chat-row.aux-label .aux-label-item[open] .aux-label-arrow {
  transform: rotate(90deg);
}

.aux-label-text {
  display: inline-block;
  color: #334155;
}

.aux-label-text.flash {
  animation: activityFlashPulse 1s ease-in-out infinite;
  color: #dc2626;
}

.chat-row.aux-label .aux-label-item pre {
  margin: 0.28rem 0 0 0.92rem;
  max-height: 180px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.7rem;
  color: #475569;
  width: 100%;
  box-sizing: border-box;
}

.chat-row.aux-label.exception .aux-label-item pre {
  color: #991b1b;
}

.chat-bubble-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: #64748b;
}

.chat-images,
.draft-image-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.chat-image,
.draft-image-card {
  width: 92px;
  height: 92px;
  border-radius: 0.9rem;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #e2e8f0;
}

.draft-image-wrap {
  display: grid;
  gap: 0.3rem;
  justify-items: center;
}

.draft-image-remove {
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
}

.chat-compose {
  margin-top: 0.75rem;
  display: grid;
  gap: 0.5rem;
}

.markdown-editor {
  border: 1px solid #dbe4f0;
  border-radius: 0.8rem;
  background: #ffffff;
  padding: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.markdown-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.markdown-editor-title {
  font-size: 0.76rem;
  font-weight: 600;
  color: #374151;
}

.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.md-btn {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 0.42rem;
  padding: 0.2rem 0.42rem;
  font-size: 0.72rem;
  cursor: pointer;
  line-height: 1.2;
}

.md-btn:hover {
  background: #f1f5f9;
}

.markdown-editor textarea {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.48rem 0.52rem;
  font-size: 0.84rem;
  font-family: inherit;
  min-height: 112px;
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
}

.composer-input-wrap {
  position: relative;
}

.composer-input-wrap textarea {
  padding-right: 3.25rem;
  padding-bottom: 3rem;
}

.composer-input-wrap textarea:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}

.composer-send-btn {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #0f172a;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.composer-send-btn:hover {
  background: #1f2937;
}

.composer-send-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.composer-input-wrap.send-disabled:hover::after {
  content: attr(data-send-disabled-tooltip);
  position: absolute;
  right: 0.15rem;
  bottom: 3.35rem;
  max-width: min(18rem, calc(100% - 1rem));
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #111827;
  color: #ffffff;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.25;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  z-index: 4;
}

.composer-stop-icon {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 0.12rem;
  background: #ffffff;
}

.output-warning {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #f59e0b;
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

.markdown-preview-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  padding: 0.42rem 0.5rem;
  display: grid;
  gap: 0.3rem;
}

.markdown-preview-label {
  font-size: 0.72rem;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.markdown-preview,
.chat-markdown {
  font-size: 0.82rem;
  line-height: 1.45;
}

.markdown-preview {
  max-height: 250px;
  overflow: auto;
  padding-right: 0.15rem;
}

.markdown-empty {
  color: #94a3b8;
  font-style: italic;
}

.markdown-preview p,
.chat-markdown p {
  margin: 0 0 0.45rem 0;
}

.markdown-preview p:last-child,
.chat-markdown p:last-child {
  margin-bottom: 0;
}

.markdown-preview h1,
.markdown-preview h2,
.markdown-preview h3,
.markdown-preview h4,
.markdown-preview h5,
.markdown-preview h6,
.chat-markdown h1,
.chat-markdown h2,
.chat-markdown h3,
.chat-markdown h4,
.chat-markdown h5,
.chat-markdown h6 {
  margin: 0.1rem 0 0.45rem 0;
  font-size: 0.95rem;
  line-height: 1.3;
}

.markdown-preview ul,
.markdown-preview ol,
.chat-markdown ul,
.chat-markdown ol {
  margin: 0.15rem 0 0.45rem 1.15rem;
  padding: 0;
}

.markdown-preview blockquote,
.chat-markdown blockquote {
  margin: 0.2rem 0 0.45rem 0;
  border-left: 3px solid #94a3b8;
  padding-left: 0.55rem;
  color: #475569;
}

.markdown-preview pre,
.chat-markdown pre {
  margin: 0.7rem 0;
  background: #eff6ff;
  color: #0f172a;
  border: 0;
  border-radius: 0.6rem;
  padding: 0.55rem 0.6rem;
  overflow-x: auto;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: #8fa6c6 #dbeafe;
}

.markdown-preview pre::-webkit-scrollbar,
.chat-markdown pre::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.markdown-preview pre::-webkit-scrollbar-track,
.chat-markdown pre::-webkit-scrollbar-track {
  background: #dbeafe;
  border-radius: 999px;
}

.markdown-preview pre::-webkit-scrollbar-thumb,
.chat-markdown pre::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #93c5fd 0%, #60a5fa 100%);
  border-radius: 999px;
  border: 1px solid #dbeafe;
}

.markdown-preview pre::-webkit-scrollbar-thumb:hover,
.chat-markdown pre::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7bb8fa 0%, #3b82f6 100%);
}

.markdown-preview code,
.chat-markdown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  background: #eaf3ff;
  color: #1e293b;
  padding: 0.08rem 0.28rem;
  border-radius: 0.28rem;
  font-size: 0.78em;
}

.markdown-preview pre code,
.chat-markdown pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.86em;
}

.md-code-block {
  position: relative;
}

.md-code-copy-btn {
  position: absolute;
  right: 0.5rem;
  bottom: 0.48rem;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 0.42rem;
  padding: 0.16rem 0.42rem;
  font-size: 0.69rem;
  line-height: 1.2;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.md-code-copy-btn:hover {
  background: #dbeafe;
}

.md-code-copy-btn:active {
  transform: translateY(1px);
}

.md-code-copy-btn.copied {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.md-code-block pre {
  padding-bottom: 1.85rem;
}

.chat-bubble.assistant .chat-markdown a,
.chat-bubble.summary .chat-markdown a {
  color: #1d4ed8;
}

.chat-controls-pane {
  display: grid;
  gap: 0.7rem;
  align-content: start;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.chat-inline-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-bottom: 0.1rem;
}

.control-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.advanced-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.advanced-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.7rem;
  padding: 0.55rem;
  background: #fcfcfd;
  min-width: 0;
  overflow: hidden;
}

.advanced-card strong {
  display: block;
  font-size: 0.78rem;
  color: #1f2937;
  margin-bottom: 0.35rem;
}

.activity-log {
  display: none;
}

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

.chat-bubble.activity .activity-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 100%;
}

.chat-bubble.activity .activity-item summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: #334155;
  font-weight: 600;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
}

.chat-bubble.activity .activity-item summary::-webkit-details-marker {
  display: none;
}

.activity-arrow {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.72rem;
  letter-spacing: -0.04em;
  color: #0f172a;
  transform: translateY(-0.5px);
  transition: transform 0.16s ease;
}

.chat-bubble.activity .activity-item[open] .activity-arrow {
  transform: rotate(90deg);
}

.activity-summary-label {
  display: inline-block;
  color: #111827;
}

.activity-summary-label.flash {
  animation: activityFlashPulse 1s ease-in-out infinite;
  color: #dc2626;
}

@keyframes activityFlashPulse {
  0% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }

  100% {
    opacity: 1;
  }
}

.chat-bubble.activity .activity-item pre {
  margin-top: 0.5rem;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.74rem;
  width: 100%;
  box-sizing: border-box;
}

.chat-composer-help {
  font-size: 0.72rem;
  color: #64748b;
}

.visual-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.run-btn {
  background: #2563eb;
  color: #fff;
  border: 1px solid #2563eb;
  border-radius: 0.35rem;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.run-btn.secondary {
  background: #f3f4f6;
  color: #111827;
  border-color: #d1d5db;
}

.run-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.output-panel {
  margin-top: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  background: #f9fafb;
  padding: 0.55rem;
}

.output-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.output-error {
  border: 1px solid #fecdd3;
  background: #fff1f2;
  color: #991b1b;
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.output-error-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.dismiss-btn {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
  opacity: 0.75;
}

.dismiss-btn:hover {
  opacity: 1;
}

.output-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.output-table th,
.output-table td {
  border: 1px solid #e5e7eb;
  padding: 0.28rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

.output-stream {
  white-space: pre-wrap;
  font-size: 0.82rem;
  line-height: 1.45;
  max-height: none;
  overflow-y: visible;
}

.pipeline-meta-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 0.25rem;
}

.pipeline-meta-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  background: #f9fafb;
  padding: 0.45rem 0.5rem;
}

.pipeline-meta-card strong {
  display: block;
  font-size: 0.72rem;
  color: #374151;
  margin-bottom: 0.15rem;
}

.pipeline-meta-card span {
  display: block;
  font-size: 0.78rem;
  color: #111827;
  word-break: break-word;
}

.pipeline-inline-note {
  margin-top: 0.3rem;
}

.yolo-section-note {
  margin: 0 0 0.65rem 0;
}

.yolo-workspace {
  display: grid;
  gap: 0.85rem;
}

.yolo-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  border-bottom: 1px solid #dbe3f0;
  padding-bottom: 0.55rem;
}

.yolo-mode-tab,
.yolo-task-btn {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #374151;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.yolo-mode-tab:hover,
.yolo-task-btn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.yolo-mode-tab.active,
.yolo-task-btn.active {
  border-color: #1d4ed8;
  background: #eff6ff;
  color: #1d4ed8;
}

.yolo-shell {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  align-items: start;
}

.yolo-control-pane,
.yolo-result-pane {
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #f9fafb;
  padding: 0.9rem;
  box-sizing: border-box;
}

.yolo-pane-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.yolo-pane-head h4 {
  margin: 0;
}

.yolo-pane-copy {
  display: grid;
  gap: 0.2rem;
}

.yolo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.46rem;
  border-radius: 0.35rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.yolo-task-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin-bottom: 0.8rem;
}

.yolo-field-grid {
  display: grid;
  gap: 0.55rem;
}

.yolo-field-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.yolo-slider-field {
  display: grid;
  gap: 0.35rem;
}

.yolo-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #374151;
  font-weight: 600;
}

.yolo-slider-field input[type="range"] {
  width: 100%;
  margin: 0;
  accent-color: #1d4ed8;
}

.yolo-slider-value {
  color: #111827;
  font-variant-numeric: tabular-nums;
}

.yolo-inline-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.yolo-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.83rem;
  color: #374151;
  font-weight: 500;
}

.yolo-preview-shell {
  display: grid;
  align-items: center;
  min-height: 320px;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.65rem;
  background: #111827;
  margin-bottom: 0.75rem;
}

.yolo-preview-media {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 0.45rem;
  background: #111827;
  display: block;
}

.yolo-empty-preview {
  color: #d1d5db;
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 1rem 0.5rem;
}

.yolo-webcam-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.yolo-webcam-meta {
  font-size: 0.72rem;
  color: #6b7280;
  min-height: 1rem;
}

.yolo-advanced {
  margin-top: 0.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  background: #ffffff;
  padding: 0.65rem 0.75rem;
}

.yolo-advanced summary {
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  color: #374151;
}

.yolo-advanced[open] summary {
  margin-bottom: 0.65rem;
}

.yolo-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}

.yolo-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.2rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 600;
}

.yolo-result-preview {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.45rem;
}

.yolo-job-progress {
  display: grid;
  gap: 0.55rem;
  padding: 0.8rem;
  border: 1px solid #dbe3f0;
  border-radius: 0.65rem;
  background: #f8fafc;
  margin-bottom: 0.75rem;
}

.yolo-job-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.84rem;
  color: #111827;
  font-weight: 600;
}

.yolo-job-progress-message {
  font-size: 0.8rem;
  color: #4b5563;
  line-height: 1.5;
}

.yolo-job-progress-track {
  position: relative;
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  overflow: hidden;
  background: #dbeafe;
}

.yolo-job-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.2s ease;
}

.yolo-job-progress-track.error .yolo-job-progress-fill {
  background: #dc2626;
}

.yolo-job-progress-track.done .yolo-job-progress-fill {
  background: #16a34a;
}

.yolo-video-compare {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 0.45rem;
  margin-bottom: 0.75rem;
}

.yolo-video-compare-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
}

.yolo-video-pane {
  display: grid;
  gap: 0.35rem;
}

.yolo-video-pane strong {
  font-size: 0.82rem;
  color: #111827;
}

.yolo-video-pane video {
  width: 100%;
  max-height: 320px;
  border-radius: 0.45rem;
  background: #111827;
}

.yolo-summary-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.yolo-summary-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.45rem 0.5rem;
}

.yolo-summary-card strong {
  display: block;
  font-size: 0.72rem;
  color: #4b5563;
  margin-bottom: 0.16rem;
}

.yolo-summary-card span {
  display: block;
  font-size: 0.88rem;
  color: #111827;
  font-weight: 600;
}

.embedding-grid {
  display: grid;
  gap: 0.55rem;
}

.embedding-card {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.5rem;
}

.embedding-title {
  font-size: 0.77rem;
  color: #374151;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.embedding-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-height: 32px;
  margin-bottom: 0.35rem;
}

.embedding-bar {
  width: 8px;
  border-radius: 2px 2px 0 0;
  background: #93c5fd;
}

.embedding-preview {
  font-size: 0.72rem;
  color: #4b5563;
  word-break: break-word;
}

.resource-report {
  display: grid;
  gap: 0.6rem;
}

.resource-warning {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #9f1239;
  border-radius: 0.45rem;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.resource-section {
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.45rem 0.5rem;
  display: grid;
  gap: 0.4rem;
}

.resource-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1f2937;
}

.resource-summary {
  font-size: 0.74rem;
  color: #374151;
  font-weight: 600;
}

.resource-chart-wrap {
  border: 1px solid #e2e8f0;
  border-radius: 0.4rem;
  background: #f8fafc;
  padding: 0.2rem;
  overflow-x: auto;
}

.resource-chart {
  width: 100%;
  min-width: 300px;
  height: 126px;
  display: block;
}

.resource-grid-line {
  stroke: #e5e7eb;
  stroke-width: 1;
}

.resource-grid-line.warn {
  stroke: #fecdd3;
  stroke-dasharray: 4 3;
}

.resource-line {
  fill: none;
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resource-legend {
  display: grid;
  gap: 0.25rem;
}

.resource-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
  font-size: 0.73rem;
  color: #374151;
}

.resource-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.transcription-text {
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #ffffff;
  padding: 0.6rem;
  font-size: 0.83rem;
  line-height: 1.45;
  white-space: pre-wrap;
  margin-bottom: 0.5rem;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #000000;
}

.hidden {
  display: none;
}

.pool-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.pool-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pool {
  border: 1px solid #d1d5db;
  border-radius: 0.55rem;
  height: clamp(320px, 48vh, 560px);
  padding: 0.65rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pool h5 {
  margin: 0 0 0.6rem 0;
  font-size: 0.86rem;
  color: #1f2937;
}

.pool-items {
  display: grid;
  gap: 0.55rem;
  align-content: start;
  overflow-y: auto;
  min-height: 0;
  padding-right: 0.2rem;
}

.pool-drop {
  outline: 2px dashed #2563eb;
  outline-offset: 2px;
  background: #eff6ff;
}

.sticker {
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 0.5rem;
  padding: 0.55rem;
  cursor: grab;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.07);
}

.sticker-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
}

.sticker-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 1rem;
}

.sticker-star {
  font-size: 1rem;
  line-height: 1;
  color: rgba(15, 23, 42, 0.35);
}

.sticker-star.loaded {
  color: #d97706;
  text-shadow: 0 0 0.2rem rgba(217, 119, 6, 0.24);
}

.sticker-action-btn {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: transparent;
  border-radius: 0.42rem;
  width: 1.7rem;
  height: 1.7rem;
  font-size: 0.92rem;
  cursor: pointer;
  color: #4b5563;
}

.sticker-action-btn:hover {
  background: rgba(255, 255, 255, 0.45);
}

.sticker-id {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111827;
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.sticker-meta {
  font-size: 0.72rem;
  color: #374151;
  line-height: 1.35;
}

.sticker-yellow {
  background: #fef08a;
}

.sticker-green {
  background: #bbf7d0;
}

.sticker-blue {
  background: #bfdbfe;
}

.sticker-orange {
  background: #fed7aa;
}

.sticker-pink {
  background: #fbcfe8;
}

.sticker-gray {
  background: #e5e7eb;
}

.sticker-menu {
  position: fixed;
  z-index: 60;
  min-width: 13rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 0.65rem;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  padding: 0.3rem;
}

.sticker-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 0.45rem;
  padding: 0.52rem 0.62rem;
  cursor: pointer;
  color: #111827;
  font-size: 0.82rem;
}

.sticker-menu button:hover {
  background: #eff6ff;
}

.sticker-menu button[disabled] {
  color: #9ca3af;
  cursor: not-allowed;
}

.fetch-row-list {
  display: grid;
  gap: 0.5rem;
}

.fetch-typography,
.fetch-typography label,
.fetch-typography .field-help,
.fetch-typography .output-meta {
  font-family: inherit;
  color: #4b5563;
}

.fetch-typography label {
  font-size: 0.8rem;
}

.fetch-typography .field-help,
.fetch-typography .output-meta {
  font-size: 0.72rem;
}

.fetch-typography input,
.fetch-typography select,
.fetch-typography textarea {
  margin: 3px 0;
}

.fetch-typography select,
.fetch-row .fetch-src,
.fetch-row .fetch-task {
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
  color: #111827;
  background: #ffffff;
}

.fetch-row {
  border: 1px solid #e5e7eb;
  border-radius: 0.45rem;
  padding: 0.5rem;
  background: #ffffff;
  display: grid;
  gap: 0.4rem;
}

.fetch-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.35rem;
}

.fetch-row-icon-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
}

.fetch-row-icon-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}

.fetch-row-grid {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fetch-id-source-stack {
  display: grid;
  gap: 0.45rem;
}

.fetch-task-cell {
  display: grid;
  gap: 0.35rem;
  align-content: end;
}

.fetch-id-source-stack>label,
.fetch-task-cell>label,
.fetch-url-wrap {
  display: grid;
  gap: 0.25rem;
  width: 100%;
  min-width: 0;
}

.fetch-url {
  width: fit-content(20);
  font-size: 0.78rem;
}

.fetch-url-wrap.hidden {
  display: none;
}

.fetch-tapis-controls {
  width: max-content;
  display: flex;
  gap: 0.45rem;
  align-items: flex-end;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.fetch-tapis-controls>label {
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.fetch-tapis-controls .fetch-tapis-token {
  width: fit-content;
  font-size: 0.78rem;
}

.fetch-tapis-controls.hidden {
  display: none;
}

.fetch-task-select {
  font-weight: 700;
}

.pool-count {
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.3rem;
}

.auth-box {
  margin: 0.5rem 0 0.9rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  padding: 0.7rem;
  background: #ffffff;
}

.auth-box label {
  font-size: 0.82rem;
  color: #374151;
  display: grid;
  gap: 0.25rem;
}

.auth-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-box input {
  border: 1px solid #d1d5db;
  border-radius: 0.35rem;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  font-family: inherit;
}

.curl-modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 1rem;
  box-sizing: border-box;
}

.curl-modal.hidden {
  display: none;
}

.curl-modal-card {
  width: min(980px, 100%);
  max-height: 85vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 0.65rem;
  border: 1px solid #d1d5db;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.curl-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
}

.curl-modal-head strong {
  font-size: 0.92rem;
  color: #1f2937;
}

.curl-modal-actions {
  display: flex;
  gap: 0.45rem;
}

.model-load-modal-body {
  padding: 1rem 1.1rem 1.05rem;
  display: grid;
  gap: 0.9rem;
}

.model-load-modal-model {
  font-size: 0.8rem;
  color: #6b7280;
}

.model-load-modal-message {
  min-height: 4.8rem;
  display: grid;
  place-items: center;
  text-align: center;
  color: #111827;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 0.6rem 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  background: #f9fafb;
}

.model-load-modal-progress-wrap {
  display: grid;
  gap: 0.45rem;
}

.model-load-modal-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.78rem;
  color: #4b5563;
}

.model-load-modal-progress-track {
  width: 100%;
  height: 0.7rem;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
  position: relative;
}

.model-load-modal-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #0ea5e9);
  transition: width 0.18s ease;
}

.model-load-modal-progress-track.indeterminate .model-load-modal-progress-fill {
  width: 36%;
  animation: model-load-indeterminate 1.1s ease-in-out infinite;
}

@keyframes model-load-indeterminate {
  0% {
    transform: translateX(-115%);
  }

  100% {
    transform: translateX(320%);
  }
}

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

  .app-sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

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

  .overview-main,
  .tests-shell {
    grid-template-columns: 1fr;
  }

  .pool-grid {
    grid-template-columns: 1fr;
  }

  .fetch-row-grid {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .chat-compact-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .advanced-row {
    grid-template-columns: 1fr;
  }

  .yolo-shell {
    grid-template-columns: 1fr;
  }

  .yolo-field-grid.cols-2,
  .yolo-task-grid {
    grid-template-columns: 1fr;
  }
}
