* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --surface2: #1a1a25;
  --border: #2a2a3a;
  --text: #e0e0e8;
  --text-dim: #888898;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --surface-glass: rgba(18, 18, 26, 0.95);
  --radius: 8px;
}

/* Day mode — dark is the default; toggled via data-theme on <html> */
:root[data-theme="light"] {
  --bg: #f4f4f7;
  --surface: #ffffff;
  --surface2: #ebebf1;
  --border: #d9d9e3;
  --text: #1c1c28;
  --text-dim: #6b6b7a;
  --accent: #6c5ce7;
  --accent-light: #5546d6;
  --surface-glass: rgba(255, 255, 255, 0.93);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
/* The mascot (Galaxy Glass Bunny), cut out by scripts/make-mascot-icons.mjs */
.logo-mark { height: 54px; width: auto; display: block; }

.logo span { color: var(--accent-light); }

/* Claude usage stats in header */
.header-stats {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--text-dim);
  white-space: nowrap;
  pointer-events: none;
  flex: 1;
  text-align: center;
  padding: 0 20px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) { .header-stats { display: none; } }

nav { display: flex; align-items: center; gap: 6px; }
.theme-toggle {
  background: none;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); background: var(--surface2); border-color: var(--border); }
nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
nav a:hover { color: var(--text); background: var(--surface2); border-color: var(--border); }

/* Nav: one neutral colour; the Workshop link is an outlined pill */
nav a.nav-workshop { color: var(--text); border-color: var(--border); }
nav a.nav-workshop:hover { border-color: var(--accent); }

.nav-discord {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #7289da !important;
  border: 1px solid transparent !important;
  padding: 0 !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s !important;
}
.nav-discord:hover {
  background: rgba(114,137,218,.15) !important;
  border-color: rgba(114,137,218,.4) !important;
  color: #7289da !important;
}

.nav-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Profile button + dropdown */
.profile-wrap { position: relative; }

.profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  line-height: 1;
}
.profile-btn:hover { border-color: var(--accent); background: var(--surface); }
.profile-btn .nav-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}
.profile-btn .nav-pts { color: var(--accent-light); font-size: 12px; font-weight: 700; }
.profile-btn .caret { color: var(--text-dim); font-size: 9px; margin-left: 2px; }

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 210px;
  padding: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  z-index: 300;
}
.profile-dropdown.open { display: block; }

.profile-dropdown-header {
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.profile-dropdown-name { font-weight: 700; font-size: 15px; color: var(--text); }
.profile-dropdown-meta { font-size: 12px; color: var(--text-dim); margin-top: 3px; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}
.dropdown-item:hover { background: var(--surface2); color: var(--text); }
.dropdown-item .di-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }
.dropdown-logout { color: var(--danger) !important; }
.dropdown-logout:hover { background: rgba(225,112,85,.1) !important; color: var(--danger) !important; }

/* Logged-out nav auth */
.nav-login {
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
  font-family: inherit;
}
.nav-login:hover { color: var(--text); background: var(--surface2); }

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
}

.loading { text-align: center; padding: 48px; color: var(--text-dim); }

/* Model Grid */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 { font-size: 24px; font-weight: 600; }

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s;
}

.model-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.model-preview {
  height: 200px;
  background: #fff;
  overflow: hidden;
  position: relative;
}

.model-preview iframe {
  width: 200%;
  height: 200%;
  border: none;
  transform: scale(0.5);
  transform-origin: top left;
  pointer-events: none;
}

.model-info {
  padding: 16px;
}

.model-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.model-info p {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.model-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.model-meta .badge {
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 12px;
}

/* Tag chips (models & effects) */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  line-height: 1;
  padding: 4px 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
button.tag-chip { cursor: pointer; }
span.tag-chip { cursor: default; }
.tag-chip::before { content: '#'; opacity: 0.5; margin-right: 1px; }
.tag-chip:hover { color: var(--accent-light); border-color: var(--accent); background: var(--surface); }
span.tag-chip:hover { color: var(--text-dim); border-color: var(--border); background: var(--surface2); }
.tag-chip.active { color: var(--accent-light); border-color: var(--accent); background: rgba(99,179,237,.12); }
.tag-chip.active::after { content: '×'; margin-left: 5px; opacity: .7; }
.tag-chip .tag-n { margin-left: 5px; opacity: .55; font-size: 10px; }
/* the tag filter bar above the gallery and on a package page */
.tag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: -4px 0 14px; font-size: 12px; }
.tag-bar-lbl { color: var(--text-dim); margin-right: 4px; }
.tag-bar-sep { width: 1px; height: 16px; background: var(--border); margin: 0 6px; }
.tag-clear { background: none; border: 0; color: var(--accent-light); cursor: pointer; font: inherit; font-size: 12px; padding: 2px 6px; }
.tag-clear:hover { text-decoration: underline; }
/* a package's author notes: long ones start folded */
.pkg-notes.clamped { max-height: 180px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-light); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn {
  background: none;
  border: none;
  color: var(--accent-light);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  font-weight: 500;
  justify-content: center;
  width: 100%;
  gap: 10px;
}
.btn-google:hover { background: #f8f9fa; border-color: #c6c9cb; }
.btn-google svg { flex-shrink: 0; }
.or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--text-dim);
  font-size: 12px;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}

.form-group textarea { min-height: 100px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90vw;
  max-width: 800px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 24px;
  cursor: pointer;
}

/* Model Detail */
.model-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.model-detail-header h1 { font-size: 28px; }

.model-detail-preview {
  width: 100%;
  height: 600px;
  background: #0c0d14;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  border: 1px solid var(--border);
}

.model-detail-preview iframe {
  width: 100%;
  height: 100%;
  border: none;
}
/* the render tools live inside the frame; a frame taken fullscreen by the page fills the screen */
.model-detail-preview iframe:fullscreen { width: 100vw; height: 100vh; }

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab {
  padding: 10px 16px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}

.tab.active {
  color: var(--accent-light);
  border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Submissions list */
.submission-item {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.submission-item .status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.status-pending { background: var(--warning); color: #000; }
.status-processing { background: var(--accent); color: #fff; }
.status-reviewed { background: var(--accent-light); color: #000; }
.status-applied { background: var(--success); color: #fff; }
.status-rejected { background: var(--danger); color: #fff; }
.status-error { background: var(--danger); color: #fff; }

/* Admin */
.admin-section { margin-bottom: 32px; }
.admin-section h2 { margin-bottom: 16px; font-size: 20px; }

.trust-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.trust-0 { background: var(--border); color: var(--text-dim); }
.trust-25 { background: #2d3436; color: var(--warning); }
.trust-50 { background: #2d3436; color: var(--accent-light); }
.trust-75 { background: #2d3436; color: var(--success); }
.trust-100 { background: var(--success); color: #fff; }

/* Version History */
.version-item {
  padding: 12px;
  border-left: 2px solid var(--border);
  margin-left: 8px;
  margin-bottom: 8px;
}

.version-item.current { border-left-color: var(--accent); }

/* API info box */
.api-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 16px;
}

.api-box code {
  display: block;
  background: var(--bg);
  padding: 12px;
  border-radius: 4px;
  font-size: 13px;
  overflow-x: auto;
  margin-top: 8px;
  white-space: pre;
}

/* Responsive */
/* ── Home page auth banner ───────────────────────────────────── */
.home-auth-banner {
  border: 1px solid rgba(108, 92, 231, 0.35);
  border-radius: 12px;
  padding: 28px 24px;
  margin-bottom: 48px;
  background: rgba(108, 92, 231, 0.06);
  text-align: center;
}
.home-auth-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin: 0 0 18px;
  line-height: 1.5;
}

@media (max-width: 640px) {
  .model-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
  .model-detail-preview { height: 300px; }
  nav a { font-size: 13px; padding: 5px 8px; }
  .profile-btn .nav-pts { display: none; }
  .profile-btn { padding: 6px 10px; }
}

/* Diff view */
.diff-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}

.diff-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.diff-panel h4 {
  padding: 8px 12px;
  background: var(--surface2);
  font-size: 13px;
  color: var(--text-dim);
}

.diff-panel iframe {
  width: 100%;
  height: 300px;
  border: none;
}

/* User images in submission */
.submission-images {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.submission-images img {
  max-width: 120px;
  max-height: 80px;
  border-radius: 4px;
  border: 1px solid var(--border);
  object-fit: cover;
}

.empty-state {
  text-align: center;
  padding: 48px;
  color: var(--text-dim);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 14px;
  z-index: 300;
  animation: slideUp 0.3s ease;
}

.toast.error { border-color: var(--danger); }
.toast.success { border-color: var(--success); }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Gallery search + category tabs ─────────────────────────── */
.gallery-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px 9px 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
}
.search-input:focus { outline: none; border-color: var(--accent); }

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap::before {
  content: '⌕';
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 18px;
  pointer-events: none;
}

.gallery-count {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.cat-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cat-tab {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-tab:hover { border-color: var(--accent); color: var(--text); }
.cat-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Compact sticky gallery bar ──────────────────────────── */
.gallery-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  margin-bottom: 16px;
  position: sticky;
  top: 68px;
  z-index: 89;
}
.gallery-bar .search-wrap { flex: 1; min-width: 120px; }
.gallery-bar .search-input {
  padding: 5px 10px 5px 30px;
  font-size: 13px;
  height: 32px;
  min-width: 0;
  width: 100%;
}
.gallery-bar .search-wrap::before { font-size: 14px; left: 8px; }
.gallery-bar-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  height: 32px;
  cursor: pointer;
  flex-shrink: 0;
}
.dup-badge { background: rgba(180,140,60,.15) !important; color: #d8ab5e !important; border: 1px solid rgba(216,171,94,.35); }

/* Generation stats */
.card-gen { font-size: 11px; color: var(--text-dim); margin-top: 6px; opacity: 0.85; }
.detail-gen {
  margin-top: 8px; font-size: 13px; color: var(--text-dim);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 12px; display: inline-block;
}
.detail-gen strong { color: var(--warning); }

/* Downloads tab */
.download-list { display: flex; flex-direction: column; gap: 8px; }
.download-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.dl-fmt {
  font-family: monospace; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 9px; min-width: 58px; text-align: center; color: var(--accent-light);
  flex-shrink: 0;
}
.dl-fmt-html { color: #5de8c0; }
.dl-info { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.dl-info strong { font-size: 14px; }
.dl-meta { font-size: 12px; color: var(--text-dim); }

.live-render-btn { color: var(--text-dim); border-color: var(--border); }
.live-render-btn.live-render-on { color: #f9c74f; border-color: #f9c74f; background: rgba(249,199,79,.1); }

.gallery-bar-count {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
}
.gallery-type-tab {
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
  line-height: 1.6;
  cursor: pointer;
}
.gallery-type-tab:hover { color: var(--text); border-color: var(--accent); }
.gallery-type-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Iframe loading skeleton ─────────────────────────────────── */
.model-preview { position: relative; }
.preview-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  pointer-events: none;
  transition: opacity 0.3s;
}
.preview-loader::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.model-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Nav user info ───────────────────────────────────────────── */
.nav-user-pts {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* ── API docs section ────────────────────────────────────────── */
.api-section {
  margin-top: 48px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.api-section h2 { font-size: 18px; margin-bottom: 6px; }
.api-section .subtitle { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.api-endpoints { display: flex; flex-direction: column; gap: 10px; }
.api-endpoint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.api-endpoint .method {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #1a3a1a;
  color: var(--success);
  margin-top: 2px;
}
.api-endpoint .path { font-family: 'Courier New', monospace; font-size: 13px; margin-bottom: 2px; }
.api-endpoint .desc { font-size: 12px; color: var(--text-dim); }

/* ── Priority badges ─────────────────────────────────────────── */
.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.priority-standard { background: var(--surface2); color: var(--text-dim); }
.priority-rising   { background: #332d1a; color: var(--warning); }
.priority-trusted  { background: #1a1a30; color: var(--accent-light); }
.priority-elite    { background: #0d2b1e; color: var(--success); }

/* ── Filter bar ──────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.filter-bar label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.filter-bar select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 5px 10px;
  font-size: 13px;
  cursor: pointer;
}
.filter-bar select:focus { outline: none; border-color: var(--accent); }
.filter-stat {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-dim);
}

/* ── Queue card ──────────────────────────────────────────────── */
.queue-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.queue-pos {
  font-size: 14px;
  color: var(--text-dim);
}

.queue-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.queue-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.queue-card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.queue-left {
  padding: 20px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
  max-height: 520px;
}
.queue-right {
  display: flex;
  flex-direction: column;
}
.queue-render {
  flex: 1;
  min-height: 360px;
  background: #fff;
}
.queue-render iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.queue-history {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  max-height: 160px;
  overflow-y: auto;
}
.queue-history h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.history-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-dim);
}
.history-row:last-child { border-bottom: none; }
.history-row .hv {
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  margin-top: 2px;
}
.queue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  align-items: center;
}

/* Keyboard shortcut badges */
kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-family: monospace;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* My Submissions stats */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
}
.stat-val {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Claude Queue tab ─────────────────────────────────────────────── */
/* ── Stats strip ───────────────────────────────────────────── */
.cq-stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 16px;
  font-family: 'Courier New', Courier, monospace;
  overflow-x: auto;
  white-space: nowrap;
}
.cqs-cell {
  display: flex;
  align-items: baseline;
  gap: 5px;
}
.cqs-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}
.cqs-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.cqs-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 16px;
  flex-shrink: 0;
}

/* ── Section headers ───────────────────────────────────────── */
.cq-section-hdr {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Pulsing live indicator dot ────────────────────────────── */
.cq-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4caf50;
  flex-shrink: 0;
  animation: cq-pulse 1.5s ease-in-out infinite;
}
@keyframes cq-pulse { 0%,100% { opacity:1; } 50% { opacity:0.25; } }

/* ── Recently completed items ──────────────────────────────── */
.cq-recent-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 3px;
  transition: background 0.12s;
}
.cq-recent-item:hover { background: var(--surface2); }
.cqr-icon { font-size: 12px; font-weight: 700; padding-top: 2px; text-align: center; }
.cqr-ok  { color: #4caf50; }
.cqr-err { color: #ef5350; }
.cqr-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.cqr-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.cqr-name:hover { color: var(--accent-light); }
.cqr-meta {
  font-size: 10px;
  color: var(--accent-light);
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
}
.cqr-date {
  font-size: 11px;
  color: var(--text-dim);
  margin-left: auto;
}
.cqr-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cqr-err-msg {
  font-size: 11px;
  color: #ef5350;
  margin: 3px 0 0;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  word-break: break-all;
}
/* Status tag pill on recent items */
.cqr-status-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
}
.cqr-st-applied  { background: rgba(76,175,80,0.15);  color: #4caf50; }
.cqr-st-rejected { background: rgba(239,83,80,0.12);  color: #ef5350; }
.cqr-st-error    { background: rgba(239,83,80,0.12);  color: #ef5350; }

.cq-review-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #e65100;
  border-color: rgba(230, 81, 0, 0.3);
}
.cq-review-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(230, 81, 0, 0.35);
  background: rgba(230, 81, 0, 0.06);
  margin-bottom: 6px;
  transition: background 0.12s;
}
.cq-review-item:hover { background: rgba(230, 81, 0, 0.1); }
.cqrev-body { flex: 1; min-width: 0; }
.cqrev-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.cqrev-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.cqrev-name:hover { color: var(--accent-light); }
.cqrev-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.claude-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

#claude-queue-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.claude-queue-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: background 0.15s;
}
.claude-queue-item:hover { background: var(--surface2); }
.claude-queue-item.cqi-active { border-color: #2a5c2a; background: #111a11; }

.cqi-pos {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  min-width: 28px;
}

@keyframes cqi-spin { to { transform: rotate(360deg); } }

.cqi-body { min-width: 0; }

/* ── Console tab ────────────────────────────────────────────── */
.console-log {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  font-family: 'Courier New', Courier, monospace;
  font-size: 12px;
  overflow: auto;
  max-height: 72vh;
}
.ce-entry {
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
}
.ce-entry:last-child { border-bottom: none; }
.ce-ok  { border-left-color: #4caf50; }
.ce-err { border-left-color: #ef5350; background: rgba(239,83,80,0.04); }
.ce-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.ce-icon { font-weight: 700; width: 14px; flex-shrink: 0; }
.ce-ok  .ce-icon { color: #4caf50; }
.ce-err .ce-icon { color: #ef5350; }
.ce-model { font-weight: 600; color: #e6edf3; }
.ce-dur   { font-size: 11px; color: #8b949e; }
.ce-tok   { font-size: 11px; color: #58a6ff; }
.ce-tok-err { color: #ef5350; }
.ce-ts    { font-size: 10px; color: #8b949e; margin-left: auto; white-space: nowrap; }
.ce-desc  { color: #8b949e; font-size: 11px; margin: 3px 0 0 24px; }
.ce-toggle {
  background: none;
  border: 1px solid #30363d;
  color: #8b949e;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.ce-toggle:hover { background: #21262d; color: #e6edf3; }
.ce-detail {
  margin: 8px 0 4px 24px;
  padding: 10px 12px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #ffa198;
  font-size: 11px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.5;
}

.cqi-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.cqi-desc {
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 600px;
}

.cqi-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

.cqi-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* status badge for queued */
.status-queued { background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent-light); }

/* ── Projects ─────────────────────────────────────────────────────── */
.proj-badge {
  background: rgba(108,92,231,0.18);
  color: var(--accent-light);
  border: 1px solid rgba(108,92,231,0.3);
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.proj-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.proj-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.proj-name {
  font-weight: 600;
  font-size: 15px;
  margin-right: 8px;
}
.proj-slug {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  margin-right: 8px;
}
.proj-count {
  font-size: 11px;
  color: var(--accent-light);
  background: rgba(108,92,231,0.12);
  padding: 1px 6px;
  border-radius: 8px;
}
.proj-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.proj-ruleset-preview {
  font-size: 12px;
  color: var(--text-dim);
  font-family: 'Courier New', monospace;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  max-height: 100px;
  overflow: hidden;
}
.proj-no-ruleset {
  color: #e65100;
  font-family: inherit;
  font-style: italic;
}

@media (max-width: 768px) {
  .queue-card-body { grid-template-columns: 1fr; }
  .queue-left { border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
  .queue-render { min-height: 260px; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
  .stat-card { padding: 12px; }
  .stat-val { font-size: 22px; }
  .claude-queue-header { flex-direction: column; }
  .claude-queue-item { grid-template-columns: 28px 1fr; }
  .cqi-actions { grid-column: 2; }
}

/* ── Pagination ─────────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 24px 0 16px;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.pager-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-light); }
.pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.pager-active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager-active:hover { background: var(--accent-light) !important; border-color: var(--accent-light) !important; color: #fff !important; }
.pager-arrow { font-size: 16px; }
.pager-dot { color: var(--text-dim); font-size: 13px; padding: 0 2px; line-height: 32px; }

/* Book-style page turning (9-per-page view): large side arrows flanking the grid */
.book-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 14px;
}
.book-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 52px;
  min-height: 120px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 34px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.book-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-light); background: var(--surface); }
.book-arrow:disabled { opacity: 0.25; cursor: not-allowed; }
@media (max-width: 767px) {
  .book-grid { grid-template-columns: 1fr; gap: 0; }
  .book-arrow { display: none; }
}

/* Related Objects tab — thumbnail grid of similar models */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.related-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover { border-color: var(--accent, #6a8cff); transform: translateY(-2px); }
.related-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #0d0e17;
}
.related-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.related-info { padding: 8px 10px; }
.related-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.related-cat {
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 10px;
  border: 1px solid var(--border);
}
@media (max-width: 767px) {
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

/* Color customization panel */
.btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.color-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; }
.color-panel.hidden { display: none; }
.color-panel-inner { display: flex; flex-direction: column; gap: 8px; }
.color-swatches { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.color-swatch-wrap { position: relative; width: 36px; height: 36px; border-radius: 6px; overflow: hidden; border: 2px solid var(--border); cursor: pointer; flex-shrink: 0; transition: border-color 0.15s; }
.color-swatch-wrap:hover { border-color: var(--accent); }
.color-pick-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; padding: 0; border: none; }
.color-swatch-tri { position: absolute; bottom: 0; left: 0; width: 13px; height: 13px; clip-path: polygon(0% 100%, 0% 0%, 100% 100%); pointer-events: none; }
.color-src-note { padding: 8px 12px; margin-bottom: 10px; background: rgba(108,92,231,.15); border: 1px solid rgba(108,92,231,.35); border-radius: var(--radius); font-size: 12px; color: var(--accent-light); }
.color-src-note.hidden { display: none; }

/* Generation cost/stats on the Versions tab */
.gen-totals {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}
.gen-totals strong { color: var(--text); }
.gen-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.gen-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: monospace;
}
.gen-chip.gen-cost { color: #7ac84a; border-color: #3f7a3a; }

/* ── Rigged characters ─────────────────────────────────────────────── */
.char-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.char-viewer-wrap { position: sticky; top: 16px; }
@media (max-width: 900px) {
  .char-detail-grid { grid-template-columns: 1fr; }
  .char-viewer-wrap { position: static; }
}

/* ── Home page: a short hero, a one-line step strip, then the models ── */
.home { max-width: 1400px; margin: 0 auto; padding: 0 20px 40px; }
.hp-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); align-items: center; gap: 24px; padding: 44px 0 20px; position: relative; max-width: 1100px; margin: 0 auto; }
.hp-hero::before { content: ''; position: absolute; left: 50%; top: -90px; width: 900px; height: 420px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(108,92,231,.22), transparent 65%); pointer-events: none; }
.hp-hero > * { position: relative; }
.hp-hero-copy { padding-left: 8px; }
.hp-pill { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--accent-light); background: rgba(108,92,231,.12); border: 1px solid rgba(108,92,231,.35); border-radius: 20px; padding: 4px 12px; margin-bottom: 16px; }
.hp-h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; line-height: 1.02; letter-spacing: -.02em; margin: 0 0 14px; }
.hp-lead { font-size: clamp(15px, 1.6vw, 18px); color: var(--text-dim); max-width: 460px; margin: 0 0 22px; line-height: 1.5; }
.hp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.hp-cta .btn { text-decoration: none; padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.hp-cta-main { color: #fff; box-shadow: 0 6px 24px rgba(108,92,231,.35); }
.hp-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-dim); }
.hp-stats b { color: var(--text); font-weight: 700; }
.hp-hero-art { display: flex; justify-content: center; align-items: center; }
.hp-hero-art img { width: min(360px, 100%); height: auto; filter: drop-shadow(0 20px 40px rgba(108,92,231,.35)); animation: hp-float 6s ease-in-out infinite; }
@keyframes hp-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .hp-hero-art img { animation: none; } }
.hp-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 1100px; margin: 0 auto 26px; }
.hp-step { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.hp-step:hover { border-color: var(--accent); transform: translateY(-1px); }
.hp-step-icon { font-size: 24px; line-height: 1; flex: none; }
.hp-step b { display: block; font-size: 14px; font-weight: 700; }
.hp-step small { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.35; margin-top: 2px; }
/* The Workshop page (renderWorkshop) still uses the centred hero and the text panels. */
.home-hero { text-align: center; padding: 40px 0 32px; position: relative; }
.home-hero::before { content: ''; position: absolute; left: 50%; top: -70px; width: 760px; height: 360px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(108,92,231,.22), transparent 65%); pointer-events: none; }
.home-hero > * { position: relative; }
.home-h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 800; line-height: 1.15; margin: 0 0 8px; }
.home-lead { font-size: 15px; color: var(--text-dim); max-width: 620px; margin: 0 auto 24px; line-height: 1.6; }
.home-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; max-width: 1000px; margin: 0 auto; text-align: left; }
.home-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px 20px 18px; display: flex; flex-direction: column; box-shadow: 0 0 0 4px rgba(108,92,231,.05); }
.home-panel-icon { font-size: 26px; margin-bottom: 10px; }
.home-panel h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.home-panel p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0 0 14px; flex: 1; }
.home-panel .btn { align-self: flex-start; text-decoration: none; }
.home-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0 14px; border-top: 1px solid var(--border); }
.home-bar-title { font-size: 18px; font-weight: 800; margin-right: 6px; }
.home-bar-n { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-left: 4px; }
.home-tabs { display: flex; gap: 2px; flex-wrap: wrap; }
.home-tab { background: none; border: 1px solid transparent; color: var(--text-dim); font-size: 13px; padding: 5px 11px; border-radius: 20px; cursor: pointer; font-family: inherit; }
.home-tab:hover { color: var(--text); background: var(--surface2); }
.home-tab.active { color: var(--text); background: var(--surface2); border-color: var(--border); }
.home-bar-sep { width: 1px; height: 20px; background: var(--border); }
.home-search { margin-left: auto; }
.home-search input { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; color: var(--text); padding: 6px 12px; font-size: 13px; width: 180px; font-family: inherit; }
.home-search input:focus { outline: none; border-color: var(--accent); }
.home-new { border-radius: 20px; }
.home-grid .ls-wrap { max-width: none; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.home-grid .ls-card { border-radius: 12px; transition: transform .15s, border-color .15s; }
.home-grid .ls-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.home-grid .ls-info { padding: 10px 12px 11px; }
.home-grid .ls-info > div:first-child > span:first-child { font-size: 14px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.home-card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); margin-top: 5px; position: relative; z-index: 3; }
.home-card-meta a { color: var(--text-dim); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-card-meta a:hover { color: var(--accent-light); }
@media (max-width: 860px) { .hp-hero { grid-template-columns: 1fr; text-align: center; padding: 28px 0 16px; } .hp-hero-copy { padding-left: 0; } .hp-lead { margin-left: auto; margin-right: auto; } .hp-cta, .hp-stats { justify-content: center; } .hp-hero-art { order: -1; } .hp-hero-art img { width: 160px; } .hp-steps { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .home-hero { padding: 24px 0 20px; } }
@media (max-width: 640px) { .home-search { margin-left: 0; width: 100%; } .home-search input { width: 100%; } }

/* ── Packages list ───────────────────────────────────────────── */
.pk-page { max-width: 1400px; margin: 0 auto; padding: 28px 20px 48px; }
.pk-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.pk-head h1 { margin: 0 0 6px; font-size: 28px; }
.pk-head p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.6; max-width: 680px; }
.pk-head-cta { padding-top: 6px; }
.pk-bar { border-top: 1px solid var(--border); }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pk-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
.pk-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.pk-mosaic { display: grid; gap: 2px; aspect-ratio: 2 / 1; overflow: hidden; background: var(--border); grid-template-columns: 2fr 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.pk-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; background: #0d0d12; min-height: 0; }
.pk-mosaic[data-n="5"] img:first-child, .pk-mosaic[data-n="3"] img:first-child { grid-row: 1 / 3; }
.pk-mosaic[data-n="4"] { grid-template-columns: 1fr 1fr; }
.pk-mosaic[data-n="3"] { grid-template-columns: 2fr 1fr; }
.pk-mosaic[data-n="2"] { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr); }
.pk-mosaic[data-n="1"] { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
.pk-mosaic-none { display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 40%, #1c1c28, #0d0d12); }
.pk-mosaic-ph { font-size: 44px; opacity: .5; }
.pk-body { padding: 14px 16px 14px; display: flex; flex-direction: column; flex: 1; }
.pk-title { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.pk-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.pk-sub span { color: var(--accent-light); }
.pk-desc { font-size: 13px; color: var(--text-dim); line-height: 1.55; margin: 0 0 12px; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pk-desc-none { opacity: .5; font-style: italic; }
.pk-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--text-dim); margin-top: auto; }
.pk-badge { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 2px 8px; font-size: 11px; color: var(--text-dim); }
.pk-badge-open { color: var(--success); border-color: rgba(0,184,148,.4); }
.pk-copy { font-size: 11px; padding: 3px 9px; }
[data-theme="light"] .pk-mosaic img { background: #e4e4ec; }

/* Suggest an improvement: an inline panel under the viewer (no pop-up) */
.suggest-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.suggest-panel.hidden { display: none; }
.suggest-panel .sg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.suggest-panel .sg-cam { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.suggest-panel .sg-cam-now { font-family: ui-monospace, monospace; font-size: 11px; opacity: .8; }
.suggest-panel .sg-help { cursor: help; color: var(--accent); }
.suggest-panel textarea { width: 100%; }
.suggest-panel .sg-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.suggest-panel .sg-more summary { cursor: pointer; font-size: 12px; color: var(--text-dim); }
.suggest-panel .sg-more select, .suggest-panel .sg-more input { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: 6px 10px; font-size: 13px; width: 100%; margin-top: 6px; }

/* header: fewer items, the rest behind a menu */
.nav-more { position: relative; display: inline-block; }
.nav-more summary { list-style: none; cursor: pointer; padding: 4px 8px; color: var(--text-dim); border-radius: var(--radius); }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more[open] summary, .nav-more summary:hover { color: var(--text); background: var(--surface2); }
.nav-more-menu { position: absolute; right: 0; top: 100%; z-index: 50; min-width: 170px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; display: flex; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.nav-more-menu a { padding: 6px 10px; border-radius: 6px; color: var(--text); white-space: nowrap; }
.nav-more-menu a:hover { background: var(--surface2); }

/* Site footer: the studio credit and the legal links (every page, outside the SPA's #app) */
.site-footer { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center;
  max-width: 1200px; margin: 32px auto 0; padding: 18px 20px 28px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 13px; }
.site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--text); }
.site-footer-links { display: flex; gap: 16px; }

/* ── Workshop page (renderWorkshop): the home layout plus a few extras ── */
.ws .home-hero { padding-bottom: 20px; }
.ws-ver { font-size: 14px; font-weight: 600; color: var(--text-dim); vertical-align: middle; margin-left: 6px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ws-actions .btn { text-decoration: none; padding: 10px 18px; }
.ws-note { font-size: 12px; color: var(--text-dim); max-width: 640px; margin: 14px auto 0; line-height: 1.6; }
.ws-h2 { font-size: 20px; font-weight: 700; margin: 34px auto 10px; max-width: 1000px; }
.ws-p { font-size: 14px; color: var(--text-dim); line-height: 1.65; max-width: 1000px; margin: 0 auto 14px; }
.ws a { color: var(--accent-light); }
.ws a.btn { color: var(--text); }
.ws a.btn-primary { color: #fff; }
.ws code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--surface2); padding: 1px 5px; border-radius: 4px; }
.ws-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; max-width: 1000px; margin: 0 auto; }
.ws-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.ws-code { position: relative; max-width: 1000px; margin: 0 auto; }
.ws-code pre { white-space: pre-wrap; word-break: break-all; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 64px 14px 14px; overflow: auto; font-size: 12.5px; line-height: 1.55; }
.ws-code .btn { position: absolute; top: 8px; right: 8px; }
.ws .home-panels.ws-four { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.ws-open { max-width: 1000px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 22px; font-size: 14px; line-height: 1.65; color: var(--text-dim); box-shadow: 0 0 0 4px rgba(108,92,231,.05); }
.ws-open p { margin: 0 0 10px; }
.ws-open ul { margin: 0 0 6px; padding-left: 20px; }
.ws-open li { margin: 4px 0; }
.ws-open b { color: var(--text); }

/* ── Favorites (♥) and packages (📦) ───────────────────────────────── */
.fav-btn.pkg-btn { right: 46px; font-size: 16px; }
.fav-btn.pkg-btn.fav-active { background: var(--accent); color: #fff; }
.ls-card:hover .fav-btn { opacity: 1; }
@media (hover: none) { .fav-btn { opacity: 1; } }  /* no hover on touch screens: always show the buttons */
nav a.nav-fav { display: inline-flex; align-items: center; gap: 3px; color: var(--text-dim); font-size: 17px; padding: 4px 8px; text-decoration: none; }
nav a.nav-fav:hover { color: #f44336; }
#fav-count { font-size: 11px; font-weight: 700; color: var(--text-dim); }
#fav-count:empty { display: none; }
.pkg-pop { position: fixed; z-index: 9999; width: 270px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: 0 8px 32px rgba(0,0,0,.5); font-size: 13px; animation: fav-pop-in .14s ease; }
.pkg-pop-head { font-weight: 600; margin-bottom: 2px; }
.pkg-pop-head b { color: var(--accent-light); }
.pkg-pop-name { color: var(--text-dim); font-size: 12px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkg-pop-list { max-height: 180px; overflow: auto; margin: 0 -6px 8px; }
.pkg-pop-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.pkg-pop-row:hover { background: var(--surface2); }
.pkg-pop-row.is-default { background: rgba(108,92,231,.14); }
.pkg-pop-pname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-pop-n { color: var(--text-dim); font-size: 11px; }
.pkg-pop-new { display: flex; gap: 6px; }
.pkg-pop-new input { flex: 1; min-width: 0; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); padding: 5px 8px; font-size: 12px; }
.pkg-pop-nudge { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 11.5px; line-height: 1.5; }
.pkg-pop-nudge a { color: var(--accent-light); }
.fav-nudge { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 9998; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: min(92vw, 640px); background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 32px rgba(0,0,0,.5); font-size: 13px; color: var(--text-dim); }
.fav-nudge b { color: var(--text); }
.fav-nudge-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 14px; padding: 2px 4px; }
.fav-nudge-bar { max-width: 1000px; margin: 8px auto 0; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 12px 16px; font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.fav-nudge-bar a { color: var(--accent-light); }
.fav-page .muted { color: var(--text-dim); }
.fav-pkg { max-width: 1000px; margin: 0 auto 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.fav-pkg ul { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.fav-pkg a { color: var(--accent-light); }
.fav-x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 11px; }
.fav-x:hover { color: var(--danger); }

/* icon card: heart count and the package button together, bottom right */
.home-card-right { display: inline-flex; align-items: center; gap: 8px; }
.pkg-inline { background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 14px; line-height: 1; opacity: .6; filter: grayscale(1); }
.pkg-inline:hover, .pkg-inline.fav-active { opacity: 1; filter: none; }
