.mgx-home .cta {
  color: inherit;
  text-decoration: none;
}

.mgx-home .cta:focus-visible,
.mgx-flow a:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 6px;
}

body.mgx-flow {
  overflow: auto;
  user-select: text;
}

.mgx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(24px, 5vw, 80px);
  border-bottom: 1px solid var(--line);
}

.mgx-logo {
  display: inline-flex;
}

.mgx-logo img {
  width: 150px;
  height: auto;
}

.mgx-platform {
  color: var(--ink2);
  font: 500 12px/1.4 var(--mono);
  letter-spacing: .12em;
}

.mgx-page {
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 72px) clamp(24px, 5vw, 64px);
}

.mgx-page h1 {
  max-width: 950px;
  margin-top: 16px;
  font-size: clamp(30px, 4vw, 56px);
  line-height: 1.12;
  text-transform: uppercase;
}

.mgx-page h2 {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.25;
}

.mgx-lead {
  max-width: 820px;
  margin-top: 20px;
  color: var(--ink2);
  font-size: clamp(17px, 1.5vw, 21px);
}

.mgx-comparison,
.mgx-configurator-shell,
.mgx-receipt-shell {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.mgx-receipt-shell {
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
}

.mgx-card {
  padding: clamp(24px, 3vw, 36px);
  background: var(--paper);
  border: 1px solid var(--line2);
  border-radius: 16px;
}

.mgx-card-accent {
  border-color: var(--green);
}

.mgx-card p,
.mgx-card h2 + div,
.mgx-closing {
  margin-top: 18px;
}

.mgx-card img,
.mgx-platform-preview img,
.mgx-validation-assembly img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.mgx-card img {
  height: 260px;
  margin-bottom: 24px;
}

.mgx-platform-preview {
  align-self: center;
}

.mgx-steps ol {
  margin: 24px 0 0 24px;
  color: var(--ink2);
}

.mgx-steps li + li {
  margin-top: 10px;
}

.mgx-page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 44px;
}

.mgx-page-actions a {
  text-decoration: none;
}

.mgx-card a {
  color: var(--green);
}

.mgx-validation-assembly {
  max-width: 650px;
  margin: 36px auto;
}

/* Database-backed configuration steps. */
.mgx-flow [hidden] { display: none !important; }
.mgx-save-state { margin-top: 20px; min-height: 24px; color: var(--lime); }
.mgx-message { margin-top: 24px; padding: 24px; border: 1px solid var(--orange); border-radius: 12px; background: var(--warn-soft); }
.mgx-message a { color: var(--lime); }
.mgx-builder { display: grid; grid-template-columns: minmax(240px, 310px) minmax(0, 1fr); gap: 32px; margin-top: 32px; }
.mgx-build-sidebar { align-self: start; padding: 24px; }
.mgx-build-sidebar .mgx-build-preview { height: 150px; margin-bottom: 20px; }
.mgx-build-sidebar h2 { margin-top: 28px; }
#build-summary p { font-size: 13px; color: var(--ink2); overflow-wrap: anywhere; margin-top: 12px; }
#build-summary strong { color: var(--ink); }
#build-power { font-size: 14px; color: var(--lime); }
.mgx-step-navigation { padding: 0; margin: 0; list-style: none; }
.mgx-step-navigation button { display: block; width: 100%; padding: 10px 12px; text-align: left; background: transparent; color: var(--ink2); border: 1px solid transparent; border-radius: 6px; font: 500 13px/1.4 var(--sans); cursor: pointer; }
.mgx-step-navigation [aria-current] { border-color: var(--green); color: var(--ink); background: var(--accent-soft); }
.mgx-choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.mgx-choice { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 190px; padding: 24px; border: 1px solid var(--line2); border-radius: 12px; text-align: left; background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .2s, background .2s; }
.mgx-choice:hover:enabled { border-color: var(--lime); }
.mgx-choice.is-selected { border: 2px solid var(--green); padding: 23px; background: var(--accent-soft); }
.mgx-choice img { display: block; width: 100%; height: 150px; object-fit: contain; margin-bottom: 18px; }
.mgx-choice-title { font-size: 20px; font-weight: 700; line-height: 1.25; }
.mgx-choice-spec { margin-top: 12px; font-size: 14px; color: var(--ink2); }
.mgx-choice-tag { margin-top: 16px; font-size: 12px; color: var(--lime); }
.mgx-review-tag { color: var(--orange); }
.mgx-quantity { margin-bottom: 24px; }
.mgx-quantity button { margin: 12px 12px 0 0; padding: 12px 24px; border: 1px solid var(--line2); border-radius: 8px; color: var(--ink); background: var(--paper); font: 700 18px var(--mono); cursor: pointer; }
.mgx-quantity [aria-pressed="true"] { border-color: var(--green); color: var(--green); }
.mgx-flow button:disabled { opacity: .45; cursor: default; }
.mgx-flow button:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
.mgx-notice-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.mgx-check-panel { margin-top: 32px; }
.mgx-table { width: 100%; margin-top: 24px; border-collapse: collapse; text-align: left; font-size: 14px; }
.mgx-table th, .mgx-table td { padding: 14px 8px; border-bottom: 1px solid var(--line2); overflow-wrap: anywhere; }
.mgx-table thead { color: var(--ink2); }
.mgx-result { font: 700 13px/1.4 var(--mono); letter-spacing: .06em; }
.mgx-result[data-result="PASS"] { color: var(--green); }
.mgx-result[data-result="REVIEW"], .mgx-result[data-result="FAIL"] { color: var(--orange); }
.mgx-result[data-result="SOFT"] { color: var(--cloud); }
.mgx-receipt-power { color: var(--lime); }
@media (max-width: 900px) {
  .mgx-builder { grid-template-columns: 1fr; }
  .mgx-step-navigation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mgx-build-sidebar .mgx-build-preview { display: none; }
}
@media (max-width: 540px) {
  .mgx-choice-grid { grid-template-columns: 1fr; }
  .mgx-table th, .mgx-table td { padding: 12px 4px; font-size: 12px; }
}
@media (max-width: 760px) {
  .mgx-comparison,
  .mgx-configurator-shell,
  .mgx-receipt-shell {
    grid-template-columns: 1fr;
  }

  .mgx-platform {
    font-size: 10px;
  }
}

/* Saves are transparent to the original screen design. */
body.mgx-original { overflow: hidden; }
.mgx-saving #rbody, .mgx-saving #next, .mgx-saving #back,
.mgx-saving #sh2next, .mgx-saving #toReceipt,
.mgx-saving #toMap, .mgx-saving [data-mgx-restart], .mgx-saving .mgx-restart-actions { pointer-events: none; }
.mgx-saving .mgx-restart-actions.mgx-timeout-actions { pointer-events: auto; }
.mgx-save-error { position: fixed; left: 24px; right: 24px; bottom: 24px; z-index: 200; padding: 20px; border: 1px solid var(--orange); border-radius: 12px; background: var(--paper); color: var(--ink); }

/* A moving part stays crisp at launch/landing; blur belongs to its inner artwork. */
.mgx-flight { contain: layout style; }
.mgx-flight .flight-art { width: 100%; height: 100%; will-change: filter; }
.mgx-flight .trail { box-shadow: 0 0 24px 6px rgba(145, 213, 0, .28); }
.stn2.in-flight .slot .art { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) {
  .mgx-flight { display: none; }
}
