/* Migration scanner page. Builds on the tokens in /studio-luxury.css. */
.mono { font-family: var(--font-mono); }
.nav-item.is-current { color: var(--emerald-accent); }
.mg-muted { color: var(--text-muted); font-size: 16px; line-height: 1.7; }

/* Hero + scanner */
.mg-hero { position: relative; padding: 88px 0 72px; overflow: hidden; }
.mg-hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; align-items: center; }
.mg-hero-copy .pill { display: inline-block; margin-bottom: 24px; }
.mg-title { font-size: clamp(38px, 4.6vw, 64px); font-weight: 800; line-height: 1.05; letter-spacing: -0.04em; color: #fff; margin-bottom: 22px; text-wrap: balance; }
.mg-lead { font-size: 18px; color: var(--text-muted); line-height: 1.65; max-width: 60ch; }

.mg-scan { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 20px; padding: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.mg-scan-label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--emerald-accent); margin-bottom: 12px; }
.mg-scan-row { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.mg-scan-prefix { display: flex; align-items: center; padding: 0 0 0 16px; margin-right: -10px; border: 1px solid var(--border-light); border-right: 0; border-radius: 12px 0 0 12px; background: #071714; color: var(--text-dim); font-family: var(--font-mono); font-size: 14px; }
.mg-scan-row input { flex: 1 1 180px; min-width: 0; background: #071714; border: 1px solid var(--border-light); border-left: 0; border-radius: 0 12px 12px 0; color: #fff; font: 500 16px var(--font-mono); padding: 14px 14px 14px 4px; }
.mg-scan-row input:focus { outline: none; }
.mg-scan-row:focus-within .mg-scan-prefix, .mg-scan-row:focus-within input { border-color: var(--emerald-accent); }
.mg-scan-btn { border: 0; cursor: pointer; padding: 14px 24px; font-family: var(--font-sans); }
.mg-scan-btn[disabled], .mg-form-btn[disabled] { opacity: 0.6; cursor: progress; transform: none; box-shadow: none; }
.mg-turnstile { margin-top: 14px; min-height: 0; }
.mg-turnstile:empty { display: none; }
.mg-scan-note { margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.mg-scan-error { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(255, 107, 107, 0.08); border: 1px solid rgba(255, 107, 107, 0.3); color: #ffb4a8; font-size: 14px; }
.mg-progress { list-style: none; margin-top: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--text-dim); }
.mg-progress li { display: flex; align-items: center; gap: 10px; }
.mg-progress li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--text-dim); flex-shrink: 0; }
.mg-progress li.is-active { color: #fff; }
.mg-progress li.is-active::before { background: var(--emerald-accent); border-color: var(--emerald-accent); box-shadow: 0 0 8px var(--emerald-accent); animation: pulse-ring 1.4s infinite; }
.mg-progress li.is-done { color: var(--text-muted); }
.mg-progress li.is-done::before { background: var(--text-muted); border-color: var(--text-muted); }

/* Report */
.mg-report-section { padding: 72px 0 96px; border-top: 1px solid var(--border-dark); background: #071714; scroll-margin-top: 80px; }
.mg-report-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.mg-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 12px; border-radius: 100px; border: 1px dashed var(--gold-accent); color: var(--gold-accent); margin-bottom: 14px; }
.mg-badge.is-live { border-style: solid; border-color: var(--emerald-accent); color: var(--emerald-accent); }
.mg-report-title { font-size: clamp(24px, 2.6vw, 34px); font-weight: 800; letter-spacing: -0.02em; color: #fff; line-height: 1.2; overflow-wrap: anywhere; }
.mg-report-title .mono { font-weight: 500; color: var(--emerald-accent); font-size: 0.8em; }
.mg-report-meta { color: var(--text-dim); font-size: 14px; margin-top: 6px; }
#report-body.is-loading { opacity: 0.35; transition: opacity 0.2s; pointer-events: none; }

.mg-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.mg-stat { background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.mg-stat-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim); }
.mg-stat-value { font: 700 30px/1.1 var(--font-mono); color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mg-stat-value small { font-size: 15px; color: var(--text-dim); font-weight: 500; }
.mg-stat-sub { font-size: 13px; color: var(--text-muted); }
.mg-meter { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 4px; }
.mg-meter span { display: block; height: 100%; border-radius: 6px; background: var(--emerald-accent); }
.mg-meter.lvl-high span { background: var(--gold-accent); }
.mg-meter.lvl-very span { background: #ff8a7a; }
.mg-fit { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; padding: 6px 12px; border-radius: 100px; }
.mg-fit::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.mg-fit.good { color: var(--emerald-accent); background: rgba(45, 226, 166, 0.1); }
.mg-fit.workable { color: var(--gold-accent); background: rgba(229, 192, 123, 0.1); }
.mg-fit.review { color: #ff9f90; background: rgba(255, 138, 122, 0.1); }

.mg-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; margin-bottom: 16px; }
.mg-panel { background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 16px; padding: 24px; min-width: 0; }
.mg-panel h3 { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.mg-panel h3 small { font-size: 12px; font-weight: 500; color: var(--text-dim); }
.mg-kv { display: grid; gap: 0; }
.mg-kv div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-dark); font-size: 14px; }
.mg-kv div:last-child { border-bottom: 0; }
.mg-kv dt { color: var(--text-muted); }
.mg-kv dd { font-family: var(--font-mono); color: #fff; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mg-kv dd.warn { color: var(--gold-accent); }

.mg-issues { list-style: none; display: grid; gap: 10px; }
.mg-issue { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border-dark); }
.mg-sev { align-self: start; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; text-align: center; padding: 4px 0; border-radius: 6px; }
.mg-sev.high { color: #ff9f90; background: rgba(255, 138, 122, 0.12); }
.mg-sev.medium { color: var(--gold-accent); background: rgba(229, 192, 123, 0.12); }
.mg-sev.low { color: var(--text-muted); background: rgba(255, 255, 255, 0.06); }
.mg-issue strong { display: block; color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.mg-issue p { color: var(--text-muted); font-size: 13px; line-height: 1.55; }

.mg-drivers { list-style: none; display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border-dark); }
.mg-drivers li { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--text-muted); }
.mg-drivers li span:last-child { font-family: var(--font-mono); color: var(--text-dim); }

.mg-table-wrap { overflow-x: auto; }
.mg-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 680px; }
.mg-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); padding: 0 12px 10px 0; border-bottom: 1px solid var(--border-light); }
.mg-table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border-dark); vertical-align: top; color: var(--text-muted); }
.mg-table tr:last-child td { border-bottom: 0; }
.mg-table td:first-child { color: #fff; font-weight: 600; }
.mg-table td small { display: block; color: var(--text-dim); font-weight: 400; font-size: 12px; margin-top: 2px; }
.mg-kind { display: inline-block; white-space: nowrap; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; border: 1px solid var(--border-light); color: var(--text-muted); }
.mg-kind.built-in, .mg-kind.not-needed { color: var(--emerald-accent); border-color: rgba(45, 226, 166, 0.3); }
.mg-kind.plus-only, .mg-kind.third-party-app { color: var(--gold-accent); border-color: rgba(229, 192, 123, 0.3); }
.mg-kind.no-equivalent { color: #ff9f90; border-color: rgba(255, 138, 122, 0.35); }

.mg-connected { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.mg-connected p { color: var(--text-muted); font-size: 14px; max-width: 70ch; }
.mg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mg-chips span { font-size: 12px; padding: 4px 10px; border-radius: 100px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-dark); color: var(--text-muted); }
.mg-unsupported { text-align: center; padding: 48px 24px; }
.mg-unsupported p { color: var(--text-muted); margin: 10px auto 24px; max-width: 56ch; }

/* Sections */
.mg-section { padding: 96px 0; border-top: 1px solid var(--border-dark); }
.mg-alt { background: #071714; }
.mg-plan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 64px; align-items: start; scroll-margin-top: 80px; }
.mg-plan .section-title { text-wrap: balance; }
.mg-checks { list-style: none; display: grid; gap: 12px; margin-top: 28px; }
.mg-checks li { display: flex; gap: 12px; color: var(--text-muted); font-size: 15px; }
.mg-checks li::before { content: "✓"; color: var(--emerald-accent); font-weight: 700; }

.mg-form { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 20px; padding: 28px; display: grid; gap: 16px; }
.mg-field { display: grid; gap: 6px; min-width: 0; }
.mg-field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mg-field label { font-size: 13px; font-weight: 600; color: #fff; }
.mg-optional { color: var(--text-dim); font-weight: 400; }
.mg-field input, .mg-field select, .mg-field textarea { width: 100%; background: #071714; border: 1px solid var(--border-light); border-radius: 10px; color: #fff; font: 400 15px var(--font-sans); padding: 12px 14px; }
.mg-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.mg-field textarea { resize: vertical; }
.mg-field input:focus, .mg-field select:focus, .mg-field textarea:focus, .mg-consent input:focus-visible { outline: 2px solid var(--emerald-accent); outline-offset: 1px; border-color: transparent; }
.mg-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mg-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.mg-consent input { margin-top: 3px; accent-color: var(--emerald-accent); width: 16px; height: 16px; flex-shrink: 0; }
.mg-form-btn { border: 0; cursor: pointer; justify-content: center; font-family: var(--font-sans); }
.mg-success { padding: 14px 16px; border-radius: 12px; background: rgba(45, 226, 166, 0.08); border: 1px solid rgba(45, 226, 166, 0.3); color: var(--text-main); font-size: 14px; display: grid; gap: 4px; }
.mg-success strong { color: var(--emerald-accent); }

.mg-steps { list-style: none; counter-reset: step; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.mg-steps li { counter-increment: step; background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 16px; padding: 24px 20px; }
.mg-steps li::before { content: counter(step, decimal-leading-zero); display: block; font: 500 13px var(--font-mono); color: var(--emerald-accent); margin-bottom: 14px; }
.mg-steps h3 { font-size: 16px; color: #fff; margin-bottom: 8px; }
.mg-steps p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }

.mg-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; align-items: center; }
.mg-protect { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mg-protect li { background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 16px; padding: 20px; display: grid; gap: 6px; }
.mg-protect strong { color: #fff; font-size: 15px; }
.mg-protect span { color: var(--text-muted); font-size: 14px; line-height: 1.55; }

.mg-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; max-width: 1080px; margin: 0 auto; }
.mg-tier { background: var(--bg-card); border: 1px solid var(--border-dark); border-radius: 16px; padding: 26px 22px; display: grid; gap: 8px; align-content: start; }
.mg-tier.is-featured { border-color: rgba(45, 226, 166, 0.45); box-shadow: 0 0 0 1px rgba(45, 226, 166, 0.15), 0 20px 50px rgba(45, 226, 166, 0.06); }
.mg-tier h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--emerald-accent); }
.mg-price { font: 700 32px/1.1 var(--font-mono); color: #fff; letter-spacing: -0.02em; }
.mg-price span { font: 500 13px var(--font-sans); color: var(--text-dim); letter-spacing: 0; margin-right: 4px; }
.mg-tier-scope { font-size: 14px; color: var(--text-muted); }

.mg-faq { max-width: 860px; }
.mg-faq .section-title { margin-bottom: 28px; }
.mg-faq details { border-bottom: 1px solid var(--border-dark); }
.mg-faq summary { cursor: pointer; list-style: none; padding: 20px 32px 20px 0; font-size: 17px; font-weight: 600; color: #fff; position: relative; }
.mg-faq summary::-webkit-details-marker { display: none; }
.mg-faq summary::after { content: "+"; position: absolute; right: 4px; top: 16px; font: 400 24px var(--font-mono); color: var(--emerald-accent); }
.mg-faq details[open] summary::after { content: "–"; }
.mg-faq summary:focus-visible { outline: 2px solid var(--emerald-accent); outline-offset: 4px; }
.mg-faq details p { color: var(--text-muted); padding: 0 0 20px; max-width: 70ch; line-height: 1.7; }

@media (max-width: 1180px) {
  .mg-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mg-tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .mg-hero-inner, .mg-plan, .mg-split, .mg-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .mg-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-cta { display: none; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .mg-hero { padding: 48px 0 48px; }
  .mg-summary, .mg-field-row, .mg-protect, .mg-tiers, .mg-steps { grid-template-columns: minmax(0, 1fr); }
  .mg-scan, .mg-form, .mg-panel { padding: 20px; }
  .mg-scan-btn { flex: 1 1 100%; justify-content: center; }
  .mg-section { padding: 64px 0; }
  .mg-issue { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mg-sev { justify-self: start; padding: 4px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .mg-progress li.is-active::before { animation: none; }
}

/* Keep the hidden attribute authoritative over display rules above. */
.mg-progress[hidden], .mg-scan-error[hidden], .mg-success[hidden], .mg-form-btn[hidden] { display: none; }
.mg-consent a { color: var(--emerald-accent); text-decoration: underline; }

/* Shared report: header strip and print (Save as PDF) styles */
.rp-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 0; border-bottom: 1px solid var(--border-dark); }
.rp-bar .rp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-bar button { font-family: var(--font-sans); cursor: pointer; background: transparent; }
.rp-cta { margin-top: 24px; }
@media print {
  @page { margin: 14mm; }
  body.studio-body { background: #fff !important; color: #111 !important; }
  .site-header, .site-footer, .rp-actions, .skip-nav, .mg-report-head .btn-outline, .rp-cta .btn-primary, .hero-glow { display: none !important; }
  .mg-report-section { background: #fff !important; padding: 0 !important; border: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .mg-report-title, .mg-panel h3, .mg-issue strong, .mg-stat-value, .mg-kv dd, .mg-table td:first-child, .brand-name { color: #111 !important; }
  .mg-report-title .mono { color: #0b6b4f !important; }
  .mg-report-meta, .mg-kv dt, .mg-stat-sub, .mg-issue p, .mg-table td, .mg-drivers li, .mg-connected p, .mg-stat-label, .mg-panel h3 small { color: #444 !important; }
  .mg-stat, .mg-panel, .mg-issue { background: #fff !important; border: 1px solid #d6d6d6 !important; box-shadow: none !important; break-inside: avoid; }
  .mg-summary { grid-template-columns: repeat(2, 1fr) !important; }
  .mg-grid { grid-template-columns: 1fr !important; }
  .mg-kv div, .mg-table td, .mg-table th, .mg-drivers { border-color: #e2e2e2 !important; }
  .mg-badge { color: #0b6b4f !important; border-color: #0b6b4f !important; }
  .mg-chips span, .mg-kind { background: #f3f3f3 !important; color: #333 !important; border-color: #ccc !important; }
  .mg-meter { background: #e6e6e6 !important; }
  .mg-meter span, .mg-fit::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mg-fit.good { color: #0b6b4f !important; background: #e8f5ef !important; }
  .mg-fit.workable { color: #8a5a00 !important; background: #fbf1dc !important; }
  .mg-fit.review { color: #a3261a !important; background: #fbe6e3 !important; }
  .mg-sev.high { color: #a3261a !important; background: #fbe6e3 !important; }
  .mg-sev.medium { color: #8a5a00 !important; background: #fbf1dc !important; }
  .mg-sev.low { color: #444 !important; background: #eee !important; }
  .rp-print-footer { display: block !important; margin-top: 18px; font-size: 11px; color: #555; }
}
.rp-print-footer { display: none; }
.rp-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rp-actions .btn-outline { background: transparent; color: #fff; font-family: var(--font-sans); cursor: pointer; padding: 9px 18px; font-size: 13px; }
.rp-actions .btn-outline:hover { background: #fff; color: #000; }
@media (max-width: 640px) { .rp-actions .btn-partner { display: none; } }
