.screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.backBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  flex-shrink: 0;
}

.backBtn:active {
  opacity: 0.7;
}

.headerInfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.agentName {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg-primary);
  text-transform: capitalize;
}

.project {
  font-size: 12px;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.questionBar {
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.08);
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  font-size: 13px;
  color: var(--fg-primary);
  flex-shrink: 0;
}

.errorBar {
  padding: 8px 12px;
  background: rgba(255, 80, 80, 0.08);
  border-bottom: 1px solid rgba(255, 80, 80, 0.2);
  font-size: 13px;
  color: var(--fg-primary);
  flex-shrink: 0;
}

.rateLimitBar {
  padding: 8px 12px;
  background: rgba(255, 165, 0, 0.08);
  border-bottom: 1px solid rgba(255, 165, 0, 0.2);
  font-size: 13px;
  color: var(--fg-primary);
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rateLimitCountdown {
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
}

.outputArea {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.endedOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.endedText {
  font-size: 16px;
  font-weight: 500;
  color: var(--fg-muted);
}

.endedBackBtn {
  padding: 10px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--fg-primary);
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.endedBackBtn:active {
  opacity: 0.7;
}

.intentLine,
.taskLine {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--bg-secondary);
  overflow: hidden;
}

.intentLine {
  font-style: italic;
}

.intentLine svg,
.taskLine svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.subText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.headerProgressBar {
  height: 2px;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.headerProgressFill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.usageLabel {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.usageLabel.danger {
  color: var(--accent-red, #f44747);
}

.searchToggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius-md);
}

.searchToggle:active {
  opacity: 0.7;
}

.searchToggleActive {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.searchBar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.searchInput {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--fg-primary);
  font-size: 14px;
  font-family: var(--font-mono);
  outline: none;
}

.searchInput:focus {
  border-color: var(--accent);
}

.searchClear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}
