:root {
  color-scheme: light;
  --bg: #f6f2ee;
  --bg-deep: #efe8df;
  --card: #ffffff;
  --text: #1f1c18;
  --muted: #5d5650;
  --accent: #e05a3d;
  --accent-2: #1b4d66;
  --border: rgba(31, 28, 24, 0.12);
  --shadow: 0 18px 40px rgba(31, 28, 24, 0.12);
  --radius: 18px;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: "Space Grotesk", "Manrope", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--sans);
  background: radial-gradient(circle at top left, #fff4e3 0%, var(--bg) 45%, #f2efe9 100%);
  color: var(--text);
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  gap: 32px;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px;
  background: linear-gradient(120deg, #ffffff 0%, #fdf6ef 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

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

h1 {
  margin: 0 0 12px 0;
  font-size: clamp(26px, 3vw, 38px);
}

.lead {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.status {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 16px;
  background: #fff;
  min-width: 220px;
  border: 1px solid var(--border);
}

.status-line {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted);
}

.status-line strong {
  color: var(--text);
  font-weight: 700;
}

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

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(31, 28, 24, 0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

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

.btn {
  appearance: none;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(224, 90, 61, 0.25);
}

.btn.ghost {
  background: transparent;
  color: var(--accent-2);
  border: 1px solid rgba(27, 77, 102, 0.3);
}

.field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.field input,
.field select {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
}

.field.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field.checkbox input {
  width: 16px;
  height: 16px;
}

.kv {
  display: grid;
  gap: 10px;
}

.kv div {
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.kv code {
  font-family: var(--mono);
  background: #f7f2ec;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.events {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px dashed rgba(31, 28, 24, 0.15);
  border-radius: 12px;
  padding: 10px;
  background: #faf6f1;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.log {
  background: #0f1113;
  color: #e9e6e1;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.log-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.log-head h2 {
  margin: 0;
  font-size: 18px;
}

#logOutput {
  margin: 16px 0 0;
  background: #15181a;
  border-radius: 14px;
  padding: 16px;
  max-height: 360px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

@media (max-width: 820px) {
  .hero {
    padding: 24px;
  }

  .status {
    width: 100%;
  }
}
