:root {
  --bg: #f4efe6;
  --bg-strong: #efe3d2;
  --panel: rgba(255, 252, 247, 0.86);
  --panel-strong: rgba(255, 249, 240, 0.95);
  --border: rgba(112, 86, 53, 0.15);
  --text: #1d1a16;
  --muted: #6d6256;
  --accent: #b45309;
  --accent-strong: #8f3f06;
  --info: #0f766e;
  --danger: #b42318;
  --success: #166534;
  --shadow: 0 30px 80px rgba(93, 61, 29, 0.12);
  --radius: 28px;
  --font-sans: "IBM Plex Sans", "Noto Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.18), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, #f8f4ed 100%);
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(99, 71, 44, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 71, 44, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 85%);
  pointer-events: none;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1160px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

.workspace {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 24px;
}

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

.hero {
  margin-bottom: 24px;
  padding: 34px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 83, 9, 0.18), transparent 68%);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.hero h1,
.section-head h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.08;
}

.section-head h2 {
  font-size: 1.4rem;
}

.section-head.compact h2 {
  font-size: 1.15rem;
}

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

.progress-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.progress-step {
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(112, 86, 53, 0.12);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.progress-step span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: rgba(109, 98, 86, 0.12);
  font-weight: 700;
}

.progress-step strong {
  display: block;
  font-size: 0.96rem;
}

.progress-step.is-active,
.progress-step.is-complete {
  border-color: rgba(180, 83, 9, 0.22);
  background: linear-gradient(135deg, rgba(255, 244, 225, 0.96), rgba(255, 252, 247, 0.9));
  color: var(--text);
  transform: translateY(-2px);
}

.progress-step.is-active span,
.progress-step.is-complete span {
  background: var(--accent);
  color: #fff;
}

.form-panel,
.state-panel {
  padding: 28px;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack-form label,
.toggle-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.grid-two,
.grid-three {
  display: grid;
  gap: 16px;
}

.grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(112, 86, 53, 0.14);
  background: rgba(255, 255, 255, 0.74);
  font: inherit;
  color: var(--text);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus {
  outline: none;
  border-color: rgba(180, 83, 9, 0.42);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.12);
}

.toggle-list {
  display: grid;
  gap: 12px;
}

.toggle-item {
  flex-direction: row;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(112, 86, 53, 0.12);
  background: rgba(255, 255, 255, 0.54);
}

.toggle-item input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  padding: 15px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #d97706);
}

.ghost-button {
  padding: 15px 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(112, 86, 53, 0.12);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.notice {
  padding: 16px 18px;
  border-radius: 18px;
  margin: 20px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}

.notice-info {
  background: rgba(15, 118, 110, 0.1);
  color: var(--info);
}

.notice-success {
  background: rgba(22, 101, 52, 0.1);
  color: var(--success);
}

.notice-danger {
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
}

.info-card,
.result-card {
  padding: 20px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(112, 86, 53, 0.12);
}

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

.card-label,
.result-grid dt {
  margin: 0 0 8px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.action-row {
  display: flex;
  gap: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 0;
}

.result-grid dd {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  word-break: break-word;
}

#diag-url,
#diag-errors,
#diag-flags,
#diag-history,
#diag-notice {
  white-space: pre-wrap;
}

.full-span {
  grid-column: 1 / -1;
}

.is-hidden {
  display: none;
}

.is-disabled {
  opacity: 0.58;
}

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

  .info-card,
  .grid-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 100%);
    padding: 20px 0 32px;
  }

  .hero,
  .form-panel,
  .state-panel {
    padding: 22px;
  }

  .grid-two,
  .result-grid,
  .progress-rail {
    grid-template-columns: 1fr;
  }

  .action-row {
    flex-direction: column;
  }
}
