* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #0b0c10;
  color: #e8e8ee;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  padding: 2rem 1rem;
}

.wizard {
  max-width: 800px;
  margin: 0 auto;
}

.back {
  display: inline-block;
  color: #48f;
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.back:hover {
  text-decoration: underline;
}

.wizard h1 {
  font-size: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* Search form */
.search-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.search-form input {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: #1a1c21;
  border: 1px solid #2a2c31;
  border-radius: 0.375rem;
  color: #e8e8ee;
  font-size: 1rem;
}

.search-form input::placeholder {
  color: #666;
}

.search-form input:focus {
  outline: none;
  border-color: #48f;
}

.search-form button {
  padding: 0.75rem 2rem;
  background: #48f;
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.search-form button:hover {
  background: #36d;
}

/* Results list */
.results {
  list-style: none;
  margin-bottom: 2rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.result {
  background: #1a1c21;
  border: 1px solid #2a2c31;
  border-radius: 0.375rem;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.result:hover {
  border-color: #48f;
  background: rgba(68, 136, 255, 0.05);
}

.result.picked {
  border-color: #4f8;
  background: rgba(68, 255, 136, 0.1);
}

.result .host {
  font-size: 0.875rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.result .ans {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e8e8ee;
  margin-bottom: 0.5rem;
}

.result .meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: #b8b8be;
}

.badge {
  background: rgba(68, 136, 255, 0.2);
  border: 1px solid #48f;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  color: #48f;
  font-weight: 600;
}

.status, .proto {
  color: #888;
}

/* Selected indicator */
.selected {
  background: rgba(68, 255, 136, 0.1);
  border: 1px solid #4f8;
  border-radius: 0.375rem;
  padding: 0.75rem 1rem;
  color: #4f8;
  margin-bottom: 2rem;
  font-weight: 600;
}

/* Booking form */
.book-form {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.book-form input {
  flex: 1;
  min-width: 150px;
  padding: 0.75rem 1rem;
  background: #1a1c21;
  border: 1px solid #2a2c31;
  border-radius: 0.375rem;
  color: #e8e8ee;
  font-size: 1rem;
}

.book-form input::placeholder {
  color: #666;
}

.book-form input:focus {
  outline: none;
  border-color: #48f;
}

.book-form button {
  padding: 0.75rem 2rem;
  background: #48f;
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.book-form button:hover {
  background: #36d;
}

/* Progress rail */
.rail {
  display: flex;
  list-style: none;
  justify-content: space-between;
  margin: 3rem 0;
  padding: 0;
  gap: 0.5rem;
}

.rail li {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.75rem 0.5rem;
  background: #1a1c21;
  border: 1px solid #2a2c31;
  border-radius: 0.375rem;
  color: #666;
  transition: all 0.2s;
}

.rail li.done {
  background: rgba(68, 255, 136, 0.1);
  border-color: #4f8;
  color: #4f8;
}

.rail li.active {
  background: rgba(68, 136, 255, 0.1);
  border-color: #48f;
  color: #48f;
  box-shadow: 0 0 12px rgba(68, 136, 255, 0.3);
  animation: pulse 2s ease-in-out infinite;
}

.rail li.failed {
  background: rgba(255, 68, 68, 0.1);
  border-color: #f44;
  color: #f44;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(68, 136, 255, 0.2); }
  50% { box-shadow: 0 0 16px rgba(68, 136, 255, 0.4); }
}

/* Step card */
.step-card {
  background: #1a1c21;
  border: 1px solid #2a2c31;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: border-color 0.2s;
}

.step-card.success {
  border-color: #4f8;
  background: rgba(68, 255, 136, 0.05);
}

.step-card .head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.step-card .emoji {
  font-size: 2.5rem;
}

.step-card .agent {
  font-size: 0.875rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.step-card .label {
  font-size: 1.25rem;
  font-weight: 600;
  color: #e8e8ee;
}

.step-card .summary {
  color: #b8b8be;
  margin-bottom: 1rem;
}

.step-card .kv {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #2a2c31;
}

.step-card .kv:last-of-type {
  border-bottom: none;
}

.step-card .kv .k {
  font-weight: 600;
  color: #888;
  min-width: 120px;
}

.step-card .kv .v {
  color: #e8e8ee;
  word-break: break-all;
}

.step-card details {
  margin-top: 1rem;
  background: #0b0c10;
  border: 1px solid #2a2c31;
  border-radius: 0.375rem;
  padding: 1rem;
}

.step-card summary {
  cursor: pointer;
  color: #48f;
  font-size: 0.875rem;
  font-weight: 600;
  user-select: none;
}

.step-card summary:hover {
  color: #36d;
}

.step-card pre {
  margin-top: 0.75rem;
  padding: 1rem;
  background: #000;
  border-radius: 0.25rem;
  overflow-x: auto;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #b8b8be;
}

/* Controls */
.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.status {
  color: #888;
  font-size: 0.875rem;
}

#next {
  padding: 0.625rem 1.5rem;
  background: #48f;
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#next:hover {
  background: #36d;
}

/* Audit card (stage 7) */
.verdict {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.verdict.ok {
  background: rgba(68, 255, 136, 0.15);
  border: 1px solid #4f8;
  color: #4f8;
}

.verdict.bad {
  background: rgba(255, 68, 68, 0.12);
  border: 1px solid #f44;
  color: #f44;
}

.checks {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.checks li {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 12rem) 1fr;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid #2a2c31;
}

.checks li:last-child {
  border-bottom: none;
}

.checks .cname {
  font-weight: 600;
  color: #e8e8ee;
}

.checks .cdetail {
  color: #888;
  font-size: 0.85rem;
  word-break: break-word;
}

.checks li.fail .cname {
  color: #f88;
}

.findings {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: rgba(255, 68, 68, 0.08);
  border: 1px solid #f44;
  border-radius: 0.375rem;
  color: #f88;
}

.findings ul {
  margin: 0.5rem 0 0 1.25rem;
}

.signed {
  color: #888;
  font-size: 0.85rem;
  margin: 0.75rem 0;
  word-break: break-all;
}

.signed code {
  color: #b8b8be;
}

.bundle-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

#copy-bundle {
  padding: 0.5rem 1.25rem;
  background: #48f;
  border: none;
  border-radius: 0.375rem;
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

#copy-bundle:hover {
  background: #36d;
}

.copy-hint {
  color: #888;
  font-size: 0.85rem;
}

.copy-hint code {
  color: #48f;
}

@media (max-width: 640px) {
  .wizard h1 {
    font-size: 1.5rem;
  }

  .book-form {
    flex-direction: column;
  }

  .book-form input, .book-form button {
    width: 100%;
  }

  .rail {
    flex-direction: column;
    gap: 0.5rem;
  }

  .rail li {
    text-align: left;
  }

  .step-card .kv {
    flex-direction: column;
    gap: 0.25rem;
  }

  .step-card .kv .k {
    min-width: 0;
  }
}
