:root {
  --bg-canvas: #f3f4f6;
  --bg-shell: #ffffff;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f7f7f7;
  --bg-elevated: #ffffff;
  --bg-soft: #f5f6f7;
  --text-primary: #1f2329;
  --text-secondary: #3f4854;
  --text-muted: #7b8490;
  --accent-primary: #07c160;
  --accent-primary-strong: #06ad56;
  --accent-warm: #f5a623;
  --accent-success: #07c160;
  --accent-danger: #fa5151;
  --accent-purple: #576b95;
  --border-soft: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(7, 193, 96, 0.28);
  --shadow-panel: 0 6px 18px rgba(17, 24, 39, 0.06);
  --shadow-float: 0 20px 50px rgba(17, 24, 39, 0.12);
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  --space-6: 32px;
  --font-sans: "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  height: 100vh;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #ededed;
}

body::before {
  content: none;
}

button, input, textarea, select {
  font: inherit;
}

button {
  border: none;
  background: none;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100vh;
  min-height: 100vh;
  padding: 18px;
  gap: 14px;
  overflow: hidden;
}

.app-header,
.control-rail,
.arena-stage,
.insight-dock,
.surface-card,
.debug-console,
.modal,
.drawer-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-panel);
}

.app-header {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: center;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  background: var(--bg-panel);
  min-height: 0;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: none;
}

.brand-copy {
  min-width: 0;
}

.eyebrow {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  margin-top: 2px;
}

.header-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.header-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.status-badge,
.pill,
.chip,
.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1;
  border: 1px solid var(--border-soft);
}

.status-badge {
  font-weight: 700;
  background: #f5f6f7;
}

.status-idle { color: var(--text-secondary); }
.status-running, .status-streaming { color: var(--accent-primary); }
.status-paused, .status-thinking { color: var(--accent-warm); }
.status-complete { color: var(--accent-success); }
.status-error, .status-cancelled { color: var(--accent-danger); }

.header-progress {
  min-width: 220px;
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #eceff2;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-primary-strong), var(--accent-primary));
  transition: width 0.25s ease;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.header-action-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: 180ms ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  color: #ffffff;
  background: var(--accent-primary);
  box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-secondary {
  color: var(--text-primary);
  background: #f5f6f7;
  border-color: #e3e7eb;
}

.btn-secondary:hover:not(:disabled),
.icon-btn:hover:not(:disabled),
.tab-btn:hover:not(.active),
.ghost-row:hover {
  background: #eef2f5;
}

.btn-danger {
  color: #fa5151;
  background: #fff3f3;
  border-color: #ffd6d6;
}

.btn-warm {
  color: #9a6500;
  background: #fff7e8;
  border-color: #ffe0a8;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: var(--text-secondary);
  background: #f5f6f7;
  border: 1px solid #e3e7eb;
  cursor: pointer;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 290px;
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
}

.control-rail,
.insight-dock,
.arena-stage {
  min-height: 0;
  border-radius: var(--radius-lg);
}

.control-rail,
.insight-dock {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  overflow: auto;
  background: #f7f7f7;
  min-height: 0;
}

.arena-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  padding: 16px;
  gap: 14px;
  overflow: hidden;
  background: #e9ecef;
  min-height: 0;
}

.stage-scroll-shell {
  height: 100%;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.final-summary-card {
  background: #fffbe6;
  border-color: #f0e0a8;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h2,
.panel-heading h3,
.section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.section-caption,
.muted,
.helper-text,
.hint,
.micro-copy {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.surface-card {
  border-radius: var(--radius-md);
  padding: 16px;
}

.surface-card.soft {
  background: #f7f7f7;
}

.topic-grid,
.form-grid,
.metric-grid,
.insight-grid {
  display: grid;
  gap: 12px;
}

.input,
.textarea,
.select,
.input-sm,
.topic-input,
.rounds-input,
.param-input,
.search-input {
  width: 100%;
  color: var(--text-primary);
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.textarea {
  min-height: 132px;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus,
.input-sm:focus,
.topic-input:focus,
.rounds-input:focus,
.param-input:focus,
.search-input:focus {
  border-color: var(--border-strong);
  background: #ffffff;
}

.input-row,
.inline-fields,
.header-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mode-option,
.option-card,
.model-chip,
.stat-card,
.timeline-card,
.mini-card {
  border-radius: 16px;
  border: 1px solid #e0e5ea;
  background: #ffffff;
}

.mode-option {
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: 180ms ease;
}

.mode-option.active {
  border-color: rgba(7, 193, 96, 0.28);
  background: #f1fbf5;
}

.option-title {
  font-size: 13px;
  font-weight: 700;
}

.option-desc {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.active-model-list,
.status-list,
.quick-list,
.metrics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.model-chip {
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.model-chip.clickable {
  cursor: pointer;
}

.model-chip.clickable:hover {
  border-color: rgba(7, 193, 96, 0.22);
}

.model-avatar,
.timeline-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #02101b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.model-main {
  min-width: 0;
}

.model-name {
  font-size: 14px;
  font-weight: 700;
}

.model-meta,
.metric-label,
.timeline-meta,
.detail-meta,
.hi-meta {
  color: var(--text-muted);
  font-size: 12px;
}

.chip {
  color: var(--text-secondary);
}

.chip.status-thinking,
.metric-pill.warm {
  color: #9a6500;
  background: #fff1d6;
}

.chip.status-streaming,
.metric-pill.primary {
  color: #107c41;
  background: #e8f7ee;
}

.chip.status-complete,
.metric-pill.success {
  color: #107c41;
  background: #e8f7ee;
}

.chip.status-error,
.metric-pill.danger {
  color: #c53d3d;
  background: #fff1f1;
}

.chip.status-waiting {
  background: #f2f4f6;
}

.stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  flex-shrink: 0;
}

.stage-title {
  font-size: 22px;
  margin: 0;
}

.timeline-scroll {
  min-height: 0;
  padding: 0 6px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-gutter: stable;
}

.timeline-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
  background: #ffffff;
}

.timeline-model {
  margin-left: 0;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 12px 0;
}

.timeline-model .timeline-content {
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 4px 18px 18px 18px;
  padding: 16px;
  margin-top: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.timeline-model::before {
  display: none;
}

.timeline-host,
.timeline-final {
  margin-left: 46px;
  border-radius: 18px;
}

.timeline-system,
.timeline-round,
.timeline-followup,
.timeline-error {
  margin-left: 0;
  border-radius: 16px;
}

.timeline-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: transparent;
}

.timeline-round {
  background: #f8f9fb;
}

.timeline-round::before,
.timeline-system::before,
.timeline-model::before,
.timeline-host::before,
.timeline-final::before,
.timeline-error::before,
.timeline-followup::before {
  background: var(--accent-primary);
}

.timeline-system::before {
  background: #c1c7d0;
}

.timeline-model::before {
  background: var(--accent-primary);
}

.timeline-host::before,
.timeline-final::before {
  background: #c1c7d0;
}

.timeline-error::before {
  background: var(--accent-danger);
}

.timeline-followup::before {
  background: var(--accent-purple);
}

.timeline-system {
  background: #f6f7f9;
}

.timeline-host {
  background: #fafafa;
}

.timeline-final {
  background: #fffbe6;
  border-color: #f0e0a8;
}

.timeline-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.timeline-body {
  flex: 1;
  min-width: 0;
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 700;
}

.timeline-content {
  color: var(--text-secondary);
  line-height: 1.75;
}

.stream-text {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  color: inherit;
  font-family: inherit;
}

.cursor {
  color: var(--accent-primary);
  animation: blink 0.8s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.followup-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #dde2e8;
  flex-shrink: 0;
}

.followup-bar .textarea,
.followup-bar .input {
  min-height: 50px;
}

.placeholder,
.placeholder-text,
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 28px 18px;
  line-height: 1.7;
}

.debug-console {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(480px, calc(100vw - 36px));
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 280px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
}

.debug-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #eceff2;
}

.debug-log {
  max-height: 220px;
  overflow: auto;
  padding: 14px 18px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.log-line {
  white-space: pre-wrap;
  padding: 5px 0;
}

.log-error {
  color: #ffbec8;
}

.stats-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-card {
  padding: 14px;
}

.stat-value {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 700;
}

.tab-bar,
.settings-tabs,
.detail-tabs-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tab-btn,
.stab {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid #e1e5ea;
  background: #ffffff;
}

.tab-btn.active,
.stab.active {
  color: var(--text-primary);
  border-color: rgba(7, 193, 96, 0.28);
  background: #f1fbf5;
}

.tab-content,
.detail-tab-content {
  margin-top: 12px;
}

.markdown-body {
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 14px;
}

.markdown-body p {
  margin: 0.8em 0;
}

.markdown-body h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 1.4em 0 0.6em;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-soft);
}

.markdown-body h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.2em 0 0.5em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}

.markdown-body h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1em 0 0.4em;
}

.markdown-body h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.8em 0 0.3em;
}

.markdown-body strong {
  font-weight: 700;
  color: var(--text-primary);
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.6em 0;
  padding-left: 1.8em;
}

.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body li {
  margin: 0.35em 0;
  line-height: 1.8;
  display: list-item;
}

.markdown-body li + li {
  margin-top: 0.3em;
}

.markdown-body a {
  color: var(--accent-primary);
}

.markdown-body code {
  font-family: var(--font-mono);
  background: #f0f3f6;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 0.9em;
}

.markdown-body pre {
  overflow: auto;
  padding: 14px;
  border-radius: 16px;
  background: #f7f8fa;
  border: 1px solid #e4e8ec;
  margin: 0.8em 0;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.markdown-body blockquote {
  margin: 0.8em 0;
  padding: 8px 14px;
  border-left: 3px solid rgba(7, 193, 96, 0.45);
  color: var(--text-secondary);
  background: #f9fafb;
  border-radius: 0 8px 8px 0;
}

.markdown-body hr {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 1.2em 0;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.8em 0;
  font-size: 13px;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid #e4e8ec;
  padding: 8px 12px;
  text-align: left;
}

.markdown-body th {
  background: #f5f6f7;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.18);
}

.modal-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.modal {
  width: min(1180px, 100%);
  max-height: min(88vh, 920px);
  border-radius: 28px;
  padding: 22px;
  overflow: auto;
  background: #ffffff;
}

.settings-modal {
  width: min(980px, 100%);
}

.history-modal {
  width: min(1200px, 100%);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.modal-header h2 {
  margin: 0;
  flex: 1;
  font-size: 20px;
}

.modal-close {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  background: #f5f6f7;
}

.settings-body,
.history-body {
  display: grid;
  gap: 16px;
}

.settings-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.role-card {
  padding: 14px 0;
}

.role-card + .role-card {
  border-top: 1px solid #eef1f4;
}

.role-textarea {
  min-height: 120px;
}

.role-card .card-header {
  margin-bottom: 10px;
}

.custom-models {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-group,
.history-list,
.history-detail,
.custom-model-card {
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid #e7eaee;
}

.setting-group {
  padding: 16px;
}

.setting-group h3 {
  margin: 0 0 12px;
  font-size: 14px;
}

.model-check-row,
.param-row,
.history-item,
.card-header,
.detail-header,
.history-toolbar,
.detail-actions,
.add-model-row,
.continue-bar,
.cv-continue,
.detail-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-check-row,
.history-item,
.param-row {
  padding: 10px 0;
}

.model-check-row + .model-check-row,
.history-item + .history-item {
  border-top: 1px solid #eef1f4;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
}

.custom-model-card {
  padding: 14px;
}

.input-with-btn {
  width: calc(100% - 48px) !important;
}

.btn-eye {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  background: #f5f6f7;
  border: 1px solid #e3e7eb;
}

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: #f5f6f7;
  border: 1px solid #e3e7eb;
}

.btn-test {
  color: #107c41;
}

.btn-del {
  color: #c53d3d;
}

.test-result.ok { color: var(--accent-success); }
.test-result.fail { color: var(--accent-danger); }

.history-body {
  grid-template-columns: 360px minmax(0, 1fr);
  min-height: 62vh;
}

.history-list,
.history-detail {
  overflow: auto;
  padding: 12px;
}

.history-item {
  cursor: pointer;
}

.history-item.active {
  margin: 0 -4px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #f1fbf5;
  border-top-color: transparent;
}

.hi-topic {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.detail-meta {
  margin-bottom: 14px;
}

.drawer-overlay {
  display: flex;
  justify-content: flex-end;
}

.drawer-panel {
  width: min(560px, 100vw);
  height: 100vh;
  padding: 22px;
  overflow: auto;
  background: #ffffff;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.drawer-title {
  margin: 0;
  font-size: 20px;
}

.drawer-rounds {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.round-card {
  border-radius: 16px;
  padding: 14px;
  background: #f8f9fa;
  border: 1px solid #e7eaee;
}

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

.round-card-title {
  font-weight: 700;
}

.round-card-content {
  color: var(--text-secondary);
  line-height: 1.75;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(130, 138, 148, 0.32);
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1280px) {
  .workspace-grid {
    grid-template-columns: 290px minmax(0, 1fr);
  }

  .insight-dock {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

  .header-actions {
    align-items: flex-start;
  }

  .header-action-row {
    justify-content: flex-start;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    height: auto;
  }

  .control-rail,
  .arena-stage,
  .insight-dock {
    max-height: none;
  }

  .insight-dock {
    display: flex;
  }
}

@media (max-width: 768px) {
  .app-shell {
    padding: 12px;
    height: auto;
    min-height: 100vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
  }

  .debug-console {
    position: static;
    width: 100%;
    max-height: none;
  }

  .brand-block {
    align-items: flex-start;
  }

  .input-row,
  .followup-bar,
  .history-toolbar,
  .history-body,
  .card-header,
  .detail-header,
  .detail-actions,
  .add-model-row,
  .continue-bar,
  .cv-continue {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-switch {
    grid-template-columns: 1fr;
  }

  .history-body {
    grid-template-columns: 1fr;
  }

  .settings-overview-grid {
    grid-template-columns: 1fr;
  }

  html, body {
    overflow: auto;
    height: auto;
  }

  .drawer-panel {
    width: 100vw;
  }
}
