/* Colours. Light by default; dark only when chosen (the studio's switch sets data-theme="dark"
   on <html>, and the choice is remembered on the device). */
:root {
  --bg: #f6f5f1; --panel: #ffffff; --ink: #1d1c19; --quiet: #6b6963; --line: #dedbd2;
  --accent: #a87a24; --accent-ink: #ffffff; --ok: #2f7d4f; --bad: #b3362e; --warn: #9a6b00;
  --art-filter: none; --stage-a: #ffffff; --stage-b: #ece9e1;
  --radius: 10px; color-scheme: light;
}
:root[data-theme=dark] {
  --bg: #191917; --panel: #232321; --ink: #ecebe6; --quiet: #a09e96; --line: #393935;
  --accent: #d6a548; --accent-ink: #1b1b19; --ok: #5fbf86; --bad: #ef7a70; --warn: #e2b04a;
  --art-filter: invert(1); --stage-a: #34332f; --stage-b: #1f1f1d; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 20px; padding: 12px 24px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 650; }
header.top nav { display: flex; gap: 6px 16px; flex: 1; flex-wrap: wrap; }
header.top nav a { color: var(--ink); text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; white-space: nowrap; }
header.top nav a.on { border-color: var(--accent); }
main { max-width: 1180px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 28px 0 10px; } h3 { font-size: 15px; margin: 18px 0 8px; }
.sub { color: var(--quiet); margin: 0 0 20px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 520px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--quiet); font-weight: 600; }
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid currentColor; }
.badge.live { color: var(--ok); } .badge.ready { color: var(--accent); } .badge.failed { color: var(--bad); }
.badge.checking { color: var(--warn); } .badge.archived, .badge.hidden { color: var(--quiet); }
button, .btn { font: inherit; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=number], select, textarea { font: inherit; width: 100%; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
label { display: block; font-size: 13px; color: var(--quiet); margin: 10px 0 4px; }
label.inline { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--ok); color: var(--ok); }
.flash.error { border-color: var(--bad); color: var(--bad); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.checks .mark { font-weight: 700; width: 18px; flex: none; }
.checks .ok .mark { color: var(--ok); } .checks .bad .mark { color: var(--bad); }
.checks .name { font-weight: 600; min-width: 140px; }
.rings { display: grid; gap: 14px; grid-template-columns: 1fr; }
.ring-tile img { width: 100%; height: auto; background: var(--bg); border-radius: 8px; }
.viewer { width: 100%; height: 340px; border-radius: 8px; background: var(--bg); position: relative; }
.muted { color: var(--quiet); font-size: 13px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.thumbs .t { border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; font-size: 12px; }
.thumbs img { width: 64px; height: 64px; filter: none; }
.thumbs img { filter: var(--art-filter); }
.warn { color: var(--warn); } .err { color: var(--bad); }
input.price { max-width: 130px; min-width: 84px; }
.views .tabs { display: none; }
.views .tabs [role=tablist] { display: flex; gap: 6px; margin-bottom: 8px; }
.views .tabs [role=tab][aria-selected=true] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.views .tabs img { width: 100%; height: auto; touch-action: pan-y; }
@media (max-width: 640px) {
  header.top { flex-wrap: wrap; padding: 10px 16px; gap: 8px 16px; }
  header.top .brand { flex: 1; }
  header.top nav { order: 3; flex-basis: 100%; gap: 4px 14px; }
  main { padding: 16px 12px 48px; }
  th, td { padding: 7px 6px; }
  .card { padding: 12px; }
  .viewer { height: 300px; }
  .views .strip { display: none; }
  .views .tabs { display: block; }
  input.price { max-width: none; width: 100%; }
}

/* admin: popular designs */
.steps-help { margin: 0 0 12px; padding-left: 20px; }
.showcase-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.showcase-admin .sc { display: flex; flex-direction: column; gap: 10px; }
.showcase-admin .sc.off img { opacity: .45; }
.showcase-admin img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; border-radius: 8px;
  background: var(--line); -webkit-user-drag: none; user-select: none; }
.showcase-admin .sc-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.showcase-admin .small { font-size: 12px; margin-top: 2px; }
.showcase-admin .sc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.showcase-admin .sc-actions form { margin: 0; }
.showcase-admin details summary { cursor: pointer; color: var(--accent); margin-top: 4px; }
.showcase-admin details form { margin-top: 8px; }
