/* Plugin natif eden-mcu — console série Web Serial. Pattern calc. */

.mcu-float-window {
  position: fixed;
  display: flex;
  flex-direction: column;
  background: rgba(8, 14, 28, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--r-lg, 8px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 0 24px rgba(88, 200, 255, 0.18);
  overflow: hidden;
  font-family: var(--font-ui, ui-sans-serif, system-ui);
  color: var(--fg, #d8e0f0);
  animation: mcu-win-in 0.22s ease-out;
}
@keyframes mcu-win-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }
.mcu-float-window.mcu-maximized { border-radius: 0; box-shadow: none; }

.mcu-float-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  height: 32px; padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab; user-select: none; flex-shrink: 0;
}
.mcu-float-titlebar:active { cursor: grabbing; }
.mcu-float-titlebar-left { display: flex; align-items: center; gap: 8px; }
.mcu-float-title { margin-left: 8px; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; }

/* BODY : position:relative obligatoire (mémoire :
   addons/contenus avec position:absolute auraient inset:0 = toute la fenêtre sinon). */
.mcu-float-body {
  position: relative;
  flex: 1; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
  background: rgba(8, 14, 28, 0.85);
}

/* Toolbar haut */
.mcu-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}
.mcu-btn {
  background: rgba(111, 184, 255, 0.12);
  border: 1px solid rgba(111, 184, 255, 0.30);
  color: #d8e0f0;
  padding: 5px 12px; border-radius: 4px;
  cursor: pointer; font-size: 12px; font-family: inherit;
}
.mcu-btn:hover:not(:disabled) { background: rgba(111, 184, 255, 0.22); }
.mcu-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mcu-btn-primary {
  background: rgba(88, 200, 255, 0.22);
  border-color: rgba(88, 200, 255, 0.50);
}
.mcu-lbl { font-size: 11px; color: #8a96aa; display: inline-flex; align-items: center; gap: 4px; }
.mcu-sel {
  background: rgba(0, 0, 0, 0.30);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e0f0;
  padding: 4px 6px; border-radius: 3px;
  font-size: 11px; font-family: ui-monospace, monospace;
}
.mcu-status {
  margin-left: auto;
  font-size: 11px; color: #8a96aa;
  font-family: ui-monospace, monospace;
}
.mcu-status-ok { color: #6fb88a; }

/* Output area : terminal-like */
.mcu-output {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
  font-family: ui-monospace, "Cascadia Mono", "Fira Code", Menlo, monospace;
  font-size: 12px; line-height: 1.45;
  background: rgba(0, 0, 0, 0.40);
  color: #b8c4d4;
  white-space: pre-wrap; word-break: break-all;
}
.mcu-line { display: flex; gap: 8px; }
.mcu-line .mcu-ts { color: #4a5568; flex-shrink: 0; font-size: 10px; padding-top: 1px; }
.mcu-line-rx { color: #c8d3e3; }
.mcu-line-tx { color: #6fb8ff; }
.mcu-line-info { color: #8a96aa; font-style: italic; }
.mcu-line-err { color: #ff7585; }

/* Input bar bas */
.mcu-inputbar {
  display: flex; gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}
.mcu-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e0f0;
  padding: 6px 10px; border-radius: 4px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
}
.mcu-input:focus { outline: none; border-color: rgba(88, 200, 255, 0.5); }
.mcu-input:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Flash modal ──────────────────────────────────────────────── */
.mcu-modal-bg {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  animation: mcu-win-in 0.18s ease-out;
}
.mcu-modal {
  background: rgba(8, 14, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  min-width: 460px; max-width: 600px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
  color: #d8e0f0;
  font-family: var(--font-ui, ui-sans-serif, system-ui);
}
.mcu-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mcu-modal-title { font-size: 14px; font-weight: 500; color: #ff9a5a; }
.mcu-modal-close {
  background: transparent; border: none; color: #8a96aa;
  font-size: 22px; cursor: pointer; line-height: 1;
  width: 28px; height: 28px; border-radius: 4px;
}
.mcu-modal-close:hover { background: rgba(255, 255, 255, 0.06); color: #d8e0f0; }
.mcu-modal-body { padding: 18px; }
.mcu-modal-info {
  font-size: 12px; color: #8a96aa; margin: 0 0 14px 0;
  padding: 8px 10px;
  background: rgba(111, 184, 255, 0.08);
  border: 1px solid rgba(111, 184, 255, 0.18);
  border-radius: 4px;
}
.mcu-modal-lbl {
  display: block; font-size: 11px; color: #8a96aa;
  margin-bottom: 10px;
}
.mcu-modal-file, .mcu-modal-addr, .mcu-modal-baud {
  display: block; width: 100%; box-sizing: border-box;
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d8e0f0;
  padding: 7px 10px; border-radius: 4px;
  font-size: 13px;
  font-family: ui-monospace, monospace;
}
.mcu-modal-buttons {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 14px;
}

/* ── Progress bar ─────────────────────────────────────────────── */
.mcu-progress-wrap { margin: 12px 0 6px 0; }
.mcu-progress {
  height: 14px;
  background: rgba(0, 0, 0, 0.40);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 7px;
  overflow: hidden;
}
.mcu-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff9a5a, #ffc857);
  transition: width 0.15s ease-out;
}
.mcu-progress-text {
  text-align: center; margin-top: 6px;
  font-size: 12px; color: #b8c4d4;
  font-family: ui-monospace, monospace;
}
