/* Mobile/tablet ad carousel and its isolated admin editor. Desktop workspace layout stays unchanged. */
.nexora-mobile-ad { display: none; }

@media (max-width: 1180px), (max-width: 1366px) and (pointer: coarse) {
  .nexora-mobile-ad {
    display: block; position: relative; width: 100%; height: clamp(92px, 16vw, 128px);
    margin: 0 0 14px; overflow: hidden; border: 1px solid rgba(127,154,255,.3); border-radius: 12px;
    background: #091321; box-shadow: 0 10px 28px rgba(0,0,0,.18); isolation: isolate;
  }
  .nexora-mobile-ad[hidden] { display: none !important; }
  .nma-track, .nma-slide, .nma-slide img, .nma-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
  .nma-slide { opacity: 0; pointer-events: none; overflow: hidden; transition: opacity .5s ease, transform .5s ease; }
  .nma-slide.active { opacity: 1; pointer-events: auto; z-index: 2; }
  .nma-slide img { display: block; object-fit: cover; }
  .nma-shade { z-index: 1; background: linear-gradient(90deg, rgba(3,10,18,.88) 0%, rgba(3,10,18,.62) 42%, rgba(3,10,18,.08) 74%); }
  .nma-content { position: absolute; z-index: 2; left: clamp(14px, 4vw, 28px); top: 50%; max-width: 64%; transform: translateY(-50%); color: #f7fbff; }
  .nma-kicker { display: block; margin-bottom: 3px; color: #45ebc5; font-size: 9px; line-height: 1.2; font-weight: 800; letter-spacing: .12em; }
  .nma-content strong { display: block; font-size: clamp(16px, 3.4vw, 24px); line-height: 1.2; letter-spacing: 0; text-shadow: 0 2px 10px rgba(0,0,0,.3); }
  .nma-content small { display: block; margin-top: 5px; overflow: hidden; color: rgba(236,244,255,.76); font-size: clamp(10px, 1.8vw, 13px); line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
  .nma-link { position: absolute; inset: 0; z-index: 3; border: 0; background: transparent; cursor: pointer; }
  .nma-link:focus-visible { outline: 2px solid #23efba; outline-offset: -3px; }
  .nma-arrow { position: absolute; z-index: 5; top: 50%; width: 27px; height: 34px; display: grid; place-items: center; padding: 0; transform: translateY(-50%); border: 0; color: rgba(255,255,255,.82); background: rgba(3,9,18,.35); cursor: pointer; font-size: 21px; line-height: 1; }
  .nma-arrow:hover { color: #fff; background: rgba(3,9,18,.58); }
  .nma-prev { left: 0; border-radius: 0 8px 8px 0; }
  .nma-next { right: 0; border-radius: 8px 0 0 8px; }
  .nma-dots { position: absolute; z-index: 6; right: 11px; bottom: 8px; display: flex; gap: 5px; }
  .nma-dot { width: 5px; height: 5px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.42); cursor: pointer; transition: width .2s ease, border-radius .2s ease, background .2s ease; }
  .nma-dot.active { width: 16px; border-radius: 999px; background: #39e8c3; }
  .nexora-mobile-ad[data-effect="slide"] .nma-slide { opacity: 1; transform: translateX(105%); }
  .nexora-mobile-ad[data-effect="slide"] .nma-slide.active { transform: translateX(0); }
  .nexora-mobile-ad[data-effect="slide"] .nma-slide.outgoing { transform: translateX(-105%); z-index: 1; }
  .nexora-mobile-ad[data-effect="zoom"] .nma-slide.active img { animation: nma-zoom 5s ease-out both; }
  @keyframes nma-zoom { from { transform: scale(1.055); } to { transform: scale(1); } }

  /* The inspiration category block uses the same compact rhythm as the agent categories. */
  :root body .workspace .inspiration-page .gallery-toolbar { gap: 8px; padding: 9px 10px; }
  :root body .workspace .inspiration-page .gallery-filters { gap: 6px; margin: 0; }
  :root body .workspace .inspiration-page .gallery-filters button,
  :root body .workspace .inspiration-page .gallery-filters button:hover,
  :root body .workspace .inspiration-page .gallery-filters button.active {
    height: auto; min-height: 30px; padding: 4px 9px; border-radius: 999px; font-size: 11px; line-height: 1.25;
  }
}

@media (max-width: 420px) {
  .nexora-mobile-ad { height: 92px; border-radius: 10px; }
  .nma-content { left: 13px; max-width: 70%; }
  .nma-content strong { font-size: 16px; }
  .nma-content small { font-size: 10px; }
  .nma-arrow { display: none; }
  :root body .workspace .inspiration-page .gallery-toolbar { padding: 8px; }
  :root body .workspace .inspiration-page .gallery-filters { gap: 5px; }
  :root body .workspace .inspiration-page .gallery-filters button,
  :root body .workspace .inspiration-page .gallery-filters button:hover,
  :root body .workspace .inspiration-page .gallery-filters button.active { min-height: 29px; padding: 4px 8px; font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .nma-slide, .nma-dot { transition: none !important; }
  .nma-slide.active img { animation: none !important; }
}

/* Admin editor is namespaced so it cannot restyle existing admin pages. */
body.nma-admin-open .admin-main > *:not(#nma-admin-root) { display: none !important; }
.nma-admin-link {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border: 0; border-radius: 11px; color: var(--text-secondary); background: none;
  font: inherit; font-size: 13.5px; text-align: left; text-decoration: none; cursor: pointer;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.nma-admin-link .admin-item-icon { width: 17px; height: 17px; display: grid; place-items: center; font-size: 16px; line-height: 1; }
.nma-admin-link:hover { color: var(--text-primary); background: var(--bg-hover); transform: translateX(2px); }
.nma-admin-link.active { background: var(--color-primary-dim); color: var(--color-primary); font-weight: 700; }
#nma-admin-root { width: 100%; color: var(--text-primary); }
.nmaa-page { display: flex; flex-direction: column; gap: 16px; }
.nmaa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.nmaa-head h1 { margin: 0 0 5px; font-size: 24px; }
.nmaa-head p { margin: 0; color: var(--text-secondary); font-size: 13px; }
.nmaa-panel { padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-panel); }
.nmaa-settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: end; }
.nmaa-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.nmaa-field > span { color: var(--text-secondary); font-size: 12px; font-weight: 600; }
.nmaa-input, .nmaa-select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid var(--border-strong); border-radius: 7px; outline: none; color: var(--text-primary); background: var(--color-input-bg); font: inherit; font-size: 13px; }
.nmaa-input:focus, .nmaa-select:focus { border-color: var(--color-primary); }
.nmaa-check { min-height: 40px; display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: 13px; cursor: pointer; }
.nmaa-check input { width: 17px; height: 17px; accent-color: var(--color-primary); }
.nmaa-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.nmaa-list-head h2 { margin: 0; font-size: 17px; }
.nmaa-list-head span { color: var(--text-faint); font-size: 12px; }
.nmaa-list { display: flex; flex-direction: column; gap: 10px; }
.nmaa-item { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 14px; align-items: stretch; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card-glass); }
.nmaa-thumb { position: relative; min-height: 112px; overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-elevated); }
.nmaa-thumb img { display: block; width: 100%; height: 100%; min-height: 112px; object-fit: cover; }
.nmaa-thumb-empty { height: 100%; display: grid; place-items: center; color: var(--text-faint); font-size: 12px; }
.nmaa-upload { position: absolute; right: 7px; bottom: 7px; min-height: 31px; padding: 5px 9px; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; color: #fff; background: rgba(5,10,18,.78); cursor: pointer; font: inherit; font-size: 11px; }
.nmaa-upload:hover { border-color: #4de7c3; }
.nmaa-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.nmaa-field-wide { grid-column: 1 / -1; }
.nmaa-actions { display: flex; flex-direction: column; gap: 7px; justify-content: center; }
.nmaa-btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 13px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text-primary); background: var(--bg-hover); cursor: pointer; font: inherit; font-size: 12px; white-space: nowrap; }
.nmaa-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.nmaa-btn:disabled { opacity: .45; cursor: not-allowed; }
.nmaa-btn-primary { border-color: var(--color-primary); color: #021a14; background: var(--color-primary); font-weight: 700; }
.nmaa-btn-primary:hover { color: #021a14; filter: brightness(1.06); }
.nmaa-btn-danger:hover { border-color: #fb7185; color: #fb7185; }
.nmaa-footer { display: flex; justify-content: flex-end; gap: 10px; }
.nmaa-status { min-height: 20px; color: var(--text-secondary); font-size: 12px; }
.nmaa-status.error { color: #fb7185; }
.nmaa-preview { position: relative; height: 132px; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: #071521; }
.nmaa-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.nmaa-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(3,10,18,.86), rgba(3,10,18,.08)); }
.nmaa-preview-copy { position: absolute; z-index: 1; left: 22px; top: 50%; transform: translateY(-50%); color: #fff; }
.nmaa-preview-copy strong { display: block; font-size: 21px; }
.nmaa-preview-copy span { display: block; margin-top: 5px; color: rgba(255,255,255,.7); font-size: 12px; }

@media (max-width: 980px) {
  .nmaa-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nmaa-item { grid-template-columns: 160px minmax(0, 1fr); }
  .nmaa-actions { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; }
}
@media (max-width: 620px) {
  .nma-admin-link { width: auto; flex: 0 0 auto; gap: 8px; padding: 8px 10px; font-size: 12px; white-space: nowrap; }
  .nmaa-head { flex-direction: column; }
  .nmaa-settings, .nmaa-item, .nmaa-fields { grid-template-columns: minmax(0, 1fr); }
  .nmaa-field-wide, .nmaa-actions { grid-column: auto; }
  .nmaa-actions { flex-wrap: wrap; justify-content: flex-start; }
}
