:root {
  --navy: #364156;
  --navy-soft: #505c72;
  --coral: #d66853;
  --coral-dark: #c45743;
  --coral-soft: #fbeeea;
  --ink-muted: #687386;
  --line: #e2e6eb;
  --surface: #fff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--navy);
  background: #f3f4f2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { overflow-x: clip; }
[hidden] { display: none !important; }
body {
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 28px 16px;
  background:
    linear-gradient(135deg, rgba(33, 45, 64, .035) 25%, transparent 25%) 0 0 / 28px 28px,
    #f5f5f2;
}
button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.wizard {
  width: min(100%, 680px);
  margin: auto;
  background: transparent;
}

.wizard-header { padding: 20px 32px 0; overflow: hidden; border: 1px solid #dde1e4; border-top: 4px solid var(--navy); border-radius: 16px; background: var(--surface); box-shadow: 0 10px 30px rgba(33, 45, 64, .08); }
.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--navy); font-size: 16.5px; font-weight: 800; text-decoration: none; }
.brand-mark { display: grid; width: 27px; height: 27px; place-items: center; border-radius: 7px; color: #fff; background: var(--coral); font-size: 13.2px; }
.browser-support { display: flex; align-items: center; gap: 7px; color: var(--ink-muted); }
.support-label { margin-right: 2px; font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.browser-icon { display: inline-flex; width: 23px; height: 23px; align-items: center; justify-content: center; border-radius: 50%; }
.browser-icon img { display: block; width: 100%; height: 100%; }
.help-button { display: grid; width: 29px; height: 29px; padding: 5px; place-items: center; border: 1px solid #d7dbe0; border-radius: 8px; background: #fff; cursor: pointer; }
.help-button img { width: 17px; height: 17px; opacity: .75; }
.help-button:hover { border-color: var(--coral); background: var(--coral-soft); }
.help-button:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; }
.browser-warning { margin-top: 14px; padding: 10px 12px; border: 1px solid var(--coral); border-radius: 8px; color: #fff; background: var(--coral); box-shadow: 0 4px 12px rgba(214, 104, 83, .18); font-size: 13.2px; line-height: 1.4; }
.browser-warning strong { margin-right: 3px; }
.eyebrow { margin: 18px 0 4px; color: var(--coral); font-size: 12.1px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(27.5px, 4.4vw, 34.1px); line-height: 1.2; letter-spacing: -.025em; }
h1 a { color: inherit; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1 a:hover { color: var(--coral-dark); }
h1 a:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; border-radius: 2px; }
.lead { margin: 6px 0 20px; color: var(--ink-muted); font-size: 16.5px; }

.steps { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 520px; margin: 0 auto; padding-bottom: 20px; }
.step-tab { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 0; border: 0; color: #98a0aa; background: transparent; text-align: left; cursor: pointer; }
.step-tab span:last-child { display: grid; min-width: 0; gap: 1px; }
.step-tab strong { color: inherit; font-size: 16.5px; }
.step-tab small { font-size: 13.2px; white-space: nowrap; }
.step-number { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border: 1px solid #d5d9de; border-radius: 50%; font-size: 15.4px; font-weight: 800; }
.step-tab.is-active { color: var(--navy); }
.step-tab.is-active .step-number { color: #fff; border-color: var(--coral); background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.step-line { width: 52px; height: 2px; margin: 0 20px; background: #d9dde2; }

.wizard-body { margin-top: 12px; padding: 24px 32px 22px; overflow: hidden; border: 1px solid #dde1e4; border-radius: 16px; background: var(--surface); box-shadow: 0 16px 45px rgba(33, 45, 64, .10); }
.section-heading { margin-bottom: 18px; }
.section-heading h2 { margin: 6px 0 3px; color: var(--navy); font-size: 24.2px; letter-spacing: -.015em; }
.section-heading p { margin: 0; color: var(--ink-muted); font-size: 15.4px; line-height: 1.45; }
.optional-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--coral-dark); background: var(--coral-soft); font-size: 9.9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
label { display: block; margin-bottom: 5px; color: var(--navy-soft); font-size: 12.1px; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; }
.select-wrap { position: relative; }
.select-wrap::after { position: absolute; top: 50%; right: 12px; content: "⌄"; color: var(--navy-soft); transform: translateY(-60%); pointer-events: none; }
select { width: 100%; height: 39px; padding: 8px 34px 8px 11px; appearance: none; border: 1px solid #d4d9df; border-radius: 8px; outline: 0; color: var(--navy); background: #fff; font-size: 13.2px; }
select:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(214, 104, 83, .13); }
.install-panel { padding: 16px; border-top: 1px solid var(--line); background: #fcfcfb; }
.field-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(155px, 1fr); gap: 10px; }
.ready-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid #d9e5df; border-radius: 12px; background: #f8fbf9; }
.ready-copy { display: flex; min-width: 0; align-items: center; gap: 12px; }
.ready-copy > div { display: grid; gap: 2px; }
.ready-copy strong { color: var(--navy); font-size: 14.3px; }
.ready-copy small { color: var(--ink-muted); font-size: 12.1px; line-height: 1.4; }
.ready-icon { display: grid; flex: 0 0 30px; width: 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--coral); background: var(--coral-soft); }
.ready-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.ready-panel .button { flex: 0 0 auto; min-width: 112px; }
.preparation { margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.preparation summary { display: flex; min-height: 54px; align-items: center; gap: 10px; padding: 10px 13px; cursor: pointer; list-style: none; }
.preparation summary::-webkit-details-marker { display: none; }
.preparation summary:hover { background: #fafaf9; }
.preparation summary:focus-visible { outline: 3px solid rgba(214, 104, 83, .18); outline-offset: -3px; }
.preparation summary > span:nth-child(2) { display: grid; gap: 2px; }
.preparation summary strong { color: var(--navy); font-size: 14.3px; }
.preparation summary small { color: var(--ink-muted); font-size: 12.1px; }
.summary-icon { display: grid; flex: 0 0 30px; height: 30px; place-items: center; border-radius: 7px; color: var(--coral); background: var(--coral-soft); }
.summary-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.summary-chevron { margin-left: auto; color: var(--ink-muted); font-size: 19.8px; transition: transform .2s; }
.preparation[open] .summary-chevron { transform: rotate(180deg); }
.setup-flow-content { border-top: 1px solid var(--line); }
.instructions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0; padding: 16px; background: #fff; list-style: none; counter-reset: setup; }
.instructions li { display: flex; align-items: center; gap: 8px; color: #596579; font-size: 14.3px; line-height: 1.35; counter-increment: setup; }
.instructions li::before { display: grid; flex: 0 0 21px; height: 21px; place-items: center; border-radius: 6px; color: var(--navy); background: #fff; box-shadow: inset 0 0 0 1px #cbd1d8; content: counter(setup); font-size: 9.9px; font-weight: 800; }

.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; font-weight: 750; font-size: 14.3px; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(214, 104, 83, .22); outline-offset: 2px; }
.button:disabled { opacity: .46; cursor: not-allowed; }
.button-primary { color: #fff; background: var(--coral); box-shadow: 0 4px 12px rgba(214, 104, 83, .20); }
.button-primary:hover:not(:disabled) { background: var(--coral-dark); box-shadow: 0 5px 15px rgba(214, 104, 83, .26); }
.button-secondary { color: var(--navy); border-color: #cbd1d8; background: #fff; }
.button-secondary:hover:not(:disabled) { border-color: var(--navy); background: #f5f6f7; }
.button-danger { color: var(--coral-dark); border-color: #e3aaa0; background: #fff; }
.button-danger:hover:not(:disabled) { color: #fff; border-color: var(--coral); background: var(--coral); }
.button-ghost { color: var(--ink-muted); background: transparent; }
.button-ghost:hover:not(:disabled) { color: var(--navy); background: #f0f2f3; }
.button-full { width: 100%; margin-top: 14px; }
.status { display: block; min-height: 16px; margin: 6px 0 0; color: var(--ink-muted); font-size: 12.1px; text-align: center; }
.status:empty { display: none; }
.status.is-error { color: var(--coral); font-weight: 700; }
.status.is-success { color: #28765d; font-weight: 700; }
.inline-help-link { display: block; margin: 4px auto 0; padding: 3px; border: 0; color: var(--coral-dark); background: transparent; font-size: 12.1px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.inline-help-link:hover { color: var(--navy); }
.inline-help-link:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); border-radius: 3px; }

.step-actions { display: flex; justify-content: space-between; gap: 10px; margin: 24px -32px -22px; padding: 15px 32px; border-top: 0; background: var(--navy); box-shadow: inset 0 1px rgba(255, 255, 255, .08); }
.step-actions .button-ghost { color: #fff; }
.step-actions .button-ghost:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, .11); }
.step-actions .button-primary { box-shadow: 0 4px 14px rgba(0, 0, 0, .16); }
.connection-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid #dfe3e7; border-radius: 10px; background: #f8f9f9; }
.connection-copy { display: flex; min-width: 0; align-items: center; gap: 10px; }
.connection-copy div { display: grid; min-width: 0; gap: 2px; }
.connection-copy strong { color: var(--navy); font-size: 13.2px; }
.connection-copy small { color: #87909d; font-size: 11px; }
.connection-dot { width: 8px; height: 8px; border-radius: 50%; background: #b9c0c8; box-shadow: 0 0 0 3px #e8eaed; }
.connection-dot.is-connected { background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.connection-toggle { width: 100%; min-width: 116px; }
.connection-toggle.is-connected { color: #fff; border-color: var(--coral); background: var(--coral); }
.connection-toggle.is-connected:hover:not(:disabled) { border-color: var(--coral-dark); color: #fff; background: var(--coral-dark); }
.connection-controls { display: flex; align-items: flex-start; gap: 8px; }
.connection-controls > .button { width: 170px; }
.connection-connect-group { display: grid; width: 170px; max-width: 100%; gap: 5px; }
.serial-filter-option { display: flex; width: 100%; align-items: flex-start; gap: 6px; margin: 0; color: var(--ink-muted); font-size: 9.9px; font-weight: 600; line-height: 1.25; letter-spacing: 0; text-transform: none; cursor: pointer; }
.serial-filter-option input { flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--coral); }
.serial-filter-option input:disabled + span { opacity: .55; }
.application-source-group { min-width: 0; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfb; }
.application-source-group h3 { margin: 0 0 8px; color: var(--navy); font-size: 12.1px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.bundled-application-options { display: flex; gap: 12px; padding: 2px 2px 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: #cbd1d8 transparent; }
.bundled-application-options::-webkit-scrollbar { height: 7px; }
.bundled-application-options::-webkit-scrollbar-thumb { border-radius: 99px; background: #cbd1d8; }
.bundled-application-options:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; }
.application-option { position: relative; min-width: 0; }
.bundled-application-option { flex: 1 0 250px; }
.custom-application-option { width: 100%; margin-top: 12px; }
.source-card { display: flex; min-height: 58px; align-items: center; gap: 9px; padding: 9px 76px 9px 9px; margin: 0; border: 1px solid #d9dde2; border-radius: 8px; color: var(--navy); background: #fff; letter-spacing: 0; text-transform: none; cursor: pointer; }
.source-card > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.source-card strong { font-size: 13.2px; }
.source-card small { color: var(--ink-muted); font-size: 9.9px; font-weight: 500; line-height: 1.35; }
.custom-source-card { display: block; padding: 0; cursor: default; }
.source-card-choice { display: flex; min-height: 58px; align-items: center; gap: 9px; padding: 9px; margin: 0; letter-spacing: 0; text-transform: none; cursor: pointer; }
.source-card-choice > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.source-icon { display: grid; flex: 0 0 29px; height: 29px; place-items: center; border-radius: 7px; color: var(--coral); background: var(--coral-soft); font-size: 14.3px; }
.custom-icon { font: 700 9.9px ui-monospace, SFMono-Regular, Menlo, monospace; }
.source-check { display: grid; flex: 0 0 17px; width: 17px; height: 17px; margin-left: auto; place-items: center; border: 1px solid #ccd2d9; border-radius: 50%; color: transparent; font-size: 11px; }
.application-info-button { position: absolute; top: 50%; right: 38px; display: grid; width: 23px; height: 23px; padding: 0; transform: translateY(-50%); place-items: center; border: 1px solid #cbd1d8; border-radius: 50%; color: var(--ink-muted); background: #fff; font-size: 12px; font-weight: 800; cursor: pointer; }
.application-info-button:hover { border-color: var(--coral); color: var(--coral-dark); background: var(--coral-soft); }
.application-info-button:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; }
.source-radio:checked + .source-card { border-color: var(--coral); box-shadow: 0 0 0 2px rgba(214, 104, 83, .11); }
.source-radio:checked + .source-card .source-check { color: #fff; border-color: var(--coral); background: var(--coral); }
.source-radio:focus + .source-card { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; }
.file-selection { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 8px 9px 9px; border-top: 1px solid var(--line); }
.file-picker-button { display: inline-flex; min-height: 34px; align-items: center; padding: 7px 11px; margin: 0; border: 1px solid #cbd1d8; border-radius: 7px; color: var(--navy); background: #fff; font-size: 12.1px; font-weight: 750; letter-spacing: 0; text-transform: none; cursor: pointer; }
.file-picker-button:hover { border-color: var(--coral); background: var(--coral-soft); }
.visually-hidden:focus + .file-picker-button { outline: 3px solid rgba(214, 104, 83, .2); outline-offset: 2px; }
#applicationFileName { min-width: 0; overflow: hidden; color: var(--ink-muted); font-size: 9.9px; text-overflow: ellipsis; white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
progress { width: 100%; height: 5px; margin: 12px 0 2px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; background: #e9ebed; }
progress::-webkit-progress-bar { background: #e9ebed; }
progress::-webkit-progress-value { border-radius: 99px; background: var(--coral); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--coral); }
.activity { margin-top: 10px; color: var(--ink-muted); font-size: 12.1px; }
.activity summary { cursor: pointer; font-weight: 700; }
pre { min-height: 80px; max-height: 150px; margin: 8px 0 0; padding: 10px; overflow: auto; border: 1px solid #e0e3e6; border-radius: 7px; color: #586477; background: #f6f7f8; font: 12.1px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }

.help-dialog { width: min(calc(100% - 28px), 520px); padding: 0; overflow: hidden; border: 1px solid #d9dde2; border-radius: 14px; color: var(--navy); background: #fff; box-shadow: 0 24px 70px rgba(33, 45, 64, .22); }
.help-dialog::backdrop { background: rgba(33, 45, 64, .42); backdrop-filter: blur(2px); }
.application-info-dialog { width: min(calc(100% - 28px), 460px); }
.application-info-details { display: grid; gap: 10px; margin: 16px 0; }
.application-info-details p { display: grid; gap: 3px; margin: 0; }
.application-info-details strong { color: var(--navy); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
.dialog-header h2 { margin: 6px 0 0; font-size: 23.1px; }
.dialog-close { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; color: var(--ink-muted); background: transparent; font-size: 27.5px; line-height: 1; cursor: pointer; }
.dialog-close:hover { color: var(--navy); background: #f0f2f3; }
.dialog-close:focus-visible { outline: 3px solid rgba(214, 104, 83, .2); }
.help-section { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.help-section:last-child { border-bottom: 0; }
.help-section h3 { margin: 0 0 7px; color: var(--navy); font-size: 15.4px; }
.help-section p { margin: 0; overflow-wrap: anywhere; color: var(--ink-muted); font-size: 13.2px; line-height: 1.5; }
.help-section .help-note { margin-top: 9px; }
.help-board-links { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.help-board-links a { padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy); background: #fff; font-size: 11px; font-weight: 700; text-decoration: none; }
.help-board-links a:hover { border-color: var(--coral); color: var(--coral-dark); }
.contact-section { background: #fafaf9; }
.contact-section a { color: var(--coral-dark); font-weight: 700; }
.project-links { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; margin-top: 9px; }
.project-links p { display: flex; align-items: baseline; gap: 4px; }

@media (max-width: 560px) {
  body { padding: 10px 8px; }
  .wizard-header { padding: 17px 18px 0; border-radius: 12px; }
  .support-label { display: none; }
  .wizard-body { margin-top: 8px; padding: 20px 18px 18px; border-radius: 12px; }
  .instructions { grid-template-columns: 1fr; }
  .ready-panel { align-items: stretch; flex-direction: column; }
  .ready-panel .button { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .steps { align-items: flex-start; }
  .step-tab { flex: 1 1 0; }
  .step-tab strong { font-size: 14.3px; }
  .step-tab small { font-size: 11px; white-space: normal; }
  .step-number { width: 32px; height: 32px; }
  .step-line { width: 18px; margin: 16px 8px 0; }
  .step-actions { margin: 22px -18px -18px; padding: 13px 18px; }
  .connection-panel { align-items: stretch; flex-direction: column; }
  .connection-panel .button { width: 100%; }
  .connection-controls { align-items: stretch; flex-direction: column-reverse; }
  .connection-controls > .button { width: 100%; }
  .connection-connect-group { width: 100%; }
  .file-selection { justify-content: space-between; }
  .project-links { align-items: flex-start; flex-direction: column; }
}
