@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600&display=swap');

:root {
  color-scheme: light;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top left, #eef6ff, #f8f1e4 55%, #f5f5f7 100%);
  color: #1d1d1f;
  --ink: #1d1d1f;
  --muted: #60606b;
  --accent: #1f4ed8;
  --accent-strong: #1237a5;
  --panel: rgba(255, 255, 255, 0.92);
  --stroke: #d7d7dd;
  --card: #f6f7fb;
  --ok: #16a34a;
  --warn: #d97706;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  overflow-x: hidden;
}

.body-glow {
  position: fixed;
  inset: -20% 10% auto auto;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}

.panel {
  width: min(720px, 100%);
  background: var(--panel);
  border-radius: 20px;
  padding: 28px 32px;
  box-shadow: 0 20px 50px rgba(40, 40, 60, 0.12);
  backdrop-filter: blur(6px);
  animation: panelFade 0.5s ease-out;
}

header h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 0 0 8px;
  color: var(--muted);
}

.lead {
  margin: 0 0 8px;
  color: #2f2f37;
  font-weight: 600;
}

.section {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

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

label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a6a74;
}

input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  font-size: 14px;
}

button {
  padding: 10px 16px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

button.secondary {
  background: #eef0f6;
  color: var(--ink);
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.status {
  padding: 8px 12px;
  border-radius: 10px;
  background: #f0f3ff;
  font-size: 14px;
}

.muted {
  color: #7d7d86;
  font-size: 14px;
}

.code {
  display: flex;
  gap: 12px;
  align-items: center;
}

.code strong {
  font-size: 18px;
}

.toggle {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
}

.toggle span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.toggle span::after {
  content: attr(data-state);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef0f6;
  color: #5a5a66;
}

.toggle.is-active span::after {
  background: #dcfce7;
  color: #166534;
}

.toggle.is-muted span::after {
  background: #fee2e2;
  color: #991b1b;
}

input[type="range"] {
  appearance: none;
  height: 6px;
  border-radius: 999px;
  background: #e2e6f0;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 78, 216, 0.15);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(31, 78, 216, 0.15);
  cursor: pointer;
}

.ptt-button {
  min-height: 44px;
}

.meter {
  height: 8px;
  border-radius: 6px;
  background: #e1e4ee;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #22c55e, #16a34a);
  transition: width 0.08s linear;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: #4a4a55;
}

.help-link {
  font-size: 13px;
  color: var(--accent-strong);
  text-decoration: none;
}

.help-link:hover {
  text-decoration: underline;
}

.stepper {
  margin-top: 16px;
}

.stepper ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stepper li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f2f3f7;
  color: #62626c;
  font-weight: 600;
  text-align: center;
  position: relative;
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.stepper li.active {
  background: #e8efff;
  border-color: rgba(31, 78, 216, 0.35);
  color: var(--accent-strong);
  transform: translateY(-2px);
}

.stepper li.complete {
  background: #eaf7ef;
  color: var(--ok);
}

.step-card {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid #e4e6ee;
  background: #fcfcfe;
  display: grid;
  gap: 12px;
  animation: cardFade 0.4s ease-out;
}

.step-card:nth-of-type(1) {
  animation-delay: 0.05s;
}

.step-card:nth-of-type(2) {
  animation-delay: 0.12s;
}

.step-card:nth-of-type(3) {
  animation-delay: 0.18s;
}

.step-card.is-active {
  border-color: rgba(31, 78, 216, 0.35);
  box-shadow: 0 12px 24px rgba(31, 78, 216, 0.08);
}

.hint {
  margin: 0;
  color: #60606b;
  font-size: 14px;
}

.summary {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #3c3c46;
}

.summary-row strong {
  font-weight: 600;
}

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

.health-item {
  border: 1px solid #e1e4ee;
  background: #fbfbfd;
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.health-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #2e2e35;
}

.health-state {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef0f6;
  color: #5a5a66;
}

.health-hint {
  margin: 0;
  font-size: 13px;
  color: #6a6a74;
}

.health-item.ok .health-state {
  background: #dcfce7;
  color: #166534;
}

.health-item.warn .health-state {
  background: #fef3c7;
  color: #92400e;
}

.health-item.error .health-state {
  background: #fee2e2;
  color: #991b1b;
}

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

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

@media (max-width: 600px) {
  .panel {
    padding: 22px;
  }

  .stepper ol {
    grid-template-columns: 1fr;
  }

  .ptt-button {
    position: sticky;
    bottom: 16px;
    width: 100%;
    font-size: 16px;
    padding: 14px 18px;
    box-shadow: 0 12px 24px rgba(31, 78, 216, 0.2);
  }
}
