/* New environment drawer (environment-create.js): the stepper, the content of each step, the choice cards and
   the short review. The drawer frame comes from ui/ui.css; colours, radii and control sizes from style.css. */

/* ── Stepper: a finished step shows the choice under its label and goes back when pressed ── */
.env-steps-nav { min-width: 0; }
.env-steps { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0; list-style: none; }
.env-step { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 0; min-width: 0; }
.env-step:last-child { flex: 0 1 auto; }
.env-step::after { content: ""; flex: 1 1 16px; min-width: 12px; height: 1px; margin-top: 24px; background: var(--border-strong); }
.env-step:last-child::after { content: none; }
.env-step-button { display: inline-flex; align-items: flex-start; gap: 12px; flex: 0 1 auto; min-width: 0; min-height: 40px; height: auto; padding: 8px 8px 8px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--secondary); font-size: 13px; font-weight: 500; text-align: left; }
.env-step.done .env-step-button:hover { background: var(--subtle); color: var(--text); }
.env-step-button:disabled, .env-step.later .env-step-button { background: transparent; color: var(--muted); cursor: default; }
span.env-step-button { font-size: 14px; font-weight: 500; }
.env-step-number { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 1px solid var(--border-strong); border-radius: 50%; background: var(--card); color: var(--secondary); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.env-step-words { display: flex; flex-direction: column; min-width: 0; min-height: 36px; padding-top: 4px; }
.env-step-label { line-height: 20px; white-space: nowrap; }
.env-step-value { max-width: 160px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.env-step.current .env-step-button { color: var(--text); font-weight: 600; }
.env-step.current .env-step-number { border-color: var(--action); background: var(--action); color: #fff; }
.env-step.done .env-step-button { color: var(--text); }
.env-step.done .env-step-number { border-color: #ABEFC6; background: #ECFDF3; color: #067647; }
.env-create .env-steps-compact { display: none; margin: 0; font-size: 14px; line-height: 20px; color: var(--text); }
.env-steps-count { margin-right: 8px; color: var(--muted); }

/* ── Step content ── */
.env-create-form { min-width: 0; }
dialog.env-create .env-create-form > .env-create-step { min-width: 0; margin: 0; padding: 0; border: 0; }
.env-create-step[hidden] { display: none; }
.env-create-heading { margin: 0; padding: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--text); outline: none; }
.env-create .env-create-lede { margin: 8px 0 0; font-size: 14px; line-height: 20px; color: var(--secondary); }
.env-field { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.env-field[hidden] { display: none; }
.env-field-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); }
.env-field-hint { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.env-field-hint-row { display: flex; flex-direction: column; gap: 4px; }
.env-field-hint-row .env-field-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.env-field-hint-row .text-button { min-height: 32px; padding: 0; font-size: 13px; font-weight: 500; color: var(--active-text); }
.env-field-error { margin: 0; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--danger-hover); }
.env-create-note-detail { display: block; margin-top: 2px; font-size: 12px; }
.env-create .nx-select { display: flex; width: 100%; }
.env-field textarea { width: 100%; }

/* ── Choice cards: one radio each ── */
.env-choice-list { display: grid; gap: 12px; margin-top: 16px; }
.env-choice { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 16px; border: 1px solid var(--field-border); border-radius: var(--radius-card); background: var(--card); cursor: pointer; font-weight: 400; }
.env-choice:hover { border-color: #DD8A4E; background: #FFF8F2; }
.env-choice.selected { border-color: var(--selected-border); background: var(--selected-bg); }
.env-choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.env-choice input, .env-choice input:disabled { position: absolute; width: 1px; height: 1px; margin: 0; border: 0; opacity: 0; clip-path: inset(50%); pointer-events: none; }
.env-choice-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--subtle); color: var(--secondary); }
.env-choice.selected .env-choice-icon { border-color: #F5C9A8; background: var(--active); color: var(--action); }
.env-choice-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.env-choice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; }
.env-choice-title { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text); }
.env-choice-badge { padding: 1px 8px; border-radius: 999px; background: #DCFCE7; color: #166534; font-size: 12px; line-height: 16px; font-weight: 600; }
.env-choice-desc { font-size: 14px; line-height: 20px; color: var(--secondary); }
.env-choice-check { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--field-border); border-radius: 50%; background: var(--card); color: transparent; }
.env-choice.selected .env-choice-check { border-color: var(--action); background: var(--action); color: #fff; }
.env-choice:not(.selected) .env-choice-check svg { display: none; }
.env-create-note { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; margin-top: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); color: var(--secondary); font-size: 13px; line-height: 20px; }
.env-create-note:empty { display: none; }
.env-create-note > svg { flex: none; margin-top: 2px; color: var(--muted); }
.env-create-note > span { flex: 1 1 240px; min-width: 0; }
.env-create-note.bad { border-color: #FECACA; background: #FEF2F2; color: #7F1D1D; }
.env-create-note.bad > svg { color: #B91C1C; }
.env-create-note.bad strong { color: #991B1B; }
.env-create-note button { min-height: var(--control-h-compact); height: var(--control-h-compact); padding: 0 12px; font-size: 13px; }

/* ── Options ── */
.env-create-portal { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.env-create-portal[hidden] { display: none; }
.env-create-portal > label { gap: 8px; }
.env-create-portal > label + label { margin-top: 12px; }
.env-create-portal > label[hidden] { display: none; }
.env-create-portal > p, .env-create-portal .small { margin: 0; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--muted); }
.env-create-option { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-card); }
.env-toggle { flex-direction: row; align-items: center; gap: 12px; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.env-create-every { display: flex; align-items: center; gap: 12px; }
.env-create-every[hidden] { display: none; }
.env-create-every input { width: 96px; }
.env-create-advanced { margin-top: 24px; border-top: 1px solid var(--border); }
.env-create-advanced > summary, .env-create-access > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-height: 44px; padding: 12px 0; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; list-style-position: inside; }
.env-create-advanced > summary, .env-create-access > summary { list-style: none; cursor: pointer; }
.env-create-advanced > summary::-webkit-details-marker, .env-create-access > summary::-webkit-details-marker { display: none; }
.env-create-advanced > .env-field:first-of-type { margin-top: 4px; }
.env-create-access { margin-top: 16px; padding: 0 16px; border: 1px solid var(--border); border-radius: var(--radius-card); }
.env-create-access[hidden] { display: none; }
.env-create-access[open] { padding-bottom: 16px; }
.env-create-access .provisioning-access { margin: 0; }
.env-create-access .provisioning-access > h3 { margin: 4px 0 8px; font-size: 16px; font-weight: 600; }
.env-create-access .provisioning-access p { margin: 8px 0; font-size: 13px; line-height: 20px; }
/* A note inside the access editor is part of the page, not a message strip. */
.provisioning-access .notice { position: static; transform: none; display: block; width: auto; max-width: none; margin: 8px 0; padding: 12px 12px; }

/* ── Review: a few plain lines ── */
.env-review { display: flex; flex-direction: column; margin: 16px 0 0; border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
.env-review-row { display: grid; grid-template-columns: 28px 88px minmax(0, 1fr); align-items: center; gap: 4px 12px; min-height: 52px; padding: 12px 16px; }
.env-review-row + .env-review-row { border-top: 1px solid var(--border); }
.env-review-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--subtle); color: var(--secondary); }
.env-review-row dt { font-size: 13px; line-height: 20px; color: var(--muted); }
.env-review-row dd { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.env-review-row.warn { background: var(--warn-bg, #FFFBEB); }
.env-review-row.warn .env-review-icon { background: #FEF3C7; color: var(--warn-text, #7A5900); }
.env-review-row.warn dd { color: var(--warn-text, #7A5900); }

@media (max-width: 600px) {
  .env-steps { display: none; }
  .env-create .env-steps-compact { display: block; }
  .env-review-row { grid-template-columns: 28px minmax(0, 1fr); }
  .env-review-row dd { grid-column: 2; }
}
.env-create-option-head { display: flex; align-items: center; gap: 12px; }
.env-create-option-head .env-choice-icon { width: 40px; height: 40px; }
.env-create-option > .env-create-every, .env-create-option > .env-field-hint { margin-left: 52px; }
@media (max-width: 600px) { .env-create-option > .env-create-every, .env-create-option > .env-field-hint { margin-left: 0; } }
