:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #172033;
  --muted: #657087;
  --line: #d9dfeb;
  --accent: #263b6f;
  --accent-2: #1b2a50;
  --success: #176c45;
  --danger: #a33131;
  --radius: 22px;
  --shadow: 0 20px 50px rgba(23, 32, 51, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #edf1f7 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input, select { font: inherit; }

button { cursor: pointer; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 10;
  background: var(--accent);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 999px;
}
.skip-link:focus { top: 1rem; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(320px, 680px);
  gap: 1.25rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand-kicker, .eyebrow, .panel-label {
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
}

h1, h2, p { margin-top: 0; }

h1 { margin-bottom: 0; font-size: clamp(1.05rem, 2vw, 1.35rem); }
h2 { margin-bottom: .8rem; font-size: clamp(1.45rem, 3vw, 2.15rem); line-height: 1.15; }

.config-panel {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1rem;
  align-items: start;
}

.field { display: grid; gap: .4rem; }
label { font-weight: 700; font-size: .9rem; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  padding: .78rem .9rem;
}

input:focus, select:focus, button:focus-visible {
  outline: 3px solid rgba(38, 59, 111, .22);
  outline-offset: 2px;
}

.input-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; }
.input-row button, .primary-action {
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  padding: .78rem 1rem;
}
.input-row button:hover, .primary-action:hover { background: var(--accent-2); }

.help, .status { margin: 0; color: var(--muted); font-size: .82rem; }
.status.ok { color: var(--success); }
.status.error { color: var(--danger); }

.page-shell { width: min(1180px, calc(100% - 2rem)); margin: 2rem auto 4rem; }

.hero-card, .workspace, .event-console {
  background: rgba(255,255,255,.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  grid-template-columns: 1.4fr .9fr;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(1.2rem, 3vw, 2rem);
}

.hero-copy, .panel-copy { color: var(--muted); max-width: 68ch; }

.flow-map {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  justify-content: center;
  align-items: center;
}
.flow-map span {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .7rem .9rem;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  margin-top: 1.25rem;
  overflow: hidden;
}

.stepper { background: #f9fafc; border-right: 1px solid var(--line); padding: 1.25rem; }
.stepper ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.step {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem;
  border-radius: 16px;
  color: var(--muted);
}
.step span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-weight: 900;
}
.step.active { background: #e9edf8; color: var(--text); }
.step.active span { background: var(--accent); color: #fff; }

.panel { padding: clamp(1.25rem, 4vw, 2.4rem); min-height: 420px; }
.hidden { display: none !important; }
.demo-form { display: grid; gap: 1rem; max-width: 520px; }

.plan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.plan-card {
  text-align: left;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 1.2rem;
  display: grid;
  gap: .65rem;
}
.plan-card:hover { border-color: var(--accent); box-shadow: 0 14px 30px rgba(23,32,51,.08); }
.plan-card span { color: var(--muted); font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.plan-card b { font-size: 1.3rem; }
.plan-card small { color: var(--muted); font-size: .95rem; }

.result-box {
  margin-top: 1.25rem;
  padding: 1rem;
  border-radius: 18px;
  background: #f0f4fb;
  border: 1px solid var(--line);
  color: var(--text);
}

.event-console { margin-top: 1.25rem; padding: clamp(1.2rem, 3vw, 1.6rem); }
.event-log { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .55rem; }
.event-log li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: .75rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: .88rem;
}
.event-log time { color: var(--muted); }
.event-log code { overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .topbar, .config-panel, .hero-card, .workspace { grid-template-columns: 1fr; }
  .topbar { position: static; }
  .stepper { border-right: 0; border-bottom: 1px solid var(--line); }
  .stepper ol { grid-template-columns: repeat(4, 1fr); }
  .step { display: grid; justify-items: center; text-align: center; }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .input-row { grid-template-columns: 1fr; }
  .stepper ol { grid-template-columns: 1fr 1fr; }
  .event-log li { grid-template-columns: 1fr; }
}

input::placeholder {
  color: #9aa4b8;
  opacity: 1;
}

.apply-result {
  display: grid;
  gap: .2rem;
  margin-top: .65rem;
  padding: .75rem .85rem;
  border: 1px solid rgba(23, 108, 69, .22);
  border-radius: 14px;
  background: #eef8f3;
  color: var(--success);
  font-size: .84rem;
}
.apply-result strong { font-size: .9rem; }
.apply-result span { color: #285b43; }
