/* Remix library — dark KN-style cards */
.remix-page { color: #e2e8f0; padding: 4px 0 28px; }
.remix-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.remix-hero h1 { font-size: 1.7rem; font-weight: 800; margin: 0; color: #fff; display: flex; align-items: center; gap: 10px; }
.remix-help-btn {
  width: 26px; height: 26px; border-radius: 999px; padding: 0;
  border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08);
  color: #e2e8f0; font-size: 12px; font-weight: 800; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.remix-help-btn:hover { background: rgba(249,115,22,.25); border-color: rgba(249,115,22,.5); }
.remix-help-ol { margin: 0; padding-left: 1.15rem; color: #cbd5e1; font-size: 13.5px; line-height: 1.55; }
.remix-help-ol li { margin: 0 0 8px; }
.remix-help-note { margin: 14px 0 0; font-size: 13px; color: #94a3b8; line-height: 1.5; }
.remix-hero p { color: #94a3b8; margin: 6px 0 0; font-size: .92rem; }
.remix-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin: 0 0 28px; }
.remix-search-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.remix-search { background: rgba(15,23,42,.7); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; color: #e2e8f0; padding: 9px 14px; flex: 1 1 220px; min-width: 180px; max-width: 420px; }
.remix-sort { display: flex; flex-wrap: wrap; gap: 8px; }
.remix-sort a { padding: 8px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; color: #94a3b8; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.remix-sort a.on { color: #fff; background: linear-gradient(135deg,#f97316,#e11d48); border-color: transparent; }

.remix-masonry { position: relative; min-height: 80px; margin-top: 4px; }
.remix-masonry:not(.is-packed) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
@media (max-width: 1100px) { .remix-masonry:not(.is-packed) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) { .remix-masonry:not(.is-packed) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .remix-masonry:not(.is-packed) { grid-template-columns: 1fr; } }
.remix-masonry.is-packed { display: block; }
.remix-masonry.is-packed .remix-card {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
}

.remix-card { background: #111827; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; overflow: hidden; display: block; }
.remix-media { position: relative; background: #000; aspect-ratio: 9 / 16; overflow: hidden; }
.remix-media[data-ar="16:9"] { aspect-ratio: 16 / 9; }
.remix-media[data-ar="1:1"] { aspect-ratio: 1 / 1; }
.remix-media[data-ar="4:3"] { aspect-ratio: 4 / 3; }
.remix-media[data-ar="3:4"] { aspect-ratio: 3 / 4; }
.remix-media[data-ar="9:16"] { aspect-ratio: 9 / 16; }
.remix-media video, .remix-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.remix-media, .remix-media video, .remix-media img, .remix-chip {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.remix-media video::-webkit-media-controls-enclosure { overflow: hidden; }
.remix-media video::-internal-media-controls-download-button { display: none; }
.remix-chip { position: absolute; left: 8px; bottom: 8px; width: 42px; height: 42px; border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.remix-chip img { width: 100%; height: 100%; object-fit: cover; }
.remix-flag { position: absolute; top: 8px; right: 8px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: linear-gradient(135deg,#f97316,#e11d48); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.remix-body { padding: 10px 12px 12px; }
.remix-title { font-size: 13.5px; font-weight: 700; color: #f1f5f9; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 0 6px; }
.remix-meta { font-size: 11.5px; color: #94a3b8; display: flex; flex-wrap: wrap; gap: 8px; }
.remix-footer { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.remix-btn { border: none; cursor: pointer; border-radius: 10px; font-weight: 700; font-size: 12.5px; padding: 8px 12px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-family: inherit; }
.remix-btn-use { background: linear-gradient(135deg,#f97316,#e11d48); color: #fff; flex: 1; justify-content: center; }
.remix-btn-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; background: rgba(255,255,255,.08); color: #94a3b8; }
.remix-btn-ghost { background: rgba(255,255,255,.06); color: #cbd5e1; border: 1px solid rgba(255,255,255,.1); }
.remix-empty { text-align: center; color: #64748b; padding: 48px 16px; }

.remix-more-wrap {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}
.remix-load-more {
  appearance: none;
  -webkit-appearance: none;
  min-width: 132px;
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: #111827;
  color: #f1f5f9;
  font-family: inherit;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.remix-load-more:hover {
  background: linear-gradient(135deg, #f97316, #e11d48);
  border-color: transparent;
  color: #fff;
}
.remix-load-more:focus-visible {
  outline: 2px solid rgba(249, 115, 22, .7);
  outline-offset: 2px;
}
.remix-load-more.is-loading {
  opacity: .6;
  pointer-events: none;
}

.remix-banner { background: rgba(249,115,22,.12); border: 1px solid rgba(249,115,22,.35); color: #fdba74; border-radius: 12px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }

dialog.remix-modal-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 20px;
  border: 0;
  background: rgba(0,0,0,.65);
  color: #e2e8f0;
  color-scheme: dark;
  z-index: 2147483000;
  align-items: center;
  justify-content: center;
}
dialog.remix-modal-bg[open] { display: flex; }
dialog.remix-modal-bg::backdrop { background: rgba(0,0,0,.65); }
.remix-modal-x {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: rgba(15,23,42,.9);
  border: 1px solid rgba(255,255,255,.2);
}
.remix-modal { background: #0f172a; color: #e2e8f0; border: 1px solid rgba(255,255,255,.1); border-radius: 16px; max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; padding: 20px; padding-bottom: 16px; position: relative; }
.remix-modal h3 { margin: 0 0 12px; color: #fff; }
.remix-kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; font-size: 13px; }
.remix-kv dt { color: #94a3b8; }
.remix-kv dd { margin: 0; color: #e2e8f0; }
.remix-prompt { white-space: pre-wrap; background: rgba(2,6,23,.55); border: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding: 10px; font-size: 13px; line-height: 1.55; color: #e2e8f0; }
.remix-modal .d-flex { position: sticky; bottom: 0; background: #0f172a; padding-top: 10px; }
.remix-inputs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.remix-inputs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
