/*!
 * New Cloud 4 Name Combiner — namespaced styles
 * All selectors scoped under .nc4-wrapper; no !important.
 */
.nc4-wrapper,
.nc4-wrapper * { box-sizing: border-box; }
.nc4-wrapper {
  --nc4-primary: #e74c8b;
  --nc4-primary-dark: #c4357a;
  --nc4-secondary: #8b5cf6;
  --nc4-bg: #fff5f7;
  --nc4-card: #ffffff;
  --nc4-text: #1a1a2e;
  --nc4-text-soft: #5a5a6e;
  --nc4-muted: #9a9aae;
  --nc4-border: #f1d6e0;
  --nc4-success: #22c55e;
  --nc4-shadow: 0 2px 8px rgba(0,0,0,0.08);
  --nc4-shadow-lg: 0 8px 28px rgba(231,76,139,0.18);

  position: relative;
  max-width: 760px;
  margin: 1.5rem auto;
  padding: 1.25rem 1rem 2rem;
  background: var(--nc4-bg);
  color: var(--nc4-text);
  border-radius: 18px;
  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
.nc4-wrapper button,
.nc4-wrapper input,
.nc4-wrapper select { font: inherit; color: inherit; }
.nc4-wrapper button { cursor: pointer; border: 0; background: transparent; padding: 0; }

/* ---------- Header ---------- */
.nc4-header { text-align: center; margin-bottom: 1rem; }
.nc4-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.25rem;
  letter-spacing: -0.01em;
}
.nc4-title .nc4-heart {
  color: var(--nc4-primary);
  display: inline-block;
  animation: nc4-heartbeat 1.6s ease-in-out infinite;
}
.nc4-subtitle { margin: 0; font-size: 0.9rem; color: var(--nc4-text-soft); }
.nc4-welcome {
  margin: 0.75rem auto 0;
  display: none;
  background: #fff;
  border: 1px solid var(--nc4-border);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--nc4-text-soft);
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--nc4-shadow);
  max-width: max-content;
}
.nc4-welcome.nc4-show { display: inline-flex; }
.nc4-welcome button { color: var(--nc4-primary); font-weight: 700; text-decoration: underline; }

/* ---------- Inputs (2x2 mobile, 4 wide ≥640px) ---------- */
.nc4-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}
.nc4-input-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.nc4-input-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--nc4-text-soft);
  padding-left: 0.2rem;
}
.nc4-input {
  width: 100%;
  min-height: 50px;
  padding: 0.7rem 0.85rem;
  font-size: 18px;
  font-weight: 600;
  background: var(--nc4-card);
  border: 1.5px solid var(--nc4-border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.nc4-input::placeholder { color: var(--nc4-muted); font-weight: 500; }
.nc4-input:focus {
  border-color: var(--nc4-primary);
  box-shadow: 0 0 0 3px rgba(231,76,139,0.15);
}
.nc4-inputs-tools {
  display: flex;
  gap: 0.5rem;
  margin: -0.3rem 0 0.9rem;
  font-size: 0.84rem;
}
.nc4-inputs-tools button {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--nc4-border);
  color: var(--nc4-text-soft);
  font-weight: 600;
}
.nc4-inputs-tools button:hover {
  background: #fff0f4;
  color: var(--nc4-primary);
  border-color: var(--nc4-primary);
}

/* ---------- Filter chips + sort ---------- */
.nc4-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}
.nc4-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--nc4-border);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--nc4-text-soft);
}
.nc4-chip.nc4-on {
  background: var(--nc4-primary);
  border-color: var(--nc4-primary);
  color: #fff;
}
.nc4-sort {
  margin-left: auto;
  background: #fff;
  border: 1.5px solid var(--nc4-border);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-size: 0.84rem;
  color: var(--nc4-text);
  font-weight: 600;
}

/* ---------- Generate ---------- */
.nc4-generate {
  width: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, var(--nc4-primary) 0%, #ff7aa8 100%);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 24px;
  box-shadow: var(--nc4-shadow-lg);
  transition: transform 0.15s ease, opacity 0.18s ease;
  animation: nc4-pulse 2.4s ease-in-out 2;
}
.nc4-generate:hover:not(:disabled) { transform: translateY(-1px); }
.nc4-generate:active:not(:disabled) { transform: translateY(1px); }
.nc4-generate:disabled { opacity: 0.55; cursor: not-allowed; animation: none; box-shadow: none; }

@keyframes nc4-pulse {
  0%,100% { box-shadow: 0 8px 28px rgba(231,76,139,0.18); }
  50% { box-shadow: 0 8px 28px rgba(231,76,139,0.45), 0 0 0 6px rgba(231,76,139,0.08); }
}
@keyframes nc4-heartbeat {
  0%,100% { transform: scale(1); }
  20% { transform: scale(1.18); }
  40% { transform: scale(0.95); }
  60% { transform: scale(1.1); }
}

/* ---------- Stats ---------- */
.nc4-stats {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.9rem 0 0.4rem;
  padding: 0.55rem 0.85rem;
  background: #fff;
  border: 1px solid var(--nc4-border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--nc4-text-soft);
}
.nc4-stats strong { color: var(--nc4-primary); font-weight: 800; }

/* ---------- Compatibility / interpretation / tip ---------- */
.nc4-compat {
  display: none;
  background: #fff;
  border: 1px solid var(--nc4-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin: 0.5rem 0;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--nc4-shadow);
}
.nc4-compat.nc4-show { display: flex; }
.nc4-compat-ring {
  --p: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex: 0 0 72px;
  background: conic-gradient(var(--nc4-primary) calc(var(--p) * 1%), #ffe1ec 0);
  display: grid;
  place-items: center;
  position: relative;
}
.nc4-compat-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: #fff;
  border-radius: 50%;
}
.nc4-compat-pct {
  position: relative;
  z-index: 1;
  font-weight: 800;
  color: var(--nc4-primary);
}
.nc4-compat-body { flex: 1; min-width: 0; }
.nc4-compat-title { font-weight: 700; font-size: 0.95rem; margin: 0 0 0.15rem; }
.nc4-compat-sub { margin: 0; font-size: 0.82rem; color: var(--nc4-text-soft); }

.nc4-interp {
  display: none;
  background: #fff;
  border: 1px solid var(--nc4-border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: var(--nc4-shadow);
  margin-bottom: 0.4rem;
}
.nc4-interp.nc4-show { display: block; animation: nc4-fade-in 0.4s ease both; }
.nc4-interp-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--nc4-primary);
}
.nc4-interp-head { margin: 0 0 0.35rem; font-weight: 700; font-size: 0.98rem; line-height: 1.35; }
.nc4-interp-body { margin: 0 0 0.3rem; font-size: 0.86rem; color: var(--nc4-text-soft); line-height: 1.5; }
.nc4-interp-closer { margin: 0; font-size: 0.85rem; font-style: italic; }

.nc4-tip {
  display: none;
  background: #fff;
  border: 1px dashed var(--nc4-border);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  color: var(--nc4-text-soft);
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.nc4-tip.nc4-show { display: flex; }
.nc4-tip strong { color: var(--nc4-text); }

/* ---------- Results header ---------- */
.nc4-results-header {
  display: none;
  justify-content: space-between;
  align-items: center;
  margin: 0.6rem 0 0.2rem;
}
.nc4-results-header.nc4-show { display: flex; }
.nc4-results-header h3 { margin: 0; font-size: 1rem; font-weight: 800; }
.nc4-regen {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--nc4-primary);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--nc4-border);
}
.nc4-regen:hover { background: #fff0f4; }

/* ---------- Result cards ---------- */
.nc4-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}
.nc4-card {
  background: var(--nc4-card);
  border-radius: 12px;
  padding: 0.8rem 0.85rem;
  box-shadow: var(--nc4-shadow);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #fff0f4;
  animation: nc4-fade-in 0.35s ease both;
  position: relative;
}
.nc4-card.nc4-best {
  border: 1.5px solid var(--nc4-primary);
  background: linear-gradient(180deg, #fff 0%, #fff5f8 100%);
}
.nc4-best-ribbon {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--nc4-primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}
.nc4-card-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--nc4-text);
  word-break: break-word;
}
.nc4-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  font-size: 0.78rem;
  color: var(--nc4-text-soft);
  grid-column: 1 / -1;
  margin-top: -0.1rem;
}
.nc4-hearts { color: var(--nc4-primary); letter-spacing: 0.05em; }
.nc4-sources {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}
.nc4-src {
  background: #fff0f4;
  color: var(--nc4-primary-dark);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  font-weight: 600;
  font-size: 0.72rem;
}
.nc4-src.nc4-src-2 { background: #efe7ff; color: #5a3fc4; }
.nc4-src.nc4-src-3 { background: #ffe9d6; color: #b86528; }
.nc4-src.nc4-src-4 { background: #def7e1; color: #1f7a3d; }

.nc4-card-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.nc4-icon-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 10px;
  background: #faf2f5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--nc4-text-soft);
  transition: background 0.18s ease, transform 0.12s ease, color 0.18s ease;
}
.nc4-icon-btn:hover { background: #ffe1ec; color: var(--nc4-primary); }
.nc4-icon-btn:active { transform: scale(0.94); }
.nc4-icon-btn.nc4-fav.nc4-on { background: #ffe1ec; color: var(--nc4-primary); }
.nc4-icon-btn.nc4-copied { background: #dcfce7; color: var(--nc4-success); }

.nc4-empty {
  text-align: center;
  color: var(--nc4-text-soft);
  padding: 1.1rem;
  border: 1.5px dashed var(--nc4-border);
  border-radius: 12px;
  background: #fff;
  font-size: 0.9rem;
}

/* ---------- Card CTA + modal ---------- */
.nc4-card-cta {
  display: none;
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px dashed var(--nc4-primary);
  border-radius: 12px;
  color: var(--nc4-primary);
  font-weight: 700;
  font-size: 0.95rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.nc4-card-cta.nc4-show { display: inline-flex; }
.nc4-card-cta:hover { background: #fff0f5; }

.nc4-cardmodal {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1rem;
}
.nc4-cardmodal.nc4-show { display: flex; animation: nc4-fade-in 0.2s ease both; }
.nc4-cardmodal-inner {
  background: #fff;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 18px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  animation: nc4-slide-up 0.25s ease both;
}
.nc4-cardmodal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nc4-cardmodal-head h3 { margin: 0; font-size: 1rem; }
.nc4-cardmodal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f0f3;
  color: var(--nc4-text-soft);
}
.nc4-card-preview {
  background: #f8f3f5;
  border-radius: 12px;
  padding: 0.4rem;
  display: grid;
  place-items: center;
}
.nc4-card-canvas {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  display: block;
}
.nc4-card-pick {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.55rem;
  background: #faf2f5;
  border-radius: 10px;
  font-size: 0.85rem;
}
.nc4-card-picklabel { color: var(--nc4-text-soft); font-weight: 600; }
.nc4-card-select {
  flex: 1;
  padding: 0.45rem 0.55rem;
  background: #fff;
  border: 1px solid var(--nc4-border);
  border-radius: 8px;
  font-weight: 700;
}
.nc4-card-themes { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.nc4-card-swatch {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid transparent;
  overflow: hidden;
}
.nc4-card-swatch > span {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #fff;
}
.nc4-card-swatch.nc4-on { border-color: var(--nc4-primary); transform: scale(1.05); }
.nc4-cardmodal-actions { display: flex; gap: 0.5rem; }
.nc4-cardmodal-actions button {
  flex: 1;
  min-height: 48px;
  border-radius: 24px;
  font-weight: 700;
  font-size: 0.92rem;
}
.nc4-card-dl {
  background: linear-gradient(135deg, var(--nc4-primary) 0%, #ff7aa8 100%);
  color: #fff;
  box-shadow: var(--nc4-shadow-lg);
}
.nc4-card-dl:hover { transform: translateY(-1px); }
.nc4-card-share {
  background: #fff;
  color: var(--nc4-primary);
  border: 1.5px solid var(--nc4-primary);
}

/* ---------- Favorites fab + modal ---------- */
.nc4-fav-fab {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 50;
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: var(--nc4-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: var(--nc4-shadow-lg);
}
.nc4-fav-fab.nc4-show { display: inline-flex; }
.nc4-fav-fab .nc4-fab-count {
  background: #fff;
  color: var(--nc4-primary);
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
}
.nc4-modal {
  position: fixed;
  inset: 0;
  background: rgba(26,26,46,0.55);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 60;
}
.nc4-modal.nc4-show { display: flex; animation: nc4-fade-in 0.2s ease both; }
.nc4-modal-inner {
  background: #fff;
  width: 100%;
  max-width: 520px;
  border-radius: 18px 18px 0 0;
  padding: 1rem;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: nc4-slide-up 0.25s ease both;
}
.nc4-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.nc4-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f5f0f3;
  color: var(--nc4-text-soft);
}
.nc4-modal-list {
  overflow-y: auto;
  display: grid;
  gap: 0.5rem;
}

/* ---------- Toast ---------- */
.nc4-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translate(-50%, 20px);
  background: var(--nc4-text);
  color: #fff;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.nc4-toast.nc4-show { opacity: 1; transform: translate(-50%, 0); }
.nc4-toast.nc4-success { background: var(--nc4-success); }

/* ---------- Internal links ---------- */
.nc4-links { margin-top: 1.5rem; }
.nc4-links-title { font-size: 1rem; font-weight: 800; margin: 0 0 0.65rem; }
.nc4-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}
.nc4-link-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.8rem;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #fff0f4;
  box-shadow: var(--nc4-shadow);
  text-decoration: none;
  color: var(--nc4-text);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.nc4-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(231,76,139,0.18);
}
.nc4-link-icon {
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: #fff0f4;
  border-radius: 8px;
}
.nc4-link-label { display: block; font-weight: 700; font-size: 0.9rem; }
.nc4-link-desc { display: block; font-size: 0.74rem; color: var(--nc4-text-soft); margin-top: 0.1rem; }
.nc4-link-arrow { color: var(--nc4-primary); font-weight: 700; }

.nc4-footer-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--nc4-muted);
  margin-top: 1.1rem;
}

@keyframes nc4-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes nc4-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (max-width: 480px) {
  .nc4-wrapper { margin: 0.75rem 0; padding: 1rem 0.8rem 1.6rem; border-radius: 14px; }
  .nc4-title { font-size: 1.3rem; }
  .nc4-card-name { font-size: 1.2rem; }
}

@media (min-width: 640px) {
  .nc4-inputs { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 760px) {
  .nc4-links-grid { grid-template-columns: repeat(3, 1fr); }
  .nc4-results { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .nc4-wrapper *,
  .nc4-wrapper *::before,
  .nc4-wrapper *::after {
    animation-duration: 0.01ms;
    transition-duration: 0.01ms;
  }
}
