:root {
  --bg: #f6f0e6;
  --bg-accent: #e2eef3;
  --panel: #ffffff;
  --ink: #1b1f2a;
  --muted: #5f6674;
  --accent: #ff6b4a;
  --accent-strong: #e65536;
  --accent-2: #1d8a7a;
  --border: #e6d9c8;
  --shadow: 0 24px 60px rgba(20, 27, 44, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 20% 20%, #f9f6f1, var(--bg)) fixed;
  min-height: 100vh;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  filter: blur(0px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background: radial-gradient(circle, var(--bg-accent), transparent 70%);
  top: -120px;
  right: -140px;
}

body::after {
  background: radial-gradient(circle, #ffd6c4, transparent 70%);
  bottom: -160px;
  left: -120px;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.hero {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 36px;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  animation: rise 0.7s ease-out;
}

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

.hero h1 {
  font-size: clamp(28px, 3vw, 40px);
  margin: 0 0 12px;
  line-height: 1.1;
}

.hero p {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px;
  color: var(--muted);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.pill {
  background: #f4eee5;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

button {
  font-family: inherit;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 24px rgba(255, 107, 74, 0.35);
}

button.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}

button.ghost:hover {
  border-color: var(--accent-2);
  color: var(--accent-2);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

.layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
}

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

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ddd2c1;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toggle-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #eadfce;
  background: #fbf7f1;
  font-size: 13px;
}

.toggle input {
  width: 16px;
  height: 16px;
}

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

.status-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.status-label {
  font-weight: 600;
  color: var(--muted);
}

.status-value {
  font-weight: 600;
}

.event-log {
  border: 1px solid #eadfce;
  border-radius: 12px;
  background: #fbf7f1;
  padding: 12px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 12px;
}

.log-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #eadfce;
}

.log-row:last-child {
  border-bottom: none;
}

.log-time {
  color: var(--muted);
  min-width: 64px;
}

.notice {
  background: #fff4e8;
  border: 1px solid #ffd1b8;
  color: #8b3d23;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
}

.error {
  background: #ffe8e8;
  border: 1px solid #ffc3c3;
  color: #8d1f1f;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
}

.hidden {
  display: none;
}

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

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .actions {
    align-items: stretch;
  }
  .layout {
    grid-template-columns: 1fr;
  }
}
