:root {
  --bg: #07111e;
  --bg-soft: #0d1d2c;
  --panel: rgba(10, 22, 36, 0.72);
  --panel-strong: rgba(10, 22, 36, 0.9);
  --line: rgba(173, 224, 255, 0.16);
  --text: #eef7ff;
  --muted: #98adc0;
  --accent: #8cf0c7;
  --accent-strong: #39d39d;
  --danger: #ff8c8c;
  --warning: #ffd37a;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 15%, rgba(90, 184, 255, 0.2), transparent 35%),
    radial-gradient(circle at 82% 18%, rgba(57, 211, 157, 0.16), transparent 28%),
    linear-gradient(180deg, #09121c 0%, #07111e 38%, #06101a 100%);
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
}

body {
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(24px);
  pointer-events: none;
}

.ambient-a {
  top: 9vh;
  left: -6vw;
  width: 32vw;
  height: 32vw;
  background: rgba(88, 163, 255, 0.13);
}

.ambient-b {
  right: -8vw;
  bottom: 10vh;
  width: 38vw;
  height: 38vw;
  background: rgba(57, 211, 157, 0.1);
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.hero {
  padding: 22px 2px 24px;
  animation: rise 520ms ease-out both;
}

.eyebrow,
.hero h1 {
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 13em;
  font-size: clamp(1.55rem, 3.8vw, 2.9rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 0.98rem;
}

.hero-meta,
.action-row,
.log-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-meta {
  margin-top: 18px;
}

.workspace {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.control-stack,
.monitor {
  backdrop-filter: blur(18px);
  background: linear-gradient(180deg, var(--panel-strong), var(--panel));
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.control-stack {
  padding: 22px;
  animation: rise 640ms ease-out both;
}

.monitor {
  padding: 20px;
  animation: rise 760ms ease-out both;
}

.monitor-stack {
  display: grid;
  gap: 18px;
}

.panel-divider {
  height: 1px;
  margin: 20px 0;
  background: linear-gradient(90deg, transparent, rgba(173, 224, 255, 0.22), transparent);
}

.batch-panel {
  display: grid;
  gap: 10px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.section-head h3,
.log-head h3 {
  margin: 0;
  font-size: 1rem;
}

.compact-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.section-head p,
.log-head span,
.result-line span,
#summary-text {
  color: var(--muted);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.9rem;
  color: #dce8f4;
}

.field-help,
.helper-text {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(173, 224, 255, 0.18);
  border-radius: 18px;
  background: rgba(3, 11, 20, 0.45);
  color: var(--text);
  padding: 14px 14px;
  outline: none;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(140, 240, 199, 0.8);
  background: rgba(3, 11, 20, 0.68);
  transform: translateY(-1px);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.toggle-field {
  align-content: end;
}

.toggle-field input {
  width: 58px;
  height: 34px;
  padding: 0;
  accent-color: var(--accent-strong);
}

.primary-action,
.secondary-action {
  min-height: 52px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0 20px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.primary-action {
  background: linear-gradient(120deg, var(--accent-strong), var(--accent));
  color: #082115;
  font-weight: 800;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.1);
}

.primary-action:hover,
.secondary-action:hover {
  transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.status-pill,
.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(173, 224, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.9rem;
}

.status-pill.running {
  color: var(--warning);
  border-color: rgba(255, 211, 122, 0.34);
  box-shadow: 0 0 0 1px rgba(255, 211, 122, 0.14), 0 0 24px rgba(255, 211, 122, 0.14);
}

.status-pill.success {
  color: var(--accent);
  border-color: rgba(140, 240, 199, 0.35);
}

.status-pill.error,
.status-pill.stopped {
  color: var(--danger);
  border-color: rgba(255, 140, 140, 0.36);
}

.result-panel {
  display: grid;
  gap: 10px;
  margin: 10px 0 18px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

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

.result-line strong {
  text-align: right;
  font-weight: 700;
}

.log-head {
  justify-content: space-between;
  margin: 18px 0 10px;
}

.log-output {
  min-height: 280px;
  max-height: 460px;
  overflow: auto;
  padding: 14px;
  border-radius: 20px;
  background: rgba(2, 7, 13, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
}

.log-line {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.log-line:last-child {
  border-bottom: 0;
}

.log-line time {
  color: var(--muted);
  white-space: nowrap;
}

.screenshots {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.screenshots a {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.screenshots img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.batch-preview,
.history-list {
  border-radius: 20px;
  background: rgba(2, 7, 13, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.batch-preview {
  overflow: auto;
  min-height: 120px;
}

.batch-preview.empty,
.history-list.empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  padding: 18px;
}

.batch-preview-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

.batch-preview-table th,
.batch-preview-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.92rem;
}

.batch-preview-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
}

.batch-preview-table tbody tr:last-child td {
  border-bottom: 0;
}

.batch-preview-errors {
  margin: 0;
  padding: 14px 18px 18px;
  color: var(--danger);
  line-height: 1.65;
}

.history-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.history-card {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.history-top,
.history-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.history-card strong {
  font-size: 0.95rem;
}

.history-card span,
.history-card time {
  color: var(--muted);
  font-size: 0.84rem;
}

.history-card .ok {
  color: var(--accent);
}

.history-card .bad {
  color: var(--danger);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: 14em;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 16px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .control-stack,
  .monitor {
    padding: 16px;
    border-radius: 22px;
  }

  .hero {
    padding: 12px 2px 18px;
  }

  .hero h1 {
    font-size: clamp(1.4rem, 7vw, 2.05rem);
  }

  .log-output {
    min-height: 240px;
  }

  .batch-preview-table {
    min-width: 460px;
  }
}
