:root {
  --bg-deep: #050811;
  --bg-surface: #0b1120;
  --bg-elevated: #111a2e;
  --bg-card-hover: #15213a;
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.26);
  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #8b9bb4;

  --cyan: #38bdf8;
  --cyan-bright: #0ea5e9;
  --cyan-glow: rgba(56, 189, 248, 0.22);

  --emerald: #10b981;
  --emerald-bright: #34d399;
  --emerald-glow: rgba(16, 185, 129, 0.22);

  --amber: #f59e0b;
  --orange: #ea580c;
  --amber-glow: rgba(245, 158, 11, 0.25);

  --purple: #a855f7;
  --red: #ef4444;

  --radius-xl: 20px;
  --radius-lg: 15px;
  --radius-md: 11px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  min-height: 100vh;
  padding: 22px 16px 64px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== AMBIENT TELEMETRY BACKGROUND ==================== */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-cyan {
  width: 560px;
  height: 420px;
  top: -160px;
  left: -100px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.18), transparent 70%);
}
.bg-glow-amber {
  width: 520px;
  height: 420px;
  top: 140px;
  right: -140px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.11), transparent 70%);
}
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(148, 163, 184, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at top, rgba(0, 0, 0, 0.85) 20%, transparent 80%);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
}

/* ==================== TOPBAR HEADER ==================== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 18px 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(11, 17, 32, 0.95) 100%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  margin-bottom: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-emblem {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(37, 99, 235, 0.32));
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--cyan);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.22);
  flex-shrink: 0;
}
.brand-emblem svg {
  width: 25px;
  height: 25px;
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.chip-official,
.chip-enc {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 999px;
}
.chip-official {
  background: rgba(56, 189, 248, 0.14);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
.chip-enc {
  background: rgba(16, 185, 129, 0.13);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.brand-title {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.text-gradient {
  background: linear-gradient(90deg, #38bdf8, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub {
  margin: 4px 0 0;
  font-size: 0.81rem;
  color: var(--text-muted);
}

/* USB Connection Status Pill */
.usb-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 9px 16px;
  border-radius: 14px;
  background: rgba(16, 185, 129, 0.11);
  border: 1px solid rgba(16, 185, 129, 0.42);
  transition: all 0.22s ease;
}
.usb-pill.offline {
  background: rgba(15, 23, 42, 0.78);
  border-color: var(--border-strong);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--emerald-bright);
  box-shadow: 0 0 10px var(--emerald-bright);
  flex-shrink: 0;
}
.usb-pill.offline .status-dot {
  background: #64748b;
  box-shadow: none;
}
.usb-pill-text {
  display: flex;
  flex-direction: column;
  line-height: 1.22;
}
.usb-pill-label {
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}
.usb-pill strong {
  font-size: 0.82rem;
  color: #a7f3d0;
}
.usb-pill.offline strong {
  color: var(--text-secondary);
}

/* ==================== JOURNEY STEPPER BAR ==================== */
.journey-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 20px;
  margin-bottom: 20px;
  border-radius: var(--radius-lg);
  background: rgba(11, 17, 32, 0.82);
  border: 1px solid var(--border-subtle);
}

.journey-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.52;
  transition: opacity 0.2s, transform 0.2s;
}
.journey-step.active,
.journey-step.done {
  opacity: 1;
}

.j-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
  font-weight: 800;
  background: #162033;
  border: 1.5px solid #334155;
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all 0.22s ease;
}
.journey-step.active .j-icon {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}
.journey-step.done .j-icon {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--emerald-bright);
  color: var(--emerald-bright);
}

.j-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}
.j-title {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-main);
}
.journey-line {
  flex: 1;
  height: 2px;
  background: #1e293b;
  border-radius: 2px;
  transition: background 0.25s ease;
}
.journey-line.done {
  background: linear-gradient(90deg, var(--emerald-bright), var(--cyan));
}

@media (max-width: 720px) {
  .j-label { display: none; }
  .j-title { font-size: 0.75rem; }
  .journey-bar { padding: 10px 12px; }
}

/* ==================== MAIN WORKSPACE 2-COLUMN GRID ==================== */
.workspace-grid {
  display: grid;
  grid-template-columns: 1.16fr 0.84fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 960px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.sticky-stack {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==================== PANELS ==================== */
.panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.94) 0%, rgba(11, 17, 32, 0.96) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  transition: border-color 0.22s ease, box-shadow 0.22s ease;
}
.panel.panel-active {
  border-color: rgba(56, 189, 248, 0.36);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(56, 189, 248, 0.12);
}
.panel-compact {
  padding: 16px 18px;
  margin-bottom: 0;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 16px;
}
.step-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #7dd3fc;
  font-weight: 900;
  font-size: 0.84rem;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.panel-title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}
.panel-desc {
  margin: 3px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ==================== STEP 1: VOUCHER BOX & LICENSE PASS ==================== */
.voucher-box {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.voucher-input-wrap {
  flex: 1;
  min-width: 240px;
  display: flex;
  align-items: center;
  background: #060a14;
  border: 1.5px solid #29384f;
  border-radius: 12px;
  padding: 4px 6px 4px 12px;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.voucher-input-wrap:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}
.input-prefix-icon {
  color: #64748b;
  display: flex;
  align-items: center;
  margin-right: 8px;
}
#voucherInput {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  padding: 9px 4px;
  outline: none;
  min-width: 0;
}
#voucherInput::placeholder {
  color: #475569;
  font-weight: 600;
  letter-spacing: 1px;
}

.btn-icon-inline {
  background: transparent;
  color: #64748b;
  border: none;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 0.85rem;
  cursor: pointer;
}
.btn-icon-inline:hover {
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
}
.btn-paste-inline {
  background: #162238;
  color: #93c5fd;
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-paste-inline:hover {
  background: #1e2f4d;
}

button {
  font-family: inherit;
}
button:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.btn-validate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
  transition: transform 0.12s, filter 0.15s;
}
.btn-validate:hover:not(:disabled) {
  filter: brightness(1.08);
}
.btn-validate:active:not(:disabled) {
  transform: scale(0.98);
}

/* Voucher License Pass Result */
.voucher-pass {
  display: none;
  margin-top: 14px;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.84rem;
  line-height: 1.5;
}
.voucher-pass.ok {
  display: block;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.13) 0%, rgba(14, 165, 233, 0.09) 100%);
  border: 1px solid rgba(16, 185, 129, 0.42);
  color: #d1fae5;
}
.voucher-pass.err {
  display: block;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.42);
  color: #fecaca;
}
.pass-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pass-tier {
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
}
.pass-sub {
  font-size: 0.79rem;
  color: #a7f3d0;
  margin-top: 2px;
}
.pass-quota-pill {
  background: rgba(6, 10, 20, 0.65);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 6px 12px;
  border-radius: 10px;
  text-align: right;
}
.pass-quota-pill span {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 700;
}
.pass-quota-pill strong {
  font-size: 0.88rem;
  color: #34d399;
}

.alert-banner {
  padding: 13px 16px;
  border-radius: 13px;
  margin-bottom: 18px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.alert-err {
  background: rgba(239, 68, 68, 0.13);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fecaca;
}

/* ==================== STEP 2: EDITION CARDS & MODE STACK ==================== */
.sub-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sub-label {
  font-size: 0.81rem;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}
.sub-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.edition-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 600px) {
  .edition-grid {
    grid-template-columns: 1fr;
  }
}

.ed-card {
  background: var(--bg-elevated);
  border: 1.5px solid #22314a;
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  transition: all 0.17s ease;
  position: relative;
  outline: none;
}
.ed-card:hover:not(.locked),
.ed-card:focus-visible:not(.locked) {
  border-color: #475569;
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}
.ed-card.active {
  border-color: var(--cyan);
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.13), rgba(17, 26, 46, 0.95));
  box-shadow: 0 0 0 1px var(--cyan), 0 8px 20px rgba(14, 165, 233, 0.15);
}
.ed-card.locked {
  opacity: 0.48;
  cursor: not-allowed;
}
.ed-card-sultan {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.2), rgba(17, 26, 46, 0.95));
  border-color: rgba(168, 85, 247, 0.32);
}
.ed-card-sultan.active {
  border-color: #c084fc;
  box-shadow: 0 0 0 1px #c084fc, 0 8px 22px rgba(168, 85, 247, 0.22);
}

.ed-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ed-pill {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
}
.pill-cyan { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; }
.pill-red { background: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.pill-emerald { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.pill-slate { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.pill-purple { background: rgba(168, 85, 247, 0.22); color: #e9d5ff; }

.ed-lock-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #d8b4fe;
  margin-left: auto;
  margin-right: 4px;
}
.ed-card-sultan:not(.locked) .ed-lock-tag {
  display: none;
}

.ed-check {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid #475569;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.ed-card.active .ed-check {
  background: var(--cyan);
  border-color: var(--cyan);
}
.ed-card.active .ed-check::after {
  content: '✓';
  font-size: 0.68rem;
  font-weight: 900;
  color: #04111f;
}
.ed-card-sultan.active .ed-check {
  background: #c084fc;
  border-color: #c084fc;
}

.ed-name {
  font-size: 0.93rem;
  font-weight: 800;
  margin-bottom: 3px;
}
.ed-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.38;
}

/* Sultan Studio Box */
.sultan-studio {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(15, 23, 42, 0.9));
  border: 1px solid rgba(192, 132, 252, 0.45);
}
.sultan-studio-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sultan-badge-icon {
  font-size: 1.3rem;
}
.sultan-title {
  font-size: 0.86rem;
  font-weight: 800;
  color: #f3e8ff;
}
.sultan-sub {
  font-size: 0.74rem;
  color: #d8b4fe;
}
.sultan-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .sultan-inputs { grid-template-columns: 1fr; }
}
.field-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  color: #e9d5ff;
  margin-bottom: 5px;
}
.char-counter {
  font-family: 'Consolas', monospace;
  color: #c084fc;
}
.field-group input[type="text"] {
  width: 100%;
  background: #070b16;
  border: 1.5px solid rgba(168, 85, 247, 0.4);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'Consolas', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
}
.field-group input[type="text"]:focus {
  border-color: #e879f9;
}

.divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 18px 0 15px;
}

/* Preset Mode Cards */
.mode-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mode-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #0a1222;
  border: 1.5px solid #22314a;
  border-radius: 14px;
  padding: 13px 15px;
  cursor: pointer;
  transition: all 0.17s ease;
  outline: none;
}
.mode-card:hover:not(.locked),
.mode-card:focus-visible:not(.locked) {
  border-color: #475569;
  background: #0f1a30;
}
.mode-card.active {
  border-color: var(--emerald-bright);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(10, 18, 34, 0.96));
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.5);
}
.mode-card.locked {
  opacity: 0.42;
  cursor: not-allowed;
}

.mode-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #475569;
  margin-top: 2px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}
.mode-card.active .mode-radio {
  border-color: var(--emerald-bright);
}
.mode-card.active .mode-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald-bright);
}

.mode-content {
  flex: 1;
  min-width: 0;
}
.mode-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mode-title {
  font-size: 0.9rem;
  font-weight: 800;
}
.text-cyan { color: #38bdf8; }
.text-emerald { color: #34d399; }
.text-amber { color: #fbbf24; }

.mode-rec-badge {
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}
.mode-sub-badge {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.13);
  color: var(--text-secondary);
}
.mode-desc {
  margin: 4px 0 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.42;
}
.spec-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.spec-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #26354d;
  color: #cbd5e1;
  font-family: 'Consolas', monospace;
}
.highlight-cyan { border-color: rgba(56, 189, 248, 0.45); color: #7dd3fc; }
.highlight-emerald { border-color: rgba(52, 211, 153, 0.45); color: #6ee7b7; }
.highlight-amber { border-color: rgba(251, 191, 36, 0.45); color: #fde68a; }

/* ==================== STEP 3: PREFLIGHT, USB & FLASH PIPELINE ==================== */
.preflight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 680px) {
  .preflight-grid { grid-template-columns: 1fr; }
}
.pf-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(6, 10, 20, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 9px 11px;
}
.pf-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.16);
  color: var(--cyan);
  font-size: 0.68rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.pf-item strong {
  display: block;
  font-size: 0.76rem;
  color: var(--text-main);
}
.pf-item span {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.32;
  margin-top: 2px;
}

.hw-Action-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid rgba(20, 184, 166, 0.45);
  background: linear-gradient(135deg, #0f766e, #059669);
  color: #fff;
  font-weight: 800;
  font-size: 0.93rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(5, 150, 105, 0.25);
  transition: filter 0.15s, transform 0.12s;
}
.btn-connect.connected {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  box-shadow: none;
}
.btn-connect:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-flash {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 55%, #dc2626 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.38);
  transition: transform 0.12s, filter 0.15s, box-shadow 0.2s;
}
.btn-flash:not(:disabled) {
  animation: pulseReady 2.4s infinite;
}
.btn-flash:hover:not(:disabled) {
  filter: brightness(1.08);
}
@keyframes pulseReady {
  0%, 100% { box-shadow: 0 10px 28px rgba(234, 88, 12, 0.38); }
  50% { box-shadow: 0 10px 36px rgba(245, 158, 11, 0.62); }
}

.flash-telemetry-box {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: 13px;
  background: #060a14;
  border: 1px solid #1e293b;
}
.pipeline-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.pipe-chip {
  font-size: 0.67rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #0f172a;
  border: 1px solid #1e293b;
  color: #64748b;
  transition: all 0.2s;
}
.pipe-chip.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: var(--cyan);
  color: #bae6fd;
}
.pipe-chip.done {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.prog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.prog-txt {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.prog-pct {
  font-family: 'Consolas', monospace;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--cyan);
}
.prog-track {
  height: 13px;
  border-radius: 999px;
  background: #0d1526;
  border: 1px solid #1e293b;
  overflow: hidden;
}
.prog-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0ea5e9, #10b981, #f59e0b);
  background-size: 200% 100%;
  animation: progShimmer 2.2s linear infinite;
  transition: width 0.2s ease;
}
@keyframes progShimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ==================== FAQ ACCORDION ==================== */
.panel-faq {
  padding: 18px 22px;
  margin-bottom: 0;
}
.faq-head h3 {
  margin: 0 0 10px;
  font-size: 0.94rem;
  font-weight: 800;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-item {
  background: rgba(6, 10, 20, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 10px 13px;
}
.faq-item summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: '+';
  font-weight: 900;
  color: var(--cyan);
  font-size: 1rem;
}
.faq-item[open] summary::after {
  content: '−';
}
.faq-item p {
  margin: 8px 0 2px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.faq-item code {
  background: #111c33;
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
}

/* ==================== RIGHT COLUMN: REALISTIC SKYRC CHASSIS ==================== */
.hw-chassis {
  background: linear-gradient(165deg, #161f33 0%, #0b111e 60%, #090d18 100%);
  border: 2px solid #2b3954;
  border-radius: 22px;
  padding: 16px;
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.08);
}

.hw-chassis-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.hw-model-brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hw-skyrc {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  color: #e2e8f0;
}
.hw-nc {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
}
.hw-nc em {
  color: var(--cyan);
  font-style: normal;
  font-weight: 800;
}

.hw-top-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.hw-ed-tag {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
}
.btn-lcd-tint {
  background: #1a253b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-lcd-tint:hover {
  background: #253452;
}

.hw-slot-leds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.slot-pair-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 8px;
  background: #080d18;
  border: 1px solid #1e293b;
  font-size: 0.66rem;
  font-weight: 800;
  color: #94a3b8;
}
.led-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.led-on { background: #34d399; box-shadow: 0 0 6px #34d399; }
.led-cyan { background: #38bdf8; box-shadow: 0 0 6px #38bdf8; }
.led-amber { background: #fbbf24; box-shadow: 0 0 6px #fbbf24; }

.hw-lcd-housing {
  background: #060912;
  border: 1.5px solid #223049;
  border-radius: 15px;
  padding: 13px;
  text-align: center;
}
.lcd-section-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #7c8da6;
  margin-bottom: 6px;
}
.sim-live-pill {
  color: #34d399;
}

.boot-canvas-bezel {
  display: inline-flex;
  padding: 6px;
  border-radius: 10px;
  background: #0e1626;
  border: 2px solid #26354d;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7);
}
canvas#bootLogoCanvas {
  width: 268px;
  height: 134px;
  image-rendering: pixelated;
  border-radius: 5px;
  background: #cfe4f7;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
}

.lcd-text-sim {
  margin: 0 auto;
  background: #c8d9ca;
  color: #132217;
  border-radius: 8px;
  padding: 9px 11px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: left;
  line-height: 1.36;
  border: 3px solid #263545;
  width: 100%;
  max-width: 284px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
  user-select: none;
}
.hw-lcd-housing.theme-ice .lcd-text-sim {
  background: #cfe4f7;
  color: #0f2557;
}

.hw-controls-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 11px;
}
.hw-btn {
  background: #172236;
  color: #dbeafe;
  border: 1px solid #2e405e;
  border-radius: 8px;
  padding: 7px 6px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s, transform 0.08s;
}
.hw-btn:hover {
  background: #21314d;
}
.hw-btn:active {
  transform: scale(0.96);
}
.hw-btn-enter {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border-color: #38bdf8;
  color: #fff;
}
.hw-btn-back {
  background: #1e293b;
  color: #cbd5e1;
}

/* ==================== ACTIVE PRESET SPEC MATRIX & LOGS ==================== */
.compact-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.compact-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}
.mode-mini-chip {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
  margin-bottom: 10px;
}
.tel-cell {
  background: #070c18;
  border: 1px solid #1c2940;
  border-radius: 9px;
  padding: 7px 10px;
}
.tel-lbl {
  display: block;
  font-size: 0.66rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}
.tel-val {
  display: block;
  font-size: 0.78rem;
  color: #e2e8f0;
  font-family: 'Consolas', monospace;
  margin-top: 2px;
}

.feature-list {
  margin: 0;
  padding-left: 17px;
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.56;
}
.feature-list li {
  margin-bottom: 4px;
}
.feature-list code {
  background: #0d172a;
  padding: 1px 5px;
  border-radius: 4px;
  color: #7dd3fc;
}

.console-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.btn-mini-ghost,
.btn-mini-warn {
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-mini-ghost {
  background: #162033;
  color: #cbd5e1;
  border: 1px solid #2c3d59;
}
.btn-mini-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.38);
}

.log-box {
  background: #04070f;
  border: 1px solid #1a253a;
  border-radius: 10px;
  padding: 9px 11px;
  height: 138px;
  overflow-y: auto;
  font-family: 'Consolas', monospace;
  font-size: 0.73rem;
  color: #94a3b8;
  line-height: 1.5;
}
.log-ok { color: #34d399; }
.log-warn { color: #fbbf24; }
.log-err { color: #f87171; }

/* ==================== FOOTER ==================== */
.portal-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.6;
}
.portal-footer code {
  color: #94a3b8;
}
.footer-sub {
  font-size: 0.71rem;
  color: #475569;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.42;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  animation: toastIn 0.2s ease;
}
.toast-item.toast-warn { border-color: rgba(245, 158, 11, 0.55); color: #fef3c7; }
.toast-item.toast-ok { border-color: rgba(16, 185, 129, 0.55); color: #d1fae5; }
.toast-item.toast-err { border-color: rgba(239, 68, 68, 0.55); color: #fee2e2; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== CUSTOM ACCESSIBLE MODAL ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 14, 0.78);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, #111b30 0%, #0b1222 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.65);
  animation: modalPop 0.18s ease;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin-bottom: 12px;
}
.modal-title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 800;
}
.modal-body {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 18px;
}
.modal-summary-box {
  background: #070c18;
  border: 1px solid #1e293b;
  border-radius: 11px;
  padding: 10px 12px;
  margin: 10px 0;
  font-size: 0.8rem;
}
.modal-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.modal-summary-row span { color: var(--text-muted); }
.modal-summary-row strong { color: #f8fafc; font-family: 'Consolas', monospace; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.btn-modal-cancel {
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.84rem;
  cursor: pointer;
}
.btn-modal-confirm {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}
