:root {
  color-scheme: light;
  --ink: #16211f;
  --muted: #5d6864;
  --line: #d9e2de;
  --panel: #ffffff;
  --soft: #eef5f2;
  --blue: #255f85;
  --green: #246b55;
  --red: #9a352e;
  --yellow: #8a641e;
  --shadow: 0 16px 45px rgba(31, 45, 41, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #f7faf8 0%, #edf4f1 100%);
}

button, input {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: 0;
}

p {
  line-height: 1.55;
}

.build-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.surface {
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 28px;
  padding: 30px;
}

.main-column {
  min-width: 0;
}

.side-column {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}

.subtle {
  color: var(--muted);
  margin: 0 0 18px;
}

.choice-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.choice-card,
.action-button,
.ghost-button,
.danger-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  padding: 13px 14px;
}

.choice-card:hover,
.ghost-button:hover {
  border-color: var(--blue);
  background: #f8fbfd;
}

.choice-card:active,
.ghost-button:active {
  border-color: var(--blue);
  background: #eaf2f8;
}

.action-button:hover {
  background: #1d4d6d;
  border-color: #1d4d6d;
  color: #fff;
}

.action-button:active {
  background: #163c56;
  border-color: #163c56;
  color: #fff;
}

.danger-button:hover {
  border-color: var(--red);
  background: #fdeceb;
  color: var(--red);
}

.danger-button:active {
  border-color: var(--red);
  background: #f8d9d6;
  color: var(--red);
}

.choice-card:focus-visible,
.action-button:focus-visible,
.ghost-button:focus-visible,
.danger-button:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

.choice-card:disabled,
.action-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.choice-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.choice-card span {
  color: var(--muted);
  font-size: 14px;
}

.action-button {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  text-align: center;
  font-weight: 800;
}

.ghost-button {
  background: var(--soft);
  text-align: center;
  font-weight: 700;
}

.danger-button {
  border-color: #e8c2bc;
  background: #fff8f7;
  color: var(--red);
  font-weight: 700;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button-row button {
  width: auto;
}

.hazard-box {
  border: 1px solid #ead3b0;
  background: #fffaf0;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 18px;
}

.hazard-grid {
  display: grid;
  gap: 8px;
}

.hazard-grid button {
  font-size: 13px;
}

.hazard-row {
  margin-bottom: 10px;
}

.hazard-row:last-child {
  margin-bottom: 0;
}

.hazard-row-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.hazard-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hazard-chip-group button {
  width: auto;
  flex: 1 1 auto;
}

.hazard-reentry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 4px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  width: auto;
  min-height: 0;
}

.hazard-reentry:hover,
.hazard-reentry:focus-visible {
  color: var(--red);
}

.hazard-reentry:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.primary-result {
  border: 1px solid var(--blue);
  background: #f3f8fb;
}

.primary-result h3 {
  color: var(--blue);
}

.disclaimer-note {
  color: var(--muted);
  font-size: 13px;
  margin: 10px 0 0;
}

.equipment-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 18px;
}

.equipment-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 0 4px;
}

.equipment-fieldset .input-row {
  margin-top: 8px;
}

.gap-note {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 0;
}

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

.block {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.block.wide {
  grid-column: 1 / -1;
}

ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

li {
  margin: 6px 0;
  line-height: 1.45;
}

.status-line {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.input-row input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.stop {
  border-color: #e3b8b2;
  background: #fff7f6;
}

.stop h2 {
  color: var(--red);
}

.notice {
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef6ff;
  border: 1px solid #c7dff2;
  color: #1f4f72;
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 14px;
  }

  .topbar {
    display: block;
  }

  .build-pill {
    display: inline-block;
    margin-top: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .screen {
    display: block;
    padding: 20px;
  }

  .side-column {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 18px;
    margin-top: 22px;
  }

  .result-grid,
  .input-row {
    grid-template-columns: 1fr;
  }
}

/* VNX-2 equipment autocomplete */
.autocomplete-field {
  position: relative;
  min-width: 0;
}

.autocomplete-field > input {
  width: 100%;
}

.autocomplete-list {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 4px;
}

.autocomplete-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.autocomplete-option:hover,
.autocomplete-option.is-active,
.autocomplete-option:focus-visible {
  background: #eef6ff;
  color: #173f62;
  outline: 2px solid #2e6bd6;
  outline-offset: -2px;
}

.autocomplete-option.is-special {
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.code-entry-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
}

@media (max-width: 760px) {
  .code-entry-row { grid-template-columns: 1fr; }
}

/* VNX-3 integrated intake */
.intake-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  font-size: 13px;
  color: var(--muted);
}

.intake-progress span,
.intake-progress strong {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.intake-progress strong {
  color: var(--ink);
  border-color: #9ebfdc;
  background: #eef6ff;
}

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

.choice-card.is-selected {
  border-color: #2e6bd6;
  background: #eef6ff;
  box-shadow: inset 0 0 0 1px #2e6bd6;
}

.context-summary {
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfe;
}

.context-summary h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.context-summary ul {
  margin: 0;
}

@media (max-width: 760px) {
  .compact-grid { grid-template-columns: 1fr; }
  .intake-progress { gap: 6px; }
  .intake-progress span,
  .intake-progress strong { font-size: 12px; }
}

