/* Only layout and interaction inside the wizard. */
.mesh-wizard {
  --wizard-green: #1f7a3d;
  --wizard-border: var(--md-default-fg-color--lightest);
  margin: 0.5rem 0 2rem;
  scroll-margin-top: 3.5rem;
}

.mesh-wizard * { box-sizing: border-box; }
.mesh-wizard [hidden] { display: none !important; }
.mesh-wizard__page-title {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.mesh-wizard__preset-heading {
  align-items: center;
  display: flex;
}

.mesh-wizard__steps {
  margin: 0;
  max-width: 34.4rem;
  overflow-x: clip;
  padding: 0.65rem 0 0.5rem;
}

.mesh-wizard__steps > ol#mesh-wizard-step-list {
  display: grid !important;
  grid-template-columns: repeat(var(--wizard-step-count, 8), minmax(3.5rem, 1fr)) !important;
  list-style: none !important;
  margin: 0 !important;
  min-width: 28rem;
  padding: 0 !important;
}

.mesh-wizard__steps li { margin: 0 !important; position: relative; }
.mesh-wizard__steps li:not(:last-child)::after {
  background: var(--wizard-border);
  content: "";
  height: 1px;
  left: calc(50% + 0.9rem);
  position: absolute;
  right: calc(-50% + 0.9rem);
  top: 0.85rem;
}
.mesh-wizard__steps li:has(.is-complete)::after { background: var(--wizard-green); }

.mesh-wizard__steps button {
  align-items: center;
  background: none;
  border: 0;
  color: var(--md-default-fg-color--light);
  display: flex;
  flex-direction: column;
  font: inherit;
  gap: 0.25rem;
  padding: 0;
  position: relative;
  width: 100%;
  z-index: 1;
}

.mesh-wizard__steps button > span {
  align-items: center;
  background: var(--md-default-bg-color);
  border: 1px solid var(--wizard-border);
  border-radius: 50%;
  display: flex;
  font-size: 0.6rem;
  height: 1.4rem;
  justify-content: center;
  width: 1.4rem;
}

.mesh-wizard__steps button small { font-size: 0.6rem; line-height: 1.25; overflow-wrap: anywhere; text-align: center; }
.mesh-wizard__steps .is-complete > span { background: var(--wizard-green); border-color: var(--wizard-green); color: #fff; }
.mesh-wizard__steps .is-active > span { background: var(--md-default-bg-color); border: 0.15rem solid var(--wizard-green); color: var(--wizard-green); font-weight: 800; }
.mesh-wizard__steps .is-active small { color: var(--wizard-green); font-weight: 700; }
.mesh-wizard__progress { background: var(--wizard-border); height: 0.1rem; margin: 0; max-width: 34.4rem; }
.mesh-wizard__progress span { background: var(--wizard-green); display: block; height: 100%; transition: width 180ms; }

.mesh-wizard__notice {
  background: color-mix(in srgb, #c62828 9%, var(--md-default-bg-color));
  border-left: 0.15rem solid #c62828;
  color: #a22121;
  font-size: 0.7rem;
  margin: 0.75rem 0 0;
  max-width: 34.4rem;
  padding: 0.65rem 0.8rem;
}
.mesh-wizard__notice[data-type="success"] { background: color-mix(in srgb, var(--wizard-green) 9%, var(--md-default-bg-color)); color: var(--wizard-green); }

.mesh-wizard__panel { margin: 0; max-width: 34.4rem; min-height: 19rem; padding: 1.4rem 0; }
.mesh-wizard__panel h2 { font-size: 1.1rem; margin: 0.2rem 0 0.6rem; scroll-margin-top: 4rem; }
.mesh-wizard__step-kicker { color: var(--wizard-green); font-size: 0.68rem; font-weight: 700; margin: 0; }
.mesh-wizard__lead { color: var(--md-default-fg-color--light); font-size: 0.75rem; line-height: 1.8; max-width: 34.4rem; }

.mesh-wizard__welcome { max-width: 34.4rem; }
.mesh-wizard__welcome h2 { font-size: 1.1rem; max-width: 34.4rem; }
.mesh-wizard__prerequisites { border-top: 1px solid var(--wizard-border); font-size: 0.7rem; margin-top: 1rem; max-width: 34.4rem; padding-top: 0.8rem; }
.mesh-wizard__prerequisites summary { cursor: pointer; font-weight: 700; }
.mesh-wizard__prerequisites ul { margin: 0.4rem 0; }
.mesh-wizard__prerequisites p { color: var(--md-default-fg-color--light); margin: 0.4rem 0 0; }

.mesh-wizard__field { display: grid; gap: 0.35rem; max-width: 34.4rem; }
.mesh-wizard :is(.mesh-wizard__field, .mesh-wizard__location-panel) label { font-size: 0.72rem; font-weight: 700; }
.mesh-wizard :is(input[type="text"], input[type="number"], input[type="password"], select) {
  background: var(--md-default-bg-color);
  border: 1px solid var(--wizard-border);
  border-radius: 0.2rem;
  color: var(--md-default-fg-color);
  font: inherit;
  padding: 0.5rem 0.6rem;
  width: 100%;
}
.mesh-wizard :is(input[type="text"], input[type="number"], input[type="password"], select) { font-size: 0.8rem; }
.mesh-wizard :is(input, select, button, summary):focus-visible { outline: 0.12rem solid var(--wizard-green); outline-offset: 0.1rem; }
.mesh-wizard__field-meta { color: var(--md-default-fg-color--light); display: flex; font-size: 0.68rem; justify-content: space-between; }
.mesh-wizard__field-meta strong[data-state="ok"] { color: var(--wizard-green); }
.mesh-wizard__field-meta strong:is([data-state="warning"], [data-state="error"]) { color: #c62828; }
.mesh-wizard__field-feedback { color: var(--md-default-fg-color--light); font-size: 0.7rem; margin: 0; }
.mesh-wizard__examples { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0; }
.mesh-wizard__examples > span { color: var(--md-default-fg-color--light); font-size: 0.68rem; padding: 0.3rem 0; }
.mesh-wizard__examples button { background: none; border: 1px solid var(--wizard-border); border-radius: 1rem; color: inherit; font: inherit; font-size: 0.68rem; padding: 0.3rem 0.55rem; }

.mesh-wizard__callout {
  background: color-mix(in srgb, var(--wizard-green) 6%, var(--md-default-bg-color));
  border-left: 0.15rem solid var(--wizard-green);
  display: grid;
  font-size: 0.72rem;
  gap: 0.15rem;
  margin-top: 1rem;
  max-width: 34.4rem;
  padding: 0.75rem 0.9rem;
}
.mesh-wizard__callout span { color: var(--md-default-fg-color--light); }
.mesh-wizard__callout--legal { border-color: #d99a00; }
.mesh-wizard__callout--danger { background: color-mix(in srgb, #c62828 8%, var(--md-default-bg-color)); border-color: #c62828; }
.mesh-wizard__confirmation { align-items: start; display: flex; font-size: 0.72rem; font-weight: 600; gap: 0.45rem; margin: 0.8rem 0; max-width: 34.4rem; }
.mesh-wizard__confirmation input { flex: 0 0 auto; margin-top: 0.18rem; }
.mesh-wizard__radio-choices { max-width: 34.4rem; }
.mesh-wizard__technical-details { border-top: 1px solid var(--wizard-border); font-size: 0.7rem; margin-top: 1rem; padding-top: 0.7rem; }
.mesh-wizard__technical-details summary { cursor: pointer; font-weight: 700; }

.mesh-wizard__preset { border-left: 0.15rem solid var(--wizard-green); max-width: 34.4rem; }
.mesh-wizard__preset-heading { border-bottom: 1px solid var(--wizard-border); gap: 0.7rem; padding: 0.65rem 0.75rem; }
.mesh-wizard__preset-heading > div { display: grid; }
.mesh-wizard__preset-heading small { color: var(--md-default-fg-color--light); font-size: 0.62rem; }
.mesh-wizard__preset-badge { background: var(--wizard-green); border-radius: 1rem; color: #fff; font-size: 0.6rem; padding: 0.25rem 0.5rem; }
.mesh-wizard__specs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; }
.mesh-wizard__specs > div { padding: 0.65rem 0.75rem; }
.mesh-wizard__specs dt { color: var(--md-default-fg-color--light); font-size: 0.6rem; }
.mesh-wizard__specs dd { font-size: 0.78rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }

.mesh-wizard__choice-group { border: 0; margin: 1rem 0; padding: 0; }
.mesh-wizard__choice-group > legend { font-size: 0.72rem; font-weight: 700; margin-bottom: 0.5rem; }
.mesh-wizard__hash-options { display: grid; gap: 0.45rem; grid-template-columns: 1fr; max-width: 34.4rem; }
.mesh-wizard__firmware-options { margin-bottom: 1rem; }
.mesh-wizard__hash-card { cursor: pointer; display: flex; margin: 0; position: relative; }
.mesh-wizard__hash-card input { accent-color: var(--wizard-green); left: 0.7rem; position: absolute; top: 0.8rem; }
.mesh-wizard__hash-card > span { border: 1px solid var(--wizard-border); border-radius: 0.2rem; display: grid; gap: 0.25rem; min-height: 0; padding: 0.55rem 0.65rem 0.55rem 2rem; width: 100%; }
.mesh-wizard__hash-card input:checked + span { background: color-mix(in srgb, var(--wizard-green) 7%, var(--md-default-bg-color)); border-color: var(--wizard-green); }
.mesh-wizard__hash-card input:focus-visible + span { outline: 0.12rem solid var(--wizard-green); outline-offset: 0.12rem; }
.mesh-wizard__hash-card strong { display: grid; font-size: 0.75rem; }
.mesh-wizard__hash-card em { color: var(--wizard-green); font-size: 0.62rem; font-style: normal; }
.mesh-wizard__hash-card small { color: var(--md-default-fg-color--light); font-size: 0.7rem; }
.mesh-wizard__hash-card code { font-size: 0.65rem; justify-self: start; }

.mesh-wizard__location-layout { display: grid; gap: 1rem; grid-template-columns: 3fr 2fr; }
.mesh-wizard__map { border: 1px solid var(--wizard-border); border-radius: 0.2rem; height: 26rem; isolation: isolate; overflow: hidden; z-index: 0; }
.mesh-wizard__map-error,
.mesh-wizard__map-loading { padding: 2rem; text-align: center; }
.mesh-wizard__location-panel { align-content: start; align-self: start; display: grid; gap: 0.7rem; padding: 0; }
.mesh-wizard__location-heading { border-bottom: 1px solid var(--wizard-border); display: grid; order: -1; padding-bottom: 0.6rem; }
.mesh-wizard__location-heading span,
.mesh-wizard__region-result > small { color: var(--md-default-fg-color--light); font-size: 0.64rem; text-transform: uppercase; }
.mesh-wizard__coordinate-grid { display: grid; gap: 0.5rem; grid-template-columns: 1fr 1fr; }
.mesh-wizard__coordinate-grid label { display: grid; }
.mesh-wizard__lookup-status { background: color-mix(in srgb, var(--md-default-fg-color) 5%, transparent); font-size: 0.66rem; margin: 0; padding: 0.6rem; }
.mesh-wizard__lookup-status[data-state="ok"] { color: var(--wizard-green); }
.mesh-wizard__offgrid-option { margin: 1rem 0 0; width: 100%; }
.mesh-wizard__offgrid-option > span { min-width: 0; }
.mesh-wizard__offgrid-option code { overflow-wrap: normal; white-space: nowrap; word-break: normal; }
.mesh-wizard__region-result { border-top: 1px solid var(--wizard-border); padding-top: 0.6rem; }
.mesh-wizard__regions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.mesh-wizard__regions span { background: color-mix(in srgb, var(--wizard-green) 9%, var(--md-default-bg-color)); border-radius: 1rem; color: var(--wizard-green); font-family: var(--md-code-font-family); font-size: 0.62rem; padding: 0.2rem 0.4rem; }
.mesh-wizard__fineprint,
.mesh-wizard__attribution { color: var(--md-default-fg-color--light); font-size: 0.64rem; margin: 0.4rem 0 0; }

.mesh-wizard__final-intro { max-width: 34.4rem; }
.mesh-wizard__final-intro h2 { font-size: 1.1rem; }
.mesh-wizard__final-section { margin-top: 2rem; }
.mesh-wizard__final-section-heading { border-bottom: 1px solid var(--wizard-border); margin-bottom: 0.75rem; padding-bottom: 0.45rem; }
.mesh-wizard__final-section-heading h3 { font-size: 1rem; margin: 0; }
.mesh-wizard__final-section-heading p { color: var(--md-default-fg-color--light); font-size: 0.75rem; margin: 0.1rem 0 0; }
.mesh-wizard__summary dl { margin: 0; }
.mesh-wizard__summary dl > div { border-bottom: 1px solid var(--wizard-border); display: grid; gap: 1rem; grid-template-columns: minmax(9rem, 1fr) 2fr; padding: 0.65rem 0; }
.mesh-wizard__summary dt { color: var(--md-default-fg-color--light); font-size: 0.7rem; }
.mesh-wizard__summary dd { display: grid; font-size: 0.75rem; font-weight: 700; margin: 0; }
.mesh-wizard__summary dd small { color: var(--md-default-fg-color--light); font-size: 0.7rem; font-weight: 400; }
.mesh-wizard__direct-transfer { border-left: 0.18rem solid var(--wizard-green); padding: 0.2rem 0 0.2rem 0.9rem; }
.mesh-wizard__direct-transfer h4 { font-size: 0.9rem; margin: 0 0 0.25rem; }
.mesh-wizard__direct-transfer > p { color: var(--md-default-fg-color--light); font-size: 0.75rem; margin: 0 0 0.8rem; }
.mesh-wizard__device-status { background: color-mix(in srgb, var(--md-default-fg-color) 5%, transparent); color: var(--md-default-fg-color--light); font-size: 0.72rem; margin: 0 0 0.75rem; padding: 0.65rem; }
.mesh-wizard__device-status[data-state="error"] { color: #a22121; }
.mesh-wizard__transfer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mesh-wizard__transfer-actions .md-button:not(:disabled) { cursor: pointer; }
.mesh-wizard__connect-button.md-button--primary { box-shadow: 0 0.15rem 0.35rem color-mix(in srgb, var(--wizard-green) 30%, transparent); }
.mesh-wizard__commands { border-top: 1px solid var(--wizard-border); margin-top: 0.8rem; padding-top: 0.7rem; }
.mesh-wizard__commands summary { cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.mesh-wizard__commands > p { color: var(--md-default-fg-color--light); font-size: 0.72rem; }
.mesh-wizard__commands ol { font-size: 0.72rem; }
.mesh-wizard__commands li span { color: var(--md-default-fg-color--light); display: block; font-size: 0.68rem; }
.mesh-wizard__copy-status { font-size: 0.72rem; min-height: 1.2em; }
.mesh-wizard__copy-status[data-state="success"] { color: var(--wizard-green); }
.mesh-wizard__copy-status[data-state="error"] { color: #a22121; }
.mesh-wizard__command-fallback { font-family: var(--md-code-font-family); font-size: 0.65rem; min-height: 10rem; width: 100%; }
.mesh-wizard__apply-progress { border: 1px solid var(--wizard-border); margin-top: 0.8rem; padding: 0.8rem; }
.mesh-wizard__apply-progress p { display: flex; justify-content: space-between; margin: 0; }
.mesh-wizard__apply-progress progress { width: 100%; }
.mesh-wizard__apply-progress pre { max-height: 12rem; overflow: auto; white-space: pre-wrap; }

.mesh-wizard__footer { align-items: center; border-top: 1px solid var(--wizard-border); display: grid; grid-template-columns: 1fr auto 1fr; margin: 0; max-width: 34.4rem; padding: 0.75rem 0; }
.mesh-wizard__footer .md-button { margin: 0; }
.mesh-wizard__footer .md-button:first-child { justify-self: start; }
.mesh-wizard__footer .md-button:last-child { justify-self: end; }
.mesh-wizard .md-button--primary { background: var(--wizard-green); border-color: var(--wizard-green); color: #fff; }
.mesh-wizard .md-button:disabled { cursor: not-allowed; opacity: 0.42; }

[data-md-color-scheme="slate"] #mesh-repeater-wizard { --wizard-green: #5cce7a; }
[data-md-color-scheme="slate"] #mesh-repeater-wizard :is(
  .mesh-wizard__notice,
  .mesh-wizard__field-meta strong[data-state="error"],
  .mesh-wizard__field-meta strong[data-state="warning"],
  .mesh-wizard__device-status[data-state="error"],
  .mesh-wizard__copy-status[data-state="error"]
) { color: #ff8a80; }
[data-md-color-scheme="slate"] #mesh-repeater-wizard .mesh-wizard__notice { border-color: #ff8a80; }

@media (max-width: 50rem) {
  .mesh-wizard__location-layout { grid-template-columns: 1fr; }
  .mesh-wizard__hash-card > span { min-height: 0; }
}

@media (max-width: 35rem) {
  .mesh-wizard__steps { margin-inline: -0.8rem; overflow-x: auto; padding-inline: 0.8rem; }
  .mesh-wizard__steps > ol#mesh-wizard-step-list { min-width: 31rem; }
  .mesh-wizard__steps button small { white-space: nowrap; }
  .mesh-wizard__panel { min-height: 19rem; padding: 1.1rem 0; }
  .mesh-wizard__summary dl > div { gap: 0.2rem; grid-template-columns: 1fr; }
  .mesh-wizard__specs { grid-template-columns: 1fr 1fr; }
  .mesh-wizard__coordinate-grid { grid-template-columns: 1fr; }
  .mesh-wizard__transfer-actions .md-button { flex: 1 1 100%; }
  .mesh-wizard__map { height: 21rem; }
  .mesh-wizard__footer { grid-template-columns: 1fr 1fr; }
  .mesh-wizard__footer > span { display: none; }
}
