/* Position note: this launcher coexists with the AcmeMega builder FAB stack
   (.amb2-gear at bottom:24px and .amb2-theme-fab at bottom:84px). We start
   above that stack at 144px so the three FABs read as a single column. The
   per-instance offset (+56px) is added inline via JS for the 2nd+ shell. */
.dm0e-launcher {
  position: fixed;
  right: 24px;
  bottom: 144px;
  z-index: 10020;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 14px;
  background: #0f172a;
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.dm0e-launcher:hover {
  transform: translateY(-1px);
  background: #1e293b;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.3);
}

.dm0e-launcher svg {
  width: 18px;
  height: 18px;
  display: block;
}

.dm0e-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10021;
  width: min(380px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #0f172a;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  box-shadow: -24px 0 48px rgba(15, 23, 42, 0.18);
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.dm0e-panel.dm0e-open {
  transform: translateX(0);
}

.dm0e-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.dm0e-chip {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
}

.dm0e-title {
  flex: 1;
  min-width: 0;
}

.dm0e-title strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.dm0e-title span {
  display: block;
  margin-top: 2px;
  color: #64748b;
  font-size: 11px;
}

.dm0e-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dm0e-close:hover {
  background: #e2e8f0;
}

.dm0e-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.dm0e-tabbtn {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.dm0e-tabbtn.dm0e-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.dm0e-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  background: #f8fafc;
}

.dm0e-tabpanel {
  display: none;
}

.dm0e-tabpanel.dm0e-active {
  display: block;
}

.dm0e-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 11px;
  line-height: 1.45;
}

.dm0e-presets {
  margin: 0 0 14px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 36%),
    linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.dm0e-presets-title {
  color: #0f172a;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.dm0e-presets-subtitle {
  margin-top: 4px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.5;
}

.dm0e-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.dm0e-preset {
  padding: 11px 12px;
  border: 1px solid #d8e2f2;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.dm0e-preset:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.1);
}

.dm0e-preset strong {
  display: block;
  font-size: 11px;
  font-weight: 800;
}

.dm0e-preset span {
  display: block;
  margin-top: 4px;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.dm0e-group {
  margin: 0 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  overflow: hidden;
}

.dm0e-group summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
}

.dm0e-group summary::-webkit-details-marker {
  display: none;
}

.dm0e-group summary::after {
  content: "▾";
  color: #64748b;
  font-size: 12px;
  transition: transform 160ms ease;
}

.dm0e-group[open] summary::after {
  transform: rotate(180deg);
}

.dm0e-group summary::after {
  content: "\25BE";
}

.dm0e-groupbody {
  padding: 0 14px 14px;
}

.dm0e-field {
  margin: 0 0 12px;
}

.dm0e-field:last-child {
  margin-bottom: 0;
}

.dm0e-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #334155;
  font-size: 11px;
  font-weight: 600;
}

.dm0e-value {
  color: #64748b;
  font-size: 10px;
  font-family: Consolas, Menlo, monospace;
}

.dm0e-range {
  width: 100%;
  accent-color: #2563eb;
}

.dm0e-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dm0e-input,
.dm0e-select,
.dm0e-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-size: 12px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.dm0e-input,
.dm0e-select {
  padding: 9px 11px;
}

.dm0e-textarea {
  min-height: 132px;
  padding: 10px 11px;
  font-family: Consolas, Menlo, monospace;
  line-height: 1.45;
  resize: vertical;
}

.dm0e-inline-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.dm0e-smallbtn {
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.dm0e-smallbtn:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

.dm0e-input:focus,
.dm0e-select:focus,
.dm0e-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.dm0e-color {
  width: 42px;
  height: 38px;
  padding: 3px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  flex: 0 0 auto;
}

.dm0e-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #ffffff;
}

.dm0e-status {
  flex: 1;
  min-width: 0;
  color: #64748b;
  font-size: 11px;
}

.dm0e-status.dm0e-ok {
  color: #047857;
}

.dm0e-status.dm0e-bad {
  color: #b91c1c;
}

.dm0e-actions {
  display: flex;
  gap: 8px;
}

.dm0e-btn {
  padding: 9px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.dm0e-btn:hover {
  background: #f8fafc;
}

.dm0e-btn.dm0e-primary {
  border-color: #1d4ed8;
  background: #2563eb;
  color: #ffffff;
}

.dm0e-btn.dm0e-primary:hover {
  background: #1d4ed8;
}

.dm0e-toast {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 10030;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  font-size: 12px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.24);
}

@media (max-width: 768px) {
  .dm0e-launcher {
    right: 14px;
    width: 38px;
    height: 38px;
  }

  .dm0e-panel {
    width: 100vw;
  }

  .dm0e-footer {
    flex-wrap: wrap;
  }

  .dm0e-actions {
    width: 100%;
  }

  .dm0e-btn {
    flex: 1;
  }

  .dm0e-preset-grid {
    grid-template-columns: 1fr;
  }

  .dm0e-inline-actions {
    flex-wrap: wrap;
  }

  .dm0e-smallbtn {
    flex: 1;
  }
}
