/* ── P2I — Pannello Anteprima (Preview) ─────────────────────────────────────
   Un pannello laterale, non un IDE: mostra l'applicazione del Workspace con
   il suo stato reale. Stile coerente con la lista CU (chip scuro, bordi
   sottili, hover sobrio) — §4j/§4k. */

.amp-lock { overflow: hidden; }

.amp-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(1, 4, 9, 0.62);
  backdrop-filter: blur(2px);
}
.amp-overlay.is-open { display: flex; }

.amp-panel {
  width: min(1180px, 88vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
  animation: amp-in 160ms ease-out;
}
@keyframes amp-in {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.amp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.amp-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.amp-id-text { min-width: 0; }

.amp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: #8a93a6;
  box-shadow: 0 0 0 3px rgba(138, 147, 166, 0.16);
}
.amp-dot-ready { background: #3fb950; box-shadow: 0 0 0 3px rgba(63, 185, 80, 0.16); }
.amp-dot-starting { background: #d29922; box-shadow: 0 0 0 3px rgba(210, 153, 34, 0.16); }
.amp-dot-failed { background: #f85149; box-shadow: 0 0 0 3px rgba(248, 81, 73, 0.16); }
.amp-dot-stopped { background: #8a93a6; }

.amp-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amp-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.amp-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.amp-actions .cu-filter-btn:disabled { opacity: 0.45; cursor: default; }
.amp-danger { color: #ff9a94; border-color: rgba(248, 81, 73, 0.4); }

.amp-body { position: relative; flex: 1 1 auto; min-height: 0; background: #0b0f16; }
.amp-frame { width: 100%; height: 100%; border: 0; background: #ffffff; }
.amp-frame:not([src]) { display: none; }

.amp-layer {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--bg-primary);
  overflow: auto;
}
.amp-layer.is-visible { display: flex; }

.amp-note {
  width: min(720px, 100%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  color: var(--text-primary);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.amp-note-bad { border-color: rgba(248, 81, 73, 0.35); }
.amp-note-title { font-size: 14px; font-weight: 600; }
.amp-note-sub { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.amp-note-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.amp-log {
  margin: 0;
  max-height: 260px;
  overflow: auto;
  padding: 12px;
  background: #0b0f16;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}

.amp-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.amp-input {
  background: #121826;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
}
.amp-input:focus { border-color: #58a6ff; }
.amp-input-bad { border-color: #f85149; }
.amp-primary { background: rgba(88, 166, 255, 0.16); border-color: rgba(88, 166, 255, 0.5); color: #cfe6ff; }

.amp-spin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(138, 147, 166, 0.3);
  border-top-color: #58a6ff;
  animation: amp-spin 700ms linear infinite;
}
@keyframes amp-spin { to { transform: rotate(360deg); } }

.amp-foot {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 11px;
}
