:root {
  color-scheme: dark;
  --bg: var(--du-bg);
  --text: var(--du-text);
  --muted: var(--du-muted);
  --cyan: var(--du-accent);
  --line: var(--du-border);
  --card: var(--du-surface);
}
* { box-sizing: border-box; }
html { scroll-padding-top: 84px; scroll-behavior: smooth; }
html, body { margin: 0; background: var(--du-bg); color: var(--text); overflow-x: hidden; }
body {
  font: 16px/1.5 var(--du-font-body);
  min-height: 100vh;
  background:
    var(--bg);
}
::selection { background: rgba(79,70,229,0.55); color: #e6e8ec; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 80px; }
.site-top {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 0 8px;
}
.site-top .brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.site-top .brand img { width: 40px; height: auto; border-radius: 10px; }
.site-top .brand strong { font-size: var(--du-fs-lg); letter-spacing: -.02em; }
.site-top nav { display: flex; flex-wrap: wrap; gap: 8px; }
.site-top nav a {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(230,232,236,0.22);
  background: rgba(230,232,236,0.04);
  text-decoration: none; font-size: var(--du-fs-sm); font-weight: 650;
}
@media (max-width: 420px) {
  .site-top nav a { padding: 0 10px; font-size: var(--du-fs-xs); }
  .page-head h1 { font-size: clamp(28px, 8vw, 40px); word-break: break-word; }
  .card .buyrow { flex-wrap: wrap; }
}

.site-top nav a:hover { border-color: rgba(79,70,229,0.7); color: var(--cyan); }
.site-top nav a[aria-current="page"] {
  border-color: rgba(79,70,229,0.85);
  color: var(--cyan);
  background: rgba(79,70,229,0.22);
}
.site-top nav a.cta {
  background: var(--du-gradient);
  border-color: transparent; color: #e6e8ec;
}
.site-top nav .cta-wrap {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.launch-badge {
  display: inline-flex; align-items: center;
  min-height: 26px; padding: 0 9px; border-radius: 999px;
  background: rgba(17,20,26,0.72);
  border: 1px solid rgba(230,232,236,0.22);
  color: var(--cyan);
  font-size: 11px; font-weight: 750; letter-spacing: .04em;
  white-space: nowrap;
}
.page-head { margin: 12px 0 20px; }
.page-head h1 {
  margin: 0; font-size: clamp(32px, 6vw, 48px);
  letter-spacing: -.04em; line-height: 1.05; font-weight: 700;
}
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 40rem; }
.chips {
  display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 20px;
}
.chips button, .chips a.chip {
  min-height: 44px; display: inline-flex; align-items: center;
  padding: 0 16px; border-radius: 999px;
  border: 1px solid rgba(230,232,236,0.22);
  background: rgba(230,232,236,0.04);
  color: var(--text); font-size: var(--du-fs-sm); font-weight: 650;
  cursor: pointer; text-decoration: none;
}
.chips button.is-on, .chips a.chip.is-on {
  border-color: rgba(79,70,229,0.85);
  color: var(--cyan);
  background: rgba(79,70,229,0.25);
}
.search-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;
}
.search-row input[type="search"] {
  flex: 1 1 220px; min-height: 48px;
  padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17,20,26,0.85); color: var(--text);
  font: inherit;
}
.search-row input:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px;
}
.grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
}
@media (min-width: 640px) { .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .grid { grid-template-columns: 1fr 1fr 1fr; } }
.card {
  display: flex; flex-direction: column;
  border-radius: 22px; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
.card .shot {
  aspect-ratio: 16 / 10; background: #1a1e26;
  object-fit: cover; width: 100%; display: block;
}
.card .info { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.card .info strong { font-size: var(--du-fs-lg); letter-spacing: -.02em; }
.card .maker { color: var(--muted); font-size: var(--du-fs-sm); }
.card .maker a { color: var(--cyan); text-decoration: none; }
.card .blurb {
  color: var(--muted); font-size: var(--du-fs-sm); line-height: 1.4; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .buyrow {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 8px;
}
.card .price { font-size: var(--du-fs-sm); font-weight: 700; color: var(--cyan); }
.card .cta {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; border-radius: 999px;
  background: var(--du-gradient);
  color: #e6e8ec; font-weight: 700; font-size: var(--du-fs-sm); text-decoration: none;
}
.card .buyrow .price { margin-right: auto; }
.card .cta2 {
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 14px; border-radius: 999px; border: 1px solid rgba(230,232,236,0.22);
  background: rgba(230,232,236,0.04); color: #e6e8ec; font-weight: 600; font-size: 13px; text-decoration: none;
}
.card .titlerow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .titlerow .title { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.card .cta2.top { flex: 0 0 auto; margin-left: auto; flex-shrink: 0; min-height: 32px; padding: 0 12px; font-size: var(--du-fs-xs); }
.card .cta2:hover { border-color: rgba(79,70,229,0.6); color: #e6e8ec; }
.empty {
  padding: 32px 20px; border-radius: 20px;
  border: 1px dashed rgba(230,232,236,0.18);
  color: var(--muted); text-align: center;
}
.faq { margin-top: 40px; }
.faq h2 { font-size: 24px; margin: 0 0 12px; }
.faq details {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 16px; margin-bottom: 10px;
  background: rgba(230,232,236,0.03);
}
.faq summary { cursor: pointer; font-weight: 650; }
.faq p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
footer.foot {
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid rgba(230,232,236,0.08);
  color: var(--muted); font-size: var(--du-fs-sm);
}
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 36rem; }
form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: var(--du-fs-sm); }
form .field-hint { margin: -4px 0 0; font-size: 13px; font-weight: 400; color: var(--muted); line-height: 1.4; }
form input, form select, form textarea {
  min-height: 48px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(17,20,26,0.85); color: var(--text); font: inherit;
}
form textarea { min-height: 120px; resize: vertical; }
form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
form .check input { min-height: 20px; width: 20px; margin-top: 3px; }
form button[type="submit"] {
  min-height: 48px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--du-gradient);
  color: #e6e8ec; font-weight: 700; font-size: var(--du-fs-md);
}
.form-msg { padding: 12px 16px; border-radius: 14px; font-size: 15px; }
.form-msg.ok { background: rgba(79,70,229,0.15); border: 1px solid rgba(230,232,236,0.22); }
.form-msg.err { background: rgba(240,128,128,0.12); border: 1px solid rgba(240,128,128,0.35); }
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-item {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px;
  background: rgba(230,232,236,0.03);
}
.admin-item .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.admin-item button {
  min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(230,232,236,0.06);
  color: var(--text); cursor: pointer; font-weight: 600;
}
.admin-item button.approve { border-color: rgba(230,232,236,0.27); }
.admin-item button.reject { border-color: rgba(240,128,128,0.5); }

.admin-load {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--du-gradient);
  color: #e6e8ec; font-weight: 700; font-size: 15px;
}
.card .shot { background-size: cover; background-position: center; }
.wrap { overflow-x: clip; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-load.secondary {
  background: rgba(230,232,236,0.08);
  border: 1px solid rgba(230,232,236,0.24);
  color: var(--text);
}
.consent-hint { margin-top: -6px; }

/* Creator dashboard */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.dash-panel {
  border: 1px solid var(--line); border-radius: 20px; padding: 16px;
  background: var(--card); margin: 16px 0;
}
.dash-panel h2, .dash-head h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.02em; }
.dash-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 20px 0 10px; }
.dash-panel .dash-head { margin-top: 0; }
.dash-head select { min-height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(17,20,26,0.85); color: var(--text); padding: 0 10px; font: inherit; max-width: 60vw; }
.cta.small, a.cta.small {
  min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 999px;
  background: var(--du-gradient); color: #e6e8ec; font-weight: 700; font-size: var(--du-fs-sm); text-decoration: none;
}
.dash-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .dash-summary { grid-template-columns: repeat(5, 1fr); } }
.kpi { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: rgba(230,232,236,0.03); display: flex; flex-direction: column; }
.kpi b { font-size: 26px; letter-spacing: -.03em; color: var(--cyan); }
.kpi span { font-size: var(--du-fs-xs); color: var(--muted); }
.chart svg { width: 100%; height: 180px; display: block; }
.chart .bv { fill: #9a97e8; }
.chart .lc { fill: none; stroke: #9a97e8; stroke-width: 2; }
.chart .ax { stroke: #11141a; }
.chart .lbl { fill: var(--muted); font-size: 11px; }
.legend { font-size: 13px; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.sw-v { background: rgba(79,70,229,0.85); }
.sw-c { background: #4f46e5; margin-left: 8px; }
.dash-list { display: flex; flex-direction: column; gap: 12px; }
.dash-item { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(230,232,236,0.03); }
.dash-row { display: flex; gap: 12px; align-items: flex-start; }
.dash-row .thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #1a1e26; flex: none; }
.dash-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-meta strong { font-size: 17px; word-break: break-word; }
.dash-meta .reason { margin: 0; font-size: 13px; }
.badge { align-self: flex-start; font-size: var(--du-fs-xs); font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); }
.badge.pro { background: #e8c978; color: #1a1408; border-color: #c9a44a; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.st-approved { color: #9a97e8; border-color: rgba(230,232,236,0.26); }
.st-pending { color: #9a97e8; border-color: rgba(230,232,236,0.26); }
.st-rejected { color: #f08080; border-color: rgba(240,128,128,0.45); }
.st-unpublished { color: var(--muted); }
.kpis { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.dash-item .actions, .dash-panel .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dash-item .actions button, .dash-item .actions a.view {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(230,232,236,0.06); color: var(--text); cursor: pointer; font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; text-decoration: none;
}
.dash-item .actions button.danger { border-color: rgba(240,128,128,0.5); }
.dash-item .actions button.primary { background: var(--du-gradient); border-color: transparent; }
.dash-item form.edit { margin-top: 12px; max-width: none; }
.dash-panel form.stack button[type="submit"], #magic button { min-height: 48px; }
.save-link { margin-top: 12px; padding: 14px; border-radius: 16px; border: 1px solid rgba(230,232,236,0.27); background: rgba(79,70,229,0.15); }
.save-link strong { display: block; margin-bottom: 6px; }
.save-link .row { display: flex; gap: 8px; flex-wrap: wrap; }
.save-link input { flex: 1 1 220px; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #11141a; color: var(--text); padding: 0 10px; font: 13px ui-monospace, monospace; }
.save-link button, .save-link a { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 0; background: var(--du-gradient); color: #e6e8ec; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; text-decoration: none; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: var(--du-fs-xs); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.card .info a.title { text-decoration: none; }
.detail { display: grid; gap: 20px; }
@media (min-width: 860px) { .detail { grid-template-columns: 1.2fr 1fr; } }
.detail img { width: 100%; border-radius: 20px; aspect-ratio: 16/10; object-fit: cover; background: #1a1e26; }
.detail .desc { white-space: pre-wrap; color: var(--muted); }
[hidden] { display: none !important; }
button.signout, button.linkish {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(230,232,236,0.06); color: var(--text); cursor: pointer; font: inherit; font-weight: 600;
}
button.linkish { background: none; border: 0; color: var(--cyan); text-decoration: underline; }
.site-top nav a.login-btn { border-color: rgba(79,70,229,0.75); color: var(--cyan); background: rgba(79,70,229,0.35); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 52px; }
.pw-eye {
  position: absolute; top: 50%; right: 2px; transform: translateY(-50%);
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--cyan); }
.pw-eye:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
form .pw-mismatch, .pw-mismatch { color: #f08080; margin-top: -8px; }

/* Share pill (marketplace header) */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.title-row h1 { min-width: 0; }
.share-pill {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 18px 0 14px; border-radius: 999px; cursor: pointer;
  font: 700 15px/1 inherit; font-family: inherit; color: #e6e8ec;
  background: #4f46e5;
  border: 1px solid rgba(230,232,236,0.22);
  box-shadow: none;
  transition: transform .15s ease, filter .15s ease; -webkit-tap-highlight-color: transparent;
}
.share-pill svg { width: 18px; height: 18px; }
.share-pill:hover { filter: brightness(1.08); }
.share-pill:active { transform: scale(.96); }
.share-pill:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 999px; font-weight: 650; font-size: var(--du-fs-sm); color: #e6e8ec;
  background: #161a21; border: 1px solid rgba(230,232,236,0.22);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast, .share-pill { transition: none; } }
/* Share pill lives in the brand row (top right) */
.site-top .brand { order: 1; }
.site-top nav { order: 2; margin-left: auto; }
.site-top .share-pill { order: 3; min-height: 44px; padding: 0 14px 0 12px; font-size: var(--du-fs-sm); gap: 6px; }
.site-top .share-pill svg { width: 17px; height: 17px; }
@media (max-width: 900px) {
  .site-top .share-pill { order: 2; margin-left: auto; }
  .site-top nav { order: 3; flex-basis: 100%; margin-left: 0; }
}
.cat-filter { display: flex; align-items: center; flex-wrap: wrap; gap: var(--du-sp-3); margin: 0 0 var(--du-sp-5); }
.cat-filter label { font-size: var(--du-fs-sm); font-weight: 700; color: var(--du-muted); }
.cat-filter .du-select { min-width: 220px; }
@media (max-width: 560px) { .cat-filter .du-select { flex: 1 1 100%; } }
