/**
 * T1 Profile Compile — modale edit condivisa (Hub + Galleria showcase).
 * Token gateway glass · z-index sopra Identity Hub (12100).
 */
.t1-pc-overlay {
  position: fixed;
  inset: 0;
  z-index: 12250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px))
    max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, #010308 58%, transparent);
  backdrop-filter: blur(8px) saturate(1.02);
  -webkit-backdrop-filter: blur(8px) saturate(1.02);
}

.t1-pc-overlay[hidden] {
  display: none !important;
}

.t1-pc-overlay__backdrop {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.t1-pc-modal {
  position: relative;
  z-index: 1;
  width: min(520px, 96vw);
  max-height: min(88vh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: clamp(22px, 3vw, 28px) clamp(20px, 3vw, 26px);
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 18%, rgba(255, 255, 255, 0.08));
  background: linear-gradient(160deg, rgba(12, 16, 24, 0.96) 0%, rgba(6, 8, 14, 0.98) 100%);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.6),
    0 0 40px color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 8%, transparent);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 35%, #2a3040) transparent;
}

.t1-pc-modal__title {
  font-family: var(--gw-font-tech, 'JetBrains Mono', monospace);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gw-text, rgba(248, 252, 255, 0.92));
  margin: 0 0 8px;
}

.t1-pc-modal__lead {
  font-family: var(--gw-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 0.86rem;
  color: var(--gw-text-dim, rgba(185, 205, 230, 0.72));
  line-height: 1.45;
  margin: 0 0 18px;
}

.t1-pc-modal__fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.t1-pc-modal__label {
  font-family: var(--gw-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 218, 240, 0.78);
}

.t1-pc-modal__req {
  color: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 80%, #fff);
}

.t1-pc-modal__input,
.t1-pc-modal__select,
.t1-pc-modal__textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--gw-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 0.92rem;
  color: rgba(248, 252, 255, 0.94);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
}

.t1-pc-modal__textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.t1-pc-modal__input:focus,
.t1-pc-modal__select:focus,
.t1-pc-modal__textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 42%, rgba(255, 255, 255, 0.12));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 18%, transparent);
}

.t1-pc-modal__tag-picker {
  margin-bottom: 4px;
}

.t1-pc-modal .t1-tag-picker-label {
  margin: 6px 0 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 218, 240, 0.78);
}

.t1-pc-modal .t1-tag-picker-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.t1-pc-modal .t1-tag-chip {
  font-size: 0.68rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 25%, transparent);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(185, 205, 230, 0.85);
  cursor: pointer;
}

.t1-pc-modal .t1-tag-chip.is-active {
  border-color: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 55%, transparent);
  color: #fff;
  background: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 18%, transparent);
}

.t1-pc-modal .t1-tag-picker-empty {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(185, 205, 230, 0.65);
}

.t1-pc-modal__status {
  margin: 12px 0 0;
  font-size: 0.82rem;
  color: rgba(185, 205, 230, 0.85);
}

.t1-pc-modal__status--error {
  color: #ff8a8a;
}

.t1-pc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.t1-pc-modal__btn {
  font-family: var(--gw-font-ui, 'Inter', system-ui, sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.55rem 1.1rem;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 32%, rgba(255, 255, 255, 0.1));
  background: color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 14%, rgba(255, 255, 255, 0.04));
  color: rgba(248, 252, 255, 0.95);
  cursor: pointer;
}

.t1-pc-modal__btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.t1-pc-modal__btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(200, 218, 240, 0.82);
}

.t1-pc-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 12300;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  font-size: 0.84rem;
  color: rgba(248, 252, 255, 0.95);
  background: rgba(8, 14, 22, 0.92);
  border: 1px solid color-mix(in srgb, var(--t1-cyan-gateway, #00e5ff) 28%, rgba(255, 255, 255, 0.08));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.t1-pc-toast--success {
  border-color: color-mix(in srgb, #5eead4 40%, rgba(255, 255, 255, 0.08));
}

@media (max-width: 420px) {
  .t1-pc-modal {
    max-height: 92vh;
  }
}
