:root {
  color-scheme: light;
  --ink: #202426;
  --muted: #65706d;
  --line: #d8dfdb;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --teal: #157f7a;
  --teal-dark: #0d4f51;
  --coral: #d6604c;
  --yellow: #f1bf55;
  --mint: #dcefe9;
  --shadow: 0 24px 70px rgba(32, 36, 38, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(21, 127, 122, 0.08), transparent 28%),
    linear-gradient(180deg, #f7f1e7 0%, #eef3ef 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

button {
  border: 0;
  color: inherit;
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1440px, calc(100% - 52px));
  margin: 0 auto;
  padding: 26px 0;
}

.workspace {
  min-height: calc(100vh - 52px);
  display: grid;
  gap: 22px;
}

.topbar,
.hero-grid,
.agent-computer {
  width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 4.35rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.65rem, 2.7vw, 2.75rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.status-pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(13, 79, 81, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 0 16px;
  color: var(--teal-dark);
  font-weight: 750;
  white-space: nowrap;
}

.pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 6px rgba(241, 191, 85, 0.18);
}

.status-pill.is-running .pulse {
  background: var(--teal);
  box-shadow: 0 0 0 6px rgba(21, 127, 122, 0.18);
  animation: breathe 1.2s ease-in-out infinite;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(330px, 0.85fr) minmax(420px, 1.15fr);
  gap: 20px;
  align-items: stretch;
}

.task-panel,
.visual-panel,
.machine-column,
.queue-column,
.approval-column {
  min-width: 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(32, 36, 38, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.task-panel {
  padding: 22px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.scenario-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tab {
  min-height: 42px;
  border-radius: 8px;
  background: #edf2ee;
  color: #44504d;
  cursor: pointer;
  font-weight: 750;
}

.tab:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.58;
}

.tab.is-active {
  background: var(--ink);
  color: white;
}

.task-brief p:last-child {
  overflow-wrap: break-word;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.drop-zone {
  min-width: 0;
  min-height: 110px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 1px dashed rgba(13, 79, 81, 0.35);
  border-radius: 8px;
  background: var(--mint);
  padding: 14px;
  cursor: pointer;
}

.drop-zone p {
  overflow-wrap: break-word;
  margin: 4px 0 0;
  color: var(--muted);
}

.paper-stack {
  position: relative;
  width: 54px;
  height: 64px;
}

.paper-stack span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(32, 36, 38, 0.12);
  border-radius: 5px;
  background: var(--surface);
}

.paper-stack span:nth-child(1) {
  transform: rotate(-8deg) translate(-4px, 3px);
}

.paper-stack span:nth-child(2) {
  transform: rotate(5deg) translate(4px, 1px);
}

.paper-stack span:nth-child(3) {
  background: linear-gradient(180deg, #fff 0 26%, #e8f4f1 26% 38%, #fff 38%);
}

.mini-button,
.primary-button,
.secondary-button,
.approve-button,
.quiet-button {
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.mini-button {
  background: white;
  padding: 0 14px;
}

.controls,
.approval-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button {
  flex: 1 1 160px;
  background: var(--teal);
  color: white;
  padding: 0 18px;
}

.secondary-button,
.quiet-button {
  background: #edf2ee;
  color: #38423f;
  padding: 0 18px;
}

.visual-panel {
  position: relative;
  min-height: 350px;
  overflow: hidden;
}

.visual-panel img {
  width: 100%;
  height: 100%;
  min-height: 350px;
  display: block;
  object-fit: cover;
}

.visual-overlay {
  position: absolute;
  left: 18px;
  bottom: 18px;
  min-width: 210px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.7);
  padding: 14px 16px;
}

.visual-overlay p {
  margin: 0 0 4px;
  color: var(--muted);
}

.agent-computer {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(300px, 0.7fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.machine-column,
.queue-column,
.approval-column {
  padding: 18px;
  min-height: 340px;
}

.machine-header,
.queue-header,
.approval-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.screen {
  min-height: 260px;
  border-radius: 8px;
  background: #172123;
  color: #e7f5f0;
  padding: 16px;
  overflow: auto;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  line-height: 1.45;
}

.screen p {
  margin-bottom: 12px;
}

.screen-placeholder {
  color: #99aaa5;
}

.log-line {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(231, 245, 240, 0.12);
}

.log-line span {
  color: #9bd4ce;
}

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.step-list li {
  min-height: 54px;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  background: #f3f5f1;
  padding: 10px;
}

.step-dot {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: #66716e;
  font-weight: 900;
}

.step-list li.is-active {
  background: #dcefe9;
}

.step-list li.is-done .step-dot {
  background: var(--teal);
  color: white;
}

.step-list li.is-approval {
  background: #fff0df;
}

.approval-column {
  background: #fff8ed;
}

.approval-column p {
  color: #695c49;
  line-height: 1.5;
}

.approve-button {
  background: var(--coral);
  color: white;
  padding: 0 18px;
}

.approve-button:disabled,
.quiet-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

@keyframes breathe {
  50% {
    transform: scale(0.82);
  }
}

@media (max-width: 1040px) {
  .hero-grid,
  .agent-computer {
    grid-template-columns: 1fr;
  }

  .visual-panel {
    min-height: 310px;
  }
}

@media (max-width: 660px) {
  .app-shell {
    width: min(362px, calc(100vw - 28px));
    margin: 0 0 0 14px;
    padding: 14px 0;
  }

  .workspace {
    min-height: calc(100vh - 28px);
  }

  .topbar,
  .machine-header,
  .queue-header,
  .approval-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .scenario-tabs {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    grid-template-columns: auto 1fr;
  }

  .mini-button {
    grid-column: 1 / -1;
  }

  .controls,
  .approval-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .visual-panel img {
    min-height: 290px;
  }

  .log-line {
    grid-template-columns: 1fr;
  }
}
