/* Last Window Scan / Last Freezer Scan controls.

   These live in the dashboard shell above the report iframe, so the report
   can be either the synthetic intake page or an archived statement. The
   silver face, square bevels, recessed progress track, and navy fill mirror
   the Windows 98 dialog rendered inside that iframe. */

.scanner-report-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  box-sizing: border-box;
  width: calc(100% - 20px);
  margin: 8px 10px 10px;
  padding: 10px 12px;
  color: #000;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #dfdfdf,
    inset -2px -2px #808080,
    inset 2px 2px #fff;
  font-family: Tahoma, "MS Sans Serif", Arial, sans-serif;
  font-size: 13px;
}

.scanner-report-start {
  flex: 0 0 auto;
  min-width: 110px;
  min-height: 32px;
  padding: 3px 14px;
  border: 0;
  border-radius: 0;
  color: #000;
  background: #c0c0c0;
  box-shadow:
    inset -1px -1px #0a0a0a,
    inset 1px 1px #fff,
    inset -2px -2px #808080,
    inset 2px 2px #dfdfdf;
  font: inherit;
  cursor: pointer;
}

.scanner-report-start:active:not(:disabled) {
  padding: 4px 13px 2px 15px;
  box-shadow:
    inset -1px -1px #fff,
    inset 1px 1px #0a0a0a,
    inset -2px -2px #dfdfdf,
    inset 2px 2px #808080;
}

.scanner-report-start:focus-visible {
  outline: 1px dotted #000;
  outline-offset: -5px;
}

.scanner-report-start:disabled {
  color: #808080;
  text-shadow: 1px 1px #fff;
  cursor: wait;
}

.scanner-report-progress {
  flex: 1 1 auto;
  min-width: 140px;
}

.scanner-report-controls .scanner-state {
  margin: 0 0 4px;
  color: #000;
  font: inherit;
}

.scanner-report-controls .startup-progress-shell {
  box-sizing: border-box;
  width: 100%;
  height: 28px;
  margin: 0;
  padding: 4px;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow:
    inset -2px -2px #dfdfdf,
    inset 2px 2px #808080;
}

.scanner-report-controls .scanner-bar {
  height: 100%;
  width: 0;
  border-radius: 0;
  background: #000080;
  box-shadow: none;
  transition: none;
}

.scanner-report-controls.scan-complete .scanner-bar {
  background: #008000;
}

.scanner-report-controls.scan-busy .scanner-bar,
.scanner-report-controls.scan-error .scanner-bar {
  background: #b00000;
}

.scanner-report-controls .scanner-state.scanner-blink {
  color: #b00000;
}

/* intake_report.css sizes the dialog's window-body from its iframe viewport.
   Giving both Last Scan iframes the report view's existing extra 20vh makes
   the Windows 98 dialog visibly taller instead of only growing its page. */
#scanners-last-window .plan-frame,
#scanners-last-freezer .plan-frame {
  height: calc(100vh - 60px + 20vh);
}

/* Scan diagnostics are stacked in evidence order: report, Mazda's thoughts,
   the exact Letta Code conversation, then durable archive confirmation. */
#scanners-last-window .agent-detail-section,
#scanners-last-freezer .agent-detail-section {
  margin-top: 20px;
  padding: 0 16px;
}

.mazda-terminal-section,
.archive-verification-section {
  margin: 20px 16px 0;
  padding: 16px;
  border-radius: 8px;
}

.mazda-terminal-section {
  color: #d3d7de;
  background: #0b0e14;
}

.mazda-terminal-section.hidden,
.archive-verification-section.hidden {
  display: none;
}

.mazda-terminal-section h2,
.archive-verification-section h3 {
  margin: 0 0 10px;
}

.mazda-terminal-context,
.mazda-terminal-status {
  margin: 6px 0;
  color: #aeb6c2;
  font: 13px/1.4 "Courier New", Courier, monospace;
}

.mazda-terminal-status.error {
  color: #ff8a8a;
}

.mazda-terminal-section .terminal-host {
  height: 420px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.mazda-terminal-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 84px;
  padding: 10px;
  color: #111827;
  background: #fff;
  border: 1px solid #64748b;
  border-radius: 4px;
  font: 15px/1.4 Arial, sans-serif;
  resize: vertical;
}

.mazda-terminal-controls {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.archive-verification-section {
  color: #e2e8f0;
  background: #172033;
}

.archive-verification-path {
  overflow-wrap: anywhere;
  margin: 0;
  padding: 10px;
  color: #102a13;
  background: #a7f3b2;
  font: 14px/1.4 "Courier New", Courier, monospace;
}

@media (max-width: 640px) {
  .scanner-report-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .mazda-terminal-controls {
    align-items: stretch;
    flex-direction: column;
  }
}
