:root {
  color-scheme: light;
  --bg: #d7d9dd;
  --bg-accent: #b9bec6;
  --ink: #1f1d1a;
  --muted: #685f57;
  --panel: rgba(255, 251, 245, 0.88);
  --panel-border: rgba(31, 29, 26, 0.12);
  --primary: #146356;
  --primary-strong: #0c4138;
  --danger: #a6372d;
  --danger-strong: #6f201a;
  --shadow: 0 24px 60px rgba(28, 22, 14, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(20, 99, 86, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(166, 55, 45, 0.1), transparent 24%),
    linear-gradient(180deg, var(--bg), #e6e8ec 55%, var(--bg-accent));
}

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

.shell {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 3rem 0 4rem;
}

.hero {
  margin-bottom: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  color: var(--primary-strong);
}

.hero h1 {
  margin: 0;
  max-width: 12ch;
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.94;
}

.intro {
  max-width: 56rem;
  margin: 1rem 0 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--muted);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.controls-panel {
  padding: 1.2rem;
  margin-bottom: 1.25rem;
}

.controls-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(160px, 220px) minmax(180px, 220px) minmax(180px, 220px) auto;
  gap: 1rem;
  align-items: center;
}

.control-stack {
  display: grid;
  gap: 0.35rem;
}

.caption,
.status-label,
.field span {
  color: var(--muted);
  font-size: 0.86rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 500;
}

.toggle input {
  inline-size: 1.1rem;
  block-size: 1.1rem;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(31, 29, 26, 0.16);
  border-radius: 14px;
  background: #fffdf9;
}

.field select {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(31, 29, 26, 0.16);
  border-radius: 14px;
  background: #fffdf9;
}

.file-field input[type="file"] {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid rgba(31, 29, 26, 0.16);
  border-radius: 14px;
  background: #fffdf9;
}

.import-status {
  margin: 1rem 0 0;
}

.button-row {
  display: inline-flex;
  gap: 0.75rem;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    opacity 140ms ease;
}

button:hover:enabled {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: var(--primary);
  color: #f8faf8;
}

.primary:hover:enabled {
  background: var(--primary-strong);
}

.secondary,
.ghost {
  background: #fffdf9;
  color: var(--ink);
  border: 1px solid rgba(31, 29, 26, 0.14);
}

.danger {
  background: var(--danger);
  color: #fff8f6;
}

.danger:hover:enabled {
  background: var(--danger-strong);
}

.status-strip {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(31, 29, 26, 0.08);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.status-strip strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.02rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.25rem;
}

.editor-grid .panel,
.notes {
  padding: 1.2rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.panel-heading h2,
.notes h2 {
  margin: 0;
  font-size: 1.1rem;
}

textarea,
.log-output {
  width: 100%;
  min-height: 400px;
  border-radius: 20px;
  border: 1px solid rgba(31, 29, 26, 0.12);
  background: #141310;
  color: #f5f2ea;
  padding: 1rem;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
}

textarea {
  resize: vertical;
}

.log-output {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

.notes {
  margin-top: 1.25rem;
}

.notes ul {
  margin: 0.8rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.6;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  background: rgba(20, 19, 16, 0.08);
  border-radius: 0.4rem;
  padding: 0.1rem 0.35rem;
}

@media (max-width: 900px) {
  .controls-grid,
  .editor-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .button-row {
    width: 100%;
  }

  .button-row button {
    flex: 1;
  }

  .hero h1 {
    max-width: 100%;
  }
}
