* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

/* ── Header ── */
.header {
  padding: 10px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-shrink: 0;
}
.header h1 { font-size: 15px; font-weight: 700; letter-spacing: 0.05em; }
.header .subtitle { font-size: 11px; color: rgba(255,255,255,0.35); }

/* ── Layout ── */
main {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: width 0.22s ease, border-color 0.22s ease;
}
.sidebar-header {
  padding: 10px 12px 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.btn-new-run {
  font-size: 10px;
  font-weight: 600;
  color: rgba(100,149,237,0.8);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-new-run:hover { color: rgba(100,149,237,1); }
.sidebar-list {
  overflow-y: auto;
  flex: 1;
}
/* ── Sidebar: new structure ── */
/* ── Sidebar brand header ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 8px 0 16px;
  flex-shrink: 0;
}
.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.85);
}
.sidebar-brand-toggle {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.68);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.sidebar-brand-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
}
.sidebar-brand-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(18,18,28,0.96);
  color: rgba(255,255,255,0.82);
  font-size: 11px;
  font-weight: 400;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 20;
}
.sidebar-brand-toggle:hover::after { opacity: 1; transition-delay: 0.15s; }
.sidebar-brand { position: relative; }

.sidebar.collapsed {
  width: 48px;
  border-right-color: rgba(255,255,255,0.06);
}
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 0; }
.sidebar.collapsed .sidebar-brand-name { display: none; }
.sidebar-header { display: none; }
.btn-new-run { display: none; }
.sidebar-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 0 6px;
  gap: 2px;
  flex-shrink: 0;
}
.sidebar-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.68);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
  position: relative;
}
.sidebar-nav-btn:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.9); }
.sidebar-nav-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-nav-label {
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.15s;
  text-align: left;
}
.sidebar-nav-btn.active {
  background: rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.96);
}
.sidebar-nav-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  white-space: nowrap;
  background: rgba(18,18,28,0.96);
  color: rgba(255,255,255,0.82);
  font-size: 11px;
  font-weight: 400;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 20;
}
.sidebar-nav-btn:hover::after { opacity: 1; transition-delay: 0.15s; }
.sidebar.collapsed .sidebar-nav-btn { justify-content: center; width: 100%; padding: 0; }
.sidebar.collapsed .sidebar-nav-label { display: none; }
.sidebar.collapsed .sidebar-history { display: none; }
.sidebar.collapsed .sidebar-search-wrap { display: none; }
.sidebar-search-wrap {
  display: none;
  padding: 0 8px 6px;
}
.sidebar-search-wrap.open { display: block; }
.sidebar-search-input {
  width: 100%;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e0e0e0;
  font-size: 12px;
  padding: 0 8px;
  outline: none;
}
.sidebar-search-input:focus { border-color: rgba(100,149,237,0.5); }
.sidebar-history {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 4px;
}
.sidebar-history-label {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.3);
}
.run-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.1s;
}
.run-item:hover { background: rgba(255,255,255,0.05); }
.run-item.active { background: rgba(100,149,237,0.15); }
.run-item .run-preview {
  font-size: 12px;
  color: #c8c8d8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}
.run-item .run-date {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
}
.sidebar-empty {
  padding: 16px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.25);
  font-style: italic;
}

/* ── Content area ── */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Input area ── */
.input-area {
  flex-shrink: 0;
  padding: clamp(72px, 18vh, 210px) 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

body.dev-mode .input-area {
  padding-top: clamp(32px, 7vh, 76px);
}

.input-stage {
  width: min(860px, 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  color: #e0e0e0;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
textarea:focus { border-color: rgba(100,149,237,0.6); }
textarea::placeholder { color: rgba(255,255,255,0.25); }

#prompt-input {
  min-height: 108px;
  resize: none;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 22px 26px 10px;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255,255,255,0.9);
}
#prompt-input:focus { border-color: transparent; }
#prompt-input::placeholder { color: rgba(255,255,255,0.28); }

.composer-shell {
  width: 100%;
  min-height: 174px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background: rgba(255,255,255,0.055);
  box-shadow: 0 18px 60px rgba(0,0,0,0.22);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.composer-shell:focus-within {
  border-color: rgba(140,180,255,0.55);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 22px 70px rgba(0,0,0,0.28);
}

.composer-footer {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#run-in-progress {
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  white-space: nowrap;
}

/* ── Input sections (flattened, single-column) ── */
.input-documents-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-section textarea {
  min-height: 80px;
  resize: vertical;
}

.col-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: capitalize;
  color: rgba(255,255,255,0.4);
}

/* ── Drop zone ── */
.drop-zone {
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 12px 10px;
  text-align: center;
  color: rgba(255,255,255,0.35);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover {
  border-color: rgba(100,149,237,0.5);
}
.drop-zone.dragover {
  border-color: rgba(100,149,237,0.7);
  background: rgba(100,149,237,0.08);
}

/* ── File list ── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  font-size: 11px;
  color: #c8c8d8;
}
.file-item .file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item .file-remove {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
}
.file-item .file-remove:hover { color: #f08080; }

/* ── Attached files preview (user-mode chips) ── */
.attached-files-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 12px 14px 0;
  min-height: 0;
}

/* ── Attached files preview cards ── */
.attached-file-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 218px;
  padding: 7px 9px;
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #e0e0e0;
  transition: border-color 0.15s, background 0.15s;
}

.attached-file-card:hover,
.attached-file-card:focus-within {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.attached-file-card .aff-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 6px;
  background: #4a7ce8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.attached-file-card .aff-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding-right: 14px;
}

.attached-file-card .aff-name {
  min-width: 0;
  display: flex;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.attached-file-card .aff-base {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attached-file-card .aff-ext {
  flex-shrink: 0;
}

.attached-file-card .aff-type {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
}

.attached-file-card .file-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}

.attached-file-card:hover .file-remove,
.attached-file-card:focus-within .file-remove {
  opacity: 1;
}

.attached-file-card .file-remove:hover,
.attached-file-card .file-remove:focus-visible {
  color: #f08080;
}

/* ── Directory input ── */
.dir-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}
.dir-input-row input[type="text"] {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  color: #e0e0e0;
  padding: 5px 8px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  outline: none;
}
.dir-input-row input[type="text"]:focus {
  border-color: rgba(100,149,237,0.5);
}

/* ── Action row ── */
.action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

button {
  padding: 7px 16px;
  border-radius: 4px;
  border: none;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, background 0.15s;
}
button:disabled { opacity: 0.45; cursor: not-allowed; }

#btn-run {
  background: #4a7ce8;
  color: #fff;
  font-weight: 600;
}
#btn-run:hover:not(:disabled) { background: #5a8cf8; }

.btn-submit-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: #4a7ce8;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, opacity 0.15s, transform 0.15s;
}
.composer-shell #btn-run {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
}
.composer-shell.has-prompt #btn-run {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}
.btn-submit-icon:hover:not(:disabled) {
  background: #5a8cf8;
}
.btn-submit-icon:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-attach {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.btn-attach:hover:not(:disabled) {
  background: rgba(255,255,255,0.11);
  color: rgba(255,255,255,0.92);
}
.btn-attach:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#btn-stop {
  background: rgba(220,80,60,0.85);
  color: #fff;
  font-weight: 600;
}
#btn-stop:hover { background: rgba(230,90,70,1); }

.btn-mark-stopped {
  background: rgba(180,140,60,0.85);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 6px;
  font-weight: 500;
}
.btn-mark-stopped:hover { background: rgba(200,160,70,1); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.checkbox-label input[type="checkbox"] { cursor: pointer; accent-color: #4a7ce8; margin-left: auto; }

/* ── Controls row (quiet secondary controls) ── */
.controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

/* ── Mode selector (segmented control) ── */
.mode-selector {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mode-label {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
  white-space: nowrap;
}
.mode-seg {
  display: flex;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.mode-seg input[type="radio"] { display: none; }
.mode-seg label {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  user-select: none;
  line-height: 1.4;
}
.mode-seg label:not(:last-child) {
  border-right: 1px solid rgba(255,255,255,0.15);
}
.mode-seg input[type="radio"]:checked + label {
  background: rgba(74,124,232,0.25);
  color: #8fb3f8;
}
.mode-seg label:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.65);
}

/* ── Input header (Direction B ritual frame) ── */
.input-header {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  text-align: center;
  margin-bottom: 6px;
}

/* ── Starter chips (categories, not full prompts) ── */
.starter-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}
.starter-chip {
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 16px;
  border: none;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-weight: 500;
  white-space: nowrap;
}
.starter-chip:hover {
  background: rgba(74,124,232,0.12);
  color: rgba(255,255,255,0.85);
}
.starter-chip.active {
  background: rgba(74,124,232,0.2);
  color: #8fb3f8;
}

/* ── Follow-up mode bar ── */
.followup-bar {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(74,124,232,0.1);
  border: 1px solid rgba(74,124,232,0.25);
  color: rgba(200,216,248,0.85);
}
.followup-bar.active { display: flex; }
.followup-bar .followup-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.followup-cancel {
  background: none;
  border: none;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  text-decoration: underline;
}
.followup-cancel:hover { color: rgba(255,255,255,0.7); }

/* ── Parent run linkage badge ── */
.parent-run-link {
  font-size: 11px;
  color: rgba(100,149,237,0.75);
  padding: 4px 0 2px;
  display: none;
}
.parent-run-link.visible { display: block; }
.parent-run-link a {
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Continue from run button ── */
.btn-continue-run {
  display: none;
  margin: 0;
  padding: 0 10px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(74,124,232,0.4);
  background: rgba(74,124,232,0.12);
  color: #8fb3f8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-continue-run:hover { background: rgba(74,124,232,0.22); border-color: rgba(74,124,232,0.65); }
.btn-continue-run.visible { display: inline-block; }

/* ── Output area ── */
.output-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.output-area.has-final-result #final-map {
  order: 2;
}

.output-area.has-final-result .processing-details {
  order: 1;
}

.processing-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.processing-summary {
  display: none;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: min(860px, 100%);
  padding: 5px 0;
  border: none;
  background: none;
  color: rgba(255,255,255,0.48);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
}

.processing-summary:hover,
.processing-summary:focus-visible {
  color: rgba(255,255,255,0.76);
}

.processing-summary-chevron {
  flex-shrink: 0;
  transition: transform 0.15s;
}

.processing-details:not([data-collapsed="true"]) .processing-summary-chevron {
  transform: rotate(90deg);
}

.processing-details[data-collapsed="true"] .processing-details-body {
  display: none;
}

.output-area.has-processing-summary .processing-summary {
  display: inline-flex;
}

.output-area.has-processing-summary .processing-details {
  margin: 2px auto 0;
  width: min(860px, 100%);
}

.output-area.has-processing-summary .processing-details-body {
  padding-top: 4px;
}

/* ── Consumer view (animation + phases) ── */
#consumer-view {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 20px 16px 12px;
  gap: 12px;
}
#consumer-view.active { display: flex; }

#consumer-view canvas {
  width: 280px;
  height: 200px;
}

.phase-row {
  display: flex;
  gap: 24px;
  align-items: center;
}
.phase-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.phase-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transition: all 0.4s ease;
}
.phase-dot.active {
  width: 9px;
  height: 9px;
  background: rgba(220,150,40,0.85);
  box-shadow: 0 0 8px rgba(220,150,40,0.4);
}
.phase-dot.done {
  background: rgba(60,180,80,0.7);
}
.phase-label {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-weight: 500;
  transition: color 0.4s ease;
}
.phase-label.active { color: rgba(255,255,255,0.7); }
.phase-label.done { color: rgba(255,255,255,0.4); }

#consumer-timer {
  font-size: 11px;
  color: rgba(255,255,255,0.25);
}

/* ── Developer view separator ── */
#dev-separator {
  display: none;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin: 6px 0;
}
#dev-separator.active { display: block; }

/* ── Error banner ── */
#error-banner {
  width: min(860px, 100%);
  margin: 0 auto;
  background: rgba(200,50,40,0.2);
  border: 1px solid rgba(200,80,70,0.5);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  color: #f08080;
}

/* ── Step list ── */
#step-list { display: flex; flex-direction: column; gap: 4px; }
.phase-header {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  margin-top: 8px;
}
.phase-header:first-child { margin-top: 0; }

.step-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.step-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}
.step-icon.done {
  background: rgba(60,180,80,0.25);
  border: 1.5px solid rgba(60,180,80,0.7);
  color: #5dd87a;
}
.step-icon.warn {
  background: rgba(200,50,40,0.2);
  border: 1.5px solid rgba(200,80,60,0.7);
  color: #f08080;
}
.step-icon.active {
  background: rgba(220,130,30,0.2);
  border: 1.5px solid rgba(220,150,40,0.8);
  color: #e8a040;
}
.step-icon.pending {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.3);
}
/* Interrupted step of a stale-active run (Plan 09/10 recovery state):
   muted amber — clearly not the live orange ◉. */
.step-icon.stalled {
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(200,160,60,0.5);
  color: rgba(225,185,105,0.8);
}

/* ── Stale-active recovery (Plan 10) — CSS defense in depth ──
   Under body.run-stale no surface may present healthy live work, even if a
   JS path misses the applicator: live step accents and timers degrade to the
   frozen stalled look instead of claiming liveness. */
body.run-stale .step-icon.active {
  background: rgba(255,255,255,0.04);
  border-color: rgba(200,160,60,0.5);
  color: rgba(225,185,105,0.8);
}
body.run-stale #active-timer { display: none; }
body.run-stale #run-in-progress { display: none !important; }

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

.step-label {
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.step-name { font-weight: 500; }
.step-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 9px;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  margin-left: 5px;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, color 0.15s;
}
.step-info:hover { border-color: rgba(100,149,237,0.6); color: rgba(100,149,237,0.9); }
.step-tooltip {
  display: none;
  position: fixed;
  background: #252545;
  border: 1px solid rgba(100,149,237,0.3);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  color: #c8d0e8;
  width: 280px;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.step-tooltip.visible { display: block; }
.step-meta { font-size: 11px; color: rgba(255,255,255,0.3); white-space: nowrap; }

.step-expand-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  cursor: pointer;
  padding: 0 0 0 6px;
  transition: color 0.15s;
}
.step-expand-btn:hover { color: rgba(255,255,255,0.7); }

/* PB4 (Option C+): the per-step Reject affordance is removed for alpha; its
   button styles were dropped with the button. */

.step-output {
  display: none;
  margin-top: 6px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 10px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.5;
  color: #b0c8e8;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow-y: auto;
}
.step-output.open { display: block; }

/* ── Final map ── */
/* Toolbar sits in normal flow at the top of the answer card, right-aligned —
 * NOT an absolute overlay. This lets the answer body use the full card width
 * (no reserved right gutter); the toolbar simply takes its own row above. */
.result-toolbar {
  display: none;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.result-toolbar.visible { display: flex; }
.btn-copy {
  position: relative;
  width: auto;
  height: 28px;
  padding: 0 8px;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.72);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-copy:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.24);
  color: rgba(255,255,255,0.92);
}
.btn-copy::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: auto;
  white-space: nowrap;
  background: rgba(18, 18, 28, 0.96);
  color: rgba(255,255,255,0.82);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  padding: 5px 9px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 20;
}
.btn-copy:hover::after {
  opacity: 1;
  transition-delay: 0.5s;
}
.copy-status {
  font-size: 11px;
  color: rgba(255,255,255,0.42);
  min-height: 16px;
  white-space: nowrap;
  pointer-events: none;
}
#final-map {
  position: relative;
  border: 1px solid rgba(100,149,237,0.25);
  border-radius: 6px;
  padding: 18px 20px;
  background: rgba(100,149,237,0.05);
  font-size: 13px;
  line-height: 1.7;
}
/* No answer-body gutter: the toolbar is in normal flow above the content (see
 * .result-toolbar), so #final-map-content and the degraded note keep full width. */
#final-map h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 16px 0 6px;
  color: #c8d8f8;
}
#final-map h2:first-child { margin-top: 0; }
#final-map strong { color: #e8e8f8; font-weight: 600; }
#final-map ul { padding-left: 18px; margin: 4px 0 8px; }
#final-map li { margin-bottom: 3px; }
#final-map hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 14px 0;
}
#final-map p { margin-bottom: 8px; }

/* PB6 degraded-result label: a calm fidelity note for the DB-summary fallback.
   Muted blue (not an error red) — it states transport fidelity, never alarm. */
.result-degraded-note {
  margin: 0 0 12px;
  padding: 7px 11px;
  border-left: 3px solid rgba(100,149,237,0.45);
  border-radius: 4px;
  background: rgba(100,149,237,0.08);
  color: rgba(255,255,255,0.62);
  font-size: 12px;
  line-height: 1.5;
}

/* ── Empty state ── */
#empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.2);
  font-size: 13px;
  font-style: italic;
}

/* ── Status badges ── */
.run-status {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.run-status.stopped, .run-status.failed {
  background: rgba(220,150,40,0.2);
  color: #e8a040;
}
.run-status.running {
  background: rgba(100,149,237,0.2);
  color: #6495ed;
}
#btn-resume {
  background: rgba(220,150,40,0.85);
  color: #fff;
  font-weight: 600;
}
#btn-resume:hover:not(:disabled) { background: rgba(230,160,50,1); }

/* ── Scrollbar styling ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

#drag-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(30, 40, 60, 0.75);
  border: 3px dashed rgba(100, 149, 237, 0.7);
  pointer-events: none;
}
#drag-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}
.drag-overlay-inner {
  color: rgba(100, 149, 237, 0.95);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: rgba(20, 28, 48, 0.85);
  padding: 20px 40px;
  border-radius: 10px;
}

/* ── Run controls: Stop button container (visible during active runs) ── */
.run-controls {
  display: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  text-align: center;
  padding: 16px 20px;
}

.run-controls #btn-stop {
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  background-color: #e55039;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.run-controls #btn-stop:hover {
  background-color: #d63817;
}

.run-controls #btn-stop:active {
  transform: scale(0.98);
}

/* ── Active run focus mode (Direction B: centerpiece animation) ── */
body.run-active .sidebar {
  opacity: 0.3;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Leave-and-return (Gap 8): an auto-restored active run resumes polling and shows
   the run, but must NOT trap the user. Re-enable the sidebar as a navigation
   escape hatch for the restored case only — freshly-submitted runs keep the
   locked-sidebar focus mode above. */
body.run-active.run-restored .sidebar {
  opacity: 0.55;
  pointer-events: auto;
}

body.run-active .input-area {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  height: 0;
}

body.run-active .header {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

body.run-active .run-controls {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

body.run-active #consumer-view {
  display: flex;
  flex: 1;
  width: 100%;
  justify-content: center;
  align-items: center;
}

/* ── D0 §4c.4.4: explicit /r/<id> restore pending state ──
   The canonical run URL names a specific run, so /r/<id> must NOT flash the
   fresh new-prompt composer before restoreRunFromId() resolves. The server
   renders <body class="run-pending"> so this state is visible from the FIRST
   paint (a JS-only fix cannot close a flash that precedes client JS). It is
   route/hydration state ONLY — it must never imply liveness, so it never writes
   run-active / run-stale / data-run-locked. restoreRunFromId() removes the class
   on success and on non-auth failure; on auth-expiry it is not cleared inside
   restoreRunFromId — the class falls away as the →AUTH redirect/navigation
   replaces the page.

   Hide/inert the central fresh-composer affordances (Ask once., starter chips,
   submit, attach — all live inside .input-area) exactly as run-active already
   does, and show a quiet route-aware loading status in their place. */
body.run-pending .input-area {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

.run-pending-status {
  display: none;
}

body.run-pending .run-pending-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 56px 24px;
  color: rgba(255,255,255,0.5);
  font-size: 14px;
}

.run-pending-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.18);
  border-top-color: rgba(255,255,255,0.55);
  animation: run-pending-spin 0.8s linear infinite;
}

@keyframes run-pending-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .run-pending-spinner {
    animation: none;
  }
}

/* ── Developer-mode toggle ── */
.dev-mode-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 50;
}
.dev-mode-toggle:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.16);
}
body.dev-mode .dev-mode-toggle {
  background: rgba(100,149,237,0.18);
  color: rgba(140,180,255,0.95);
  border-color: rgba(100,149,237,0.4);
}

/* ── Hide dev-mode toggle when not in ?dev=1 mode ── */
body:not(.dev-mode-by-url) #dev-mode-toggle {
  display: none;
}

/* ── Dev-mode pill badge ── */
body.dev-mode::before {
  content: "Developer mode";
  position: fixed;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  background: rgba(180, 140, 60, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
}

/* ── Locked-state styling (completed run loaded) ── */
body[data-run-locked="true"] #prompt-input {
  pointer-events: none;
  opacity: 0.65;
  min-height: 42px;
  padding: 12px 16px;
  overflow: hidden;
}

body[data-run-locked="true"] #prompt-input.clamped {
  -webkit-mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 62%, transparent 100%);
}

.prompt-expand {
  display: none;
  align-items: center;
  gap: 4px;
  margin: 2px 0 12px 26px;
  padding: 0;
  border: none;
  background: none;
  color: rgba(255,255,255,0.68);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
}

.prompt-expand:hover,
.prompt-expand:focus-visible {
  color: rgba(255,255,255,0.92);
}

.prompt-expand .prompt-expand-chevron {
  transition: transform 0.15s;
}

.prompt-expand.expanded .prompt-expand-chevron {
  transform: rotate(180deg);
}

body[data-run-locked="true"] .content {
  overflow-y: auto;
}

body[data-run-locked="true"] .output-area {
  flex: 0 0 auto;
  overflow: visible;
}

body[data-run-locked="true"] .header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #1a1a2e;
}

body[data-run-locked="true"] .input-area {
  padding: 24px 24px 12px;
}

body[data-run-locked="true"] .input-stage {
  gap: 10px;
}

body[data-run-locked="true"] .input-header,
body[data-run-locked="true"] .composer-footer {
  display: none;
}

body[data-run-locked="true"] .composer-shell {
  min-height: 0;
}

body[data-run-locked="true"] .composer-shell #btn-run {
  display: none;
}

body[data-run-locked="true"] .starter-chips {
  display: none;
}

body[data-run-locked="true"] #btn-attach-file,
body[data-run-locked="true"] .file-item .file-remove,
body[data-run-locked="true"] .attached-file-card .file-remove {
  display: none;
}

/* ── B5 §4b: completed-run quick-jump section index ──
 * A thin right-gutter rail over the locked single-column scroll (§4a.2). Pinned
 * below the sticky header (header z-index:5 wins on any overlap), inset from the
 * right to clear the .content scrollbar; the sidebar is on the left, so no
 * left-side overlap. Compact marks at rest; hover/focus expands readable labels.
 * Built/removed entirely by quickjump.js — no children when the predicate is unmet. */
.run-quickjump {
  position: fixed;
  top: 50%;
  /* Fallback inset only — quickjump.js positions the rail relative to the answer
     card's right border (_quickjumpPositionRail) so the compact marks land in the
     margin gutter just outside #final-map, never over the text. */
  right: 8px;
  transform: translateY(-50%);
  z-index: 4;
  max-height: 72vh;
  display: flex;
  align-items: center;
  pointer-events: none;
}
.run-quickjump[hidden] { display: none; }

.quickjump-list {
  list-style: none;
  margin: 0;
  /* Tight on the gutter (right) side so the row-reversed mark hugs the rail's
     right edge and clears the answer card's border; roomier on the left where the
     labels expand. */
  padding: 6px 1px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  pointer-events: auto;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

/* `:not(.quickjump-collapsed)` lets an Escape press (which sets that class) override
 * the hover/focus reveal — so Escape closes a hover-open menu even while the pointer
 * is still over the rail. The class is cleared on mouseleave / focusin. */
.run-quickjump:not(.quickjump-collapsed):hover .quickjump-list,
.run-quickjump:not(.quickjump-collapsed):focus-within .quickjump-list {
  background: rgba(26,26,46,0.94);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 6px 22px rgba(0,0,0,0.38);
}

.quickjump-li { display: flex; }

/* row-reverse pins the MARK to the right edge of the rail (the margin-annotation
 * gutter, just outside the answer card) and makes the label grow LEFTWARD over the
 * answer on hover/focus — so the compact mark never sits on the reading text. */
.quickjump-item,
.quickjump-omitted {
  flex-direction: row-reverse;
}

.quickjump-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 1px 3px 4px;
  border-radius: 6px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  cursor: pointer;
}

.quickjump-mark {
  flex-shrink: 0;
  width: 16px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.32);
  transition: background 0.15s, height 0.15s;
}
.quickjump-mark.muted { background: rgba(255,255,255,0.16); }

/* Compact at rest: marks only. Hover/focus-within (keyboard) reveals the labels. */
.quickjump-label {
  max-width: 0;
  overflow: hidden;
  white-space: nowrap;
  opacity: 0;
  font-size: 12px;
  transition: max-width 0.15s, opacity 0.15s;
}
.run-quickjump:not(.quickjump-collapsed):hover .quickjump-label,
.run-quickjump:not(.quickjump-collapsed):focus-within .quickjump-label {
  max-width: 230px;
  opacity: 1;
}

.quickjump-item:hover,
.quickjump-item:focus-visible {
  color: rgba(255,255,255,0.92);
  outline: none;
}
.quickjump-item:hover .quickjump-mark,
.quickjump-item:focus-visible .quickjump-mark {
  background: rgba(255,255,255,0.62);
}

/* Keyboard-focused item (arrow / Tab navigation): a distinct background pill so the
 * keyboard cursor is unmistakable. It reads on a different channel from the active
 * section (which is a cornflower mark), so the two never fight — and when they land on
 * the same row the focus pill keeps keyboard focus legible. */
.quickjump-item:focus-visible {
  color: #fff;
  background: rgba(255,255,255,0.14);
}

/* Active/current section emphasis (updated on scroll by quickjump.js). Emphasize
 * via height + color — NOT width — so every mark keeps the same right-anchored
 * footprint and the active one never pokes back across the card border. */
.quickjump-item.is-active { color: #fff; }
.quickjump-item.is-active .quickjump-mark {
  height: 5px;
  background: cornflowerblue;
}

/* Cap-overflow note: muted, non-interactive, never a jump target, never active. */
.quickjump-omitted {
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  color: rgba(255,255,255,0.42);
  font-style: italic;
}
.quickjump-omitted .quickjump-label { font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  .quickjump-list,
  .quickjump-mark,
  .quickjump-label { transition: none; }
}

/* No permanent content-width reservation: the answer keeps its full width and the
 * compact rail floats over the far-right edge. The expanded (hover/focus) menu may
 * transiently overlay the answer text — it collapses the moment pointer/focus
 * leaves. The rail still clears persistent chrome (sidebar, sticky header, browser
 * scrollbar) via `right` inset + z-index; only the answer body is overlaid. */

/* Narrow/tablet/mobile: hide the rail entirely — the sanctioned non-crowding
 * outcome (§4b). Below this width the content column is too tight for even a
 * floating rail, so it is dropped rather than overlaying a phone column. */
@media (max-width: 900px) {
  .run-quickjump { display: none; }
}

/* ── Default: end-user mode (clean view) ── */
.advanced-controls,
.controls-row,
.input-documents-section,
.history-section {
  display: none;
}

/* ── Developer mode: show the affordances ── */
body.dev-mode .advanced-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
body.dev-mode .controls-row {
  display: flex;
}
body.dev-mode .input-documents-section,
body.dev-mode .history-section {
  display: flex;
}

@media (max-width: 760px) {
  .sidebar {
    width: 52px;
    border-right-color: rgba(255,255,255,0.06);
  }
  .sidebar-brand {
    justify-content: center;
    padding: 0;
  }
  .sidebar-brand-name,
  .sidebar-nav-label,
  .sidebar-history,
  .sidebar-search-wrap {
    display: none;
  }
  .sidebar-nav-btn {
    justify-content: center;
    padding: 0;
  }
  .header .subtitle {
    display: none;
  }
  .input-area {
    padding: 48px 14px 24px;
  }
  body.dev-mode .input-area {
    padding-top: 24px;
  }
  .input-stage {
    gap: 13px;
  }
  .input-header {
    font-size: 22px;
  }
  #prompt-input {
    min-height: 96px;
    padding: 18px 18px 8px;
    font-size: 15px;
  }
  .composer-shell {
    min-height: 158px;
  }
  .composer-footer {
    padding: 0 12px 12px;
  }
  .starter-chips {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .starter-chip {
    flex: 0 0 auto;
  }
  .controls-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .phase-row {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 18px;
  }
  /* .result-toolbar is already a normal-flow, wrapping row at all widths — no
     mobile-specific override or gutter reset needed (the answer is full-width). */
}

/* ── Status banner (lifecycle state: queued/running/failed/stopped) ── */
.status-banner {
  width: min(860px, 100%);
  margin: 0 auto 4px;
  padding: 8px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Run status badge: queued variant ── */
.run-status.queued {
  background: rgba(220,150,40,0.2);
  color: #e8a040;
}

/* ── Login page ── */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
}

.login-card {
  width: min(400px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 40px 36px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
}

.login-card .login-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.88);
}

.login-card .login-subtitle {
  font-size: 13px;
  color: rgba(255,255,255,0.38);
}

.login-card input[type="email"] {
  height: 40px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: #e0e0e0;
  padding: 0 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}

.login-card input[type="email"]:focus {
  border-color: rgba(100,149,237,0.55);
}

.login-card .btn-login {
  background: #4a7ce8;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  height: 40px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.login-card .btn-login:hover { background: #5a8cf8; }

.login-confirm {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* ── Worker provenance line (display-only, see render.js) ── */
.worker-provenance {
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  padding: 4px 0 2px;
  display: none;
}
.worker-provenance.visible { display: block; }

/* Compact API usage line (Phase 1.2, operator-only) — sits just below the
   worker provenance line, slightly dimmer. Toggled via .visible by render.js. */
.run-usage {
  font-size: 11px;
  color: rgba(255,255,255,0.30);
  padding: 0 0 4px;
  display: none;
}
.run-usage.visible { display: block; }
