/* =========================================================================
   Nexus — Digital Assets panel (P3)
   Tokens only: --nx-* from theme.css. No hardcoded colours.
   ========================================================================= */

.nx-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--nx-border);
  padding-bottom: 0.45rem;
  margin-bottom: 0.85rem;
}

.nx-pane-header .nx-pane-title {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.nx-add-btn {
  background: transparent;
  border: 1px solid var(--nx-blue);
  color: var(--nx-blue);
  font-family: var(--nx-font-head);
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 0.35rem 0.85rem;
  min-height: 36px;
  min-width: 36px;
  cursor: pointer;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

.nx-add-btn:hover,
.nx-add-btn:focus {
  color: var(--nx-blue-bright);
  border-color: var(--nx-blue-bright);
  box-shadow: 0 0 10px var(--nx-glow);
  outline: none;
}

.nx-add-btn:active {
  box-shadow: 0 0 14px var(--nx-glow-strong);
}

.nx-digital-error {
  color: var(--nx-danger);
  font-family: var(--nx-font-mono);
  font-size: 0.85rem;
  margin: 0.5rem 0 0.75rem;
}

.nx-digital-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.nx-digital-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 120px;
  padding: 1.1rem 0.7rem 0.85rem;
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  cursor: pointer;
  text-align: center;
}

.nx-digital-card:hover {
  border-color: var(--nx-blue);
  box-shadow: 0 0 10px var(--nx-glow);
}

.nx-digital-card:active,
.nx-digital-card.is-active,
.nx-digital-card:focus {
  outline: none;
  border-color: var(--nx-blue-bright);
  box-shadow: 0 0 14px var(--nx-glow-strong);
}

.nx-digital-logo {
  max-width: 64px;
  max-height: 64px;
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  pointer-events: none;
}

.nx-digital-logo-ph {
  width: 64px;
  height: 64px;
  border: 1px solid var(--nx-blue-dim);
  color: var(--nx-blue-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--nx-font-head);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nx-digital-name {
  font-family: var(--nx-font-head);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nx-blue);
  word-break: break-word;
  line-height: 1.3;
}

.nx-digital-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 4px;
  opacity: 0;
  z-index: 2;
}

.nx-digital-card:hover .nx-digital-actions,
.nx-digital-card:focus-within .nx-digital-actions {
  opacity: 1;
}

.nx-digital-action {
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  color: var(--nx-text-dim);
  font-family: var(--nx-font-head);
  font-weight: 700;
  font-size: 0.55rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 36px;
  min-height: 36px;
  padding: 0 0.3rem;
  cursor: pointer;
}

.nx-digital-action:hover,
.nx-digital-action:focus {
  color: var(--nx-blue-bright);
  border-color: var(--nx-blue);
  outline: none;
}

.nx-digital-action.is-danger {
  color: var(--nx-danger);
  border-color: var(--nx-border);
}

.nx-digital-action.is-danger:hover,
.nx-digital-action.is-danger:focus {
  color: var(--nx-danger);
  border-color: var(--nx-danger);
}

.nx-digital-empty .nx-add-btn {
  margin-top: 0.5rem;
}

/* -------------------------------------------------------------------------
   Modal — overlay + form card
   ------------------------------------------------------------------------- */

.nx-digital-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: color-mix(in srgb, var(--nx-bg) 82%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.nx-digital-modal[hidden] {
  display: none !important;
}

.nx-digital-modal-card {
  background: var(--nx-bg);
  border: 1px solid var(--nx-blue);
  box-shadow: 0 0 24px var(--nx-glow);
  width: min(440px, 90vw);
  max-width: 90vw;
  max-height: 86vh;
  overflow: auto;
  padding: 1.4rem 1.3rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.nx-digital-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.nx-digital-modal-head .nx-h3 {
  color: var(--nx-blue);
  text-shadow: 0 0 8px var(--nx-glow);
  font-size: 0.95rem;
}

.nx-digital-modal-x {
  background: transparent;
  border: 1px solid var(--nx-border);
  color: var(--nx-text-dim);
  font-size: 1.2rem;
  line-height: 1;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
}

.nx-digital-modal-x:hover,
.nx-digital-modal-x:focus {
  color: var(--nx-blue-bright);
  border-color: var(--nx-blue);
  outline: none;
}

.nx-digital-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.nx-digital-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nx-digital-label {
  font-family: var(--nx-font-head);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--nx-text-dim);
}

.nx-digital-form input[type='text'],
.nx-digital-form input[type='file'] {
  min-height: 36px;
  width: 100%;
  background: var(--nx-input-bg);
  color: var(--nx-blue);
  border: 1px solid var(--nx-border);
}

.nx-digital-preview {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--nx-text-dim);
  font-size: 0.78rem;
}

.nx-digital-preview img {
  max-width: 48px;
  max-height: 48px;
  object-fit: contain;
  border: 1px solid var(--nx-border);
  background: var(--nx-bg);
}

.nx-digital-modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 0.25rem;
}

.nx-digital-hint {
  color: var(--nx-text-dim);
  font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
   Mobile ≤480px — 2 columns, always-visible actions, 36px targets
   ------------------------------------------------------------------------- */

@media (max-width: 480px) {
  .nx-digital-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .nx-digital-card {
    min-height: 100px;
    padding: 0.7rem 0.45rem 0.6rem;
  }

  .nx-digital-logo,
  .nx-digital-logo-ph {
    width: 48px;
    height: 48px;
    max-width: 48px;
    max-height: 48px;
    font-size: 0.5rem;
  }

  .nx-digital-name {
    font-size: 0.62rem;
  }

  .nx-digital-actions {
    opacity: 1;
  }

  .nx-digital-action,
  .nx-add-btn,
  .nx-digital-modal-x,
  .nx-digital-form input {
    min-height: 36px;
    min-width: 36px;
  }

  .nx-pane-header {
    gap: 0.45rem;
    min-width: 0;
  }

  .nx-pane-title,
  .nx-digital-name {
    min-width: 0;
  }

  .nx-add-btn {
    font-size: 0.68rem;
    padding: 0.35rem 0.55rem;
  }

  .nx-digital-modal {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .nx-digital-modal-card {
    width: 100%;
    max-width: 90vw;
    max-height: 92vh;
  }
}
