:root {
  --bg: #07060f;
  --panel: rgba(17, 15, 36, 0.62);
  --panel-strong: rgba(22, 19, 46, 0.86);
  --border: rgba(150, 165, 255, 0.14);
  --border-hot: rgba(77, 243, 255, 0.45);
  --text: #e9eaff;
  --muted: #8d92b9;
  --cyan: #4df3ff;
  --pink: #ff4fd8;
  --violet: #8b5cf6;
  --lime: #b6ff4d;
  --amber: #ffc24d;
  --red: #ff5470;
  --radius: 18px;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --sans: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}

@property --angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--cyan);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

::selection {
  background: rgba(255, 79, 216, 0.35);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.35);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}

kbd {
  font-family: var(--mono);
  font-size: 0.8em;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
}

code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--cyan);
  word-break: break-all;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85em;
}
.warn-text {
  color: var(--amber);
}
.error-line {
  color: var(--red);
  font-size: 0.9em;
}

/* ------------------------------------------------------------------ background */

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.bg-blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  animation: drift 26s ease-in-out infinite alternate;
}
.bg-blob.a {
  background: radial-gradient(circle, #5b2bd6, transparent 65%);
  top: -25vmax;
  left: -15vmax;
}
.bg-blob.b {
  background: radial-gradient(circle, #c0268f, transparent 65%);
  bottom: -30vmax;
  right: -20vmax;
  animation-duration: 32s;
}
.bg-blob.c {
  background: radial-gradient(circle, #0d7d9c, transparent 65%);
  top: 20vh;
  left: 40vw;
  width: 40vmax;
  height: 40vmax;
  opacity: 0.22;
  animation-duration: 38s;
}
@keyframes drift {
  to {
    transform: translate(8vmax, 6vmax) scale(1.15);
  }
}
.bg-noise {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------------ shell */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(7, 6, 15, 0.9), rgba(7, 6, 15, 0.55));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

/* Desktop app: frameless window with native buttons drawn over the top-right corner. */
.desktop .topbar {
  -webkit-app-region: drag;
  min-height: 46px;
  padding-top: 6px;
  padding-bottom: 6px;
  padding-right: 156px;
}
.desktop .topbar button,
.desktop .topbar a,
.desktop .topbar input,
.desktop .topbar .core-pill {
  -webkit-app-region: no-drag;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  /* Allowed to shrink, and to clip rather than push: the nav sits next to it and was being
     drawn straight over the slogan once the two no longer fitted. */
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
}
.brand .logo {
  flex: none;
}
.logo {
  position: relative;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--cyan), var(--violet) 50%, var(--pink));
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sheen 6s linear infinite;
}
.logo::before,
.logo::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.logo::before {
  animation: glitch-a 4.5s infinite steps(1);
  text-shadow: -2px 0 rgba(255, 79, 216, 0.6);
}
.logo::after {
  animation: glitch-b 4.5s infinite steps(1);
  text-shadow: 2px 0 rgba(77, 243, 255, 0.6);
}
@keyframes sheen {
  to {
    background-position: 200% 0;
  }
}
@keyframes glitch-a {
  0%, 88%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  90% { clip-path: inset(20% 0 55% 0); transform: translate(-3px, 0); }
  93% { clip-path: inset(60% 0 10% 0); transform: translate(3px, 0); }
  96% { clip-path: inset(5% 0 80% 0); transform: translate(-2px, 0); }
}
@keyframes glitch-b {
  0%, 89%, 100% { clip-path: inset(100% 0 0 0); transform: none; }
  91% { clip-path: inset(70% 0 5% 0); transform: translate(3px, 0); }
  94% { clip-path: inset(30% 0 45% 0); transform: translate(-3px, 0); }
  97% { clip-path: inset(10% 0 75% 0); transform: translate(2px, 0); }
}
.tagline {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  /* The slogan is the first thing to give way when the bar gets tight — never the logo,
     and never by overlapping whatever comes after it. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  flex: none;
}
.menu-toggle {
  display: none;
}
.menu-glyph {
  display: grid;
  gap: 4px;
  width: 18px;
}
.menu-glyph i {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}
.menu-glyph.open i:first-child { transform: translateY(6px) rotate(45deg); }
.menu-glyph.open i:nth-child(2) { opacity: 0; }
.menu-glyph.open i:last-child { transform: translateY(-6px) rotate(-45deg); }

/* Below this the bar has no room for a slogan at all; the logo and nav keep their space. */
@media (max-width: 1180px) {
  .tagline {
    display: none;
  }
}

.nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}
.nav button {
  position: relative;
  border: 0;
  background: none;
  padding: 7px 18px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s;
}
.nav-label {
  position: relative;
  z-index: 1;
}
.nav button.on {
  color: #0b0a18;
}
.nav-pill {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), #a78bfa);
  box-shadow: 0 0 22px rgba(77, 243, 255, 0.45);
}

.core-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44vw;
}
.core-pill i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.core-pill.ready i {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.avatar-total-number {
  display: inline-block;
  color: var(--text);
  font-weight: 700;
  animation: avatar-total-tick 220ms ease-out;
}
@keyframes avatar-total-tick {
  from { opacity: 0.45; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
.core-pill.loading i {
  background: var(--amber);
  animation: blink 0.8s infinite alternate;
}
.core-pill.error i {
  background: var(--red);
}
@keyframes blink {
  to {
    opacity: 0.25;
  }
}

.main {
  flex: 1;
  padding: 16px 18px 22px;
  min-height: 0;
}

/* ------------------------------------------------------------------ glass panels */

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel {
  padding: 16px;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2,
.panel h2 {
  margin: 0;
  font-size: 13px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 600;
}
.settings .panel h2 {
  font-family: var(--sans);
  font-size: 18px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text);
  margin-bottom: 6px;
}
.glyph {
  color: var(--cyan);
  margin-right: 4px;
}

.find-grid {
  display: grid;
  grid-template-columns: minmax(290px, 340px) minmax(0, 1fr) minmax(340px, 430px);
  gap: 16px;
  height: calc(100vh - 92px);
  min-height: 560px;
}
.find-grid > .panel {
  overflow-y: auto;
  overflow-x: hidden;
}

/* ------------------------------------------------------------------ buttons */

.primary-btn {
  position: relative;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  color: #0a0918;
  background: linear-gradient(100deg, var(--cyan), #a78bfa 55%, var(--pink));
  box-shadow: 0 6px 26px -8px rgba(77, 243, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  text-decoration: none;
}
.primary-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.6s;
}
.primary-btn:hover:not(:disabled)::after {
  transform: translateX(120%);
}
.primary-btn:hover:not(:disabled) {
  box-shadow: 0 8px 34px -6px rgba(255, 79, 216, 0.7);
  filter: saturate(1.2);
}
.primary-btn.wide {
  width: 100%;
}

.ghost-btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 8px 14px;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.ghost-btn:hover:not(:disabled) {
  border-color: var(--border-hot);
  background: rgba(77, 243, 255, 0.08);
}
.ghost-btn.small {
  padding: 4px 10px;
  font-size: 13px;
}
.ghost-btn.danger:hover {
  border-color: var(--red);
  color: var(--red);
  background: rgba(255, 84, 112, 0.08);
}
.icon-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.icon-btn:hover {
  background: rgba(255, 84, 112, 0.2);
}
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--cyan);
  text-align: left;
}
.link-btn:hover {
  text-decoration: underline;
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(10, 9, 24, 0.3);
  border-top-color: #0a0918;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}
.seg button {
  border: 0;
  background: none;
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: var(--muted);
}
.seg button.on {
  background: rgba(77, 243, 255, 0.16);
  color: var(--cyan);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.toggle.small {
  font-size: 12.5px;
  color: var(--muted);
}
.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle span {
  position: relative;
  width: 34px;
  height: 19px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  transition: background 0.2s;
  flex: none;
}
.toggle span::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.25s cubic-bezier(0.5, 1.6, 0.4, 1), background 0.2s;
}
.toggle input:checked + span {
  background: rgba(77, 243, 255, 0.25);
}
.toggle input:checked + span::after {
  transform: translateX(15px);
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.toggle input:focus-visible + span {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

input:not([type]),
input[type='text'],
input[type='search'],
input[type='password'],
input[type='email'],
input[type='url'],
select,
textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.32);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
/* A dropdown styled like the fields around it, with our own chevron — the native one ignores
   the dark theme on Windows and lands as a light grey wedge. */
select {
  font: inherit;
  color: inherit;
  appearance: none;
  cursor: pointer;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) center, calc(100% - 12px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select option {
  background: #141229;
  color: var(--text);
}
input:not([type]):focus,
input[type='url']:focus,
select:focus,
textarea:focus {
  border-color: var(--border-hot);
  box-shadow: 0 0 0 3px rgba(77, 243, 255, 0.12);
}
textarea {
  resize: vertical;
}

.badge {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-transform: lowercase;
  white-space: nowrap;
}
.badge.public {
  color: var(--lime);
  border-color: rgba(182, 255, 77, 0.35);
}
.badge.private {
  color: var(--amber);
  border-color: rgba(255, 194, 77, 0.35);
}
.badge.src {
  color: #c4b5fd;
}

/* ------------------------------------------------------------------ scanner */

.dropzone {
  --angle: 0deg;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 30px 18px 22px;
  border-radius: 16px;
  cursor: pointer;
  background:
    linear-gradient(var(--panel-strong), var(--panel-strong)) padding-box,
    conic-gradient(from var(--angle), transparent 0 60%, var(--cyan), var(--pink), transparent 90%) border-box;
  border: 1.5px solid transparent;
  animation: rotate-border 4s linear infinite;
  outline: none;
}
.dropzone.over {
  animation-duration: 1s;
  box-shadow: 0 0 40px rgba(77, 243, 255, 0.3);
}
@keyframes rotate-border {
  to {
    --angle: 360deg;
  }
}
.dropzone strong {
  font-size: 17px;
}
.dropzone p {
  margin: 0;
  color: var(--muted);
}
.dropzone small {
  color: var(--muted);
  opacity: 0.8;
  margin-top: 8px;
  line-height: 1.4;
}
.drop-orbit {
  position: relative;
  width: 86px;
  height: 86px;
  margin-bottom: 10px;
}
.drop-orbit span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--cyan);
  animation: spin 2.4s linear infinite;
}
.drop-orbit span:nth-child(2) {
  inset: 12px;
  border-top-color: var(--pink);
  animation-duration: 1.7s;
  animation-direction: reverse;
}
.drop-orbit span:nth-child(3) {
  inset: 28px;
  border: 0;
  background: radial-gradient(circle, var(--cyan), transparent 70%);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    transform: scale(0.6);
    opacity: 0.5;
  }
}

.crop-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}
.crop-box {
  position: relative;
  width: 100%;
  max-height: 46vh;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  overflow: hidden;
  margin: 0 auto;
}
.crop-box img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}
.crop-rect {
  position: absolute;
  border: 1px solid var(--cyan);
  box-shadow: 0 0 0 9999px rgba(4, 3, 12, 0.6), 0 0 18px rgba(77, 243, 255, 0.5) inset;
  pointer-events: none;
}
.crop-rect .c {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid var(--cyan);
}
.crop-rect .tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.crop-rect .tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; }
.crop-rect .bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; }
.crop-rect .br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }
.scan-area {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 34%;
  background: linear-gradient(180deg, transparent, rgba(77, 243, 255, 0.05) 60%, rgba(77, 243, 255, 0.5) 98%, #fff 100%);
  border-bottom: 1px solid var(--cyan);
  box-shadow: 0 6px 18px rgba(77, 243, 255, 0.6);
  animation: scan 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(300%); }
}
.scan-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(77, 243, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(77, 243, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(180deg, transparent, #000 50%, transparent);
  animation: grid-fade 1.6s ease-in-out infinite;
}
@keyframes grid-fade {
  50% { opacity: 0.3; }
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 2px 0;
}

.analysis {
  margin-top: 14px;
}
.stages {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.stages li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--muted);
  transition: color 0.3s;
}
.stages li i {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  flex: none;
}
.stages li.active {
  color: var(--text);
}
.stages li.active i {
  border-color: transparent;
  border-top-color: var(--cyan);
  border-right-color: var(--cyan);
  animation: spin 0.7s linear infinite;
}
.stages li.done {
  color: var(--cyan);
}
.stages li.done i {
  background: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.stages li.done i::after {
  content: '';
  position: absolute;
  left: 3.5px;
  top: 1px;
  width: 3px;
  height: 7px;
  border: solid #07060f;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.chip-group {
  margin-top: 12px;
}
.chip-group h3 {
  margin: 0 0 7px;
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.chip-group.bases {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips.tight {
  gap: 5px;
  margin: 8px 0;
}
.chip {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--text);
  max-width: 100%;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.chip span {
  position: relative;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip:hover {
  border-color: var(--border-hot);
  box-shadow: 0 0 14px rgba(77, 243, 255, 0.25);
}
.chip.active {
  border-color: var(--cyan);
  background: rgba(77, 243, 255, 0.15);
  color: var(--cyan);
}
.chip-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--violet), var(--pink));
}
.chip.text {
  border-color: rgba(77, 243, 255, 0.4);
  color: var(--cyan);
}
.chip.author {
  border-color: rgba(255, 79, 216, 0.45);
  color: #ff9fe9;
}
.chip.avatarId,
.chip.authorId {
  border-color: rgba(182, 255, 77, 0.45);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
}
.chip.species {
  border-color: rgba(139, 92, 246, 0.5);
}
.chip.trait {
  color: var(--muted);
}
.chip.base {
  background: transparent;
  font-size: 12px;
}

/* ------------------------------------------------------------------ results */

.results {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.searchbar {
  position: sticky;
  top: -16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 16px;
  margin: -4px -4px 0;
  border-radius: 14px;
  background: var(--panel-strong);
  border: 1px solid var(--border);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.mobile-image-btn,
.searchbar .visually-hidden {
  display: none;
}
.searchbar:focus-within {
  border-color: var(--border-hot);
  box-shadow: 0 0 0 4px rgba(77, 243, 255, 0.08), 0 0 40px -10px rgba(77, 243, 255, 0.5);
}
.searchbar input {
  flex: 1;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
  padding: 6px 0 !important;
  font-size: 16px;
}
.search-icon {
  color: var(--cyan);
  font-size: 20px;
}

.provider-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.provider-row .spacer {
  flex: 1;
}
.provider-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
}
.provider-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.provider-pill em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}
.provider-pill.ok i {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}
.provider-pill.bad i {
  background: var(--red);
}
.provider-pill.skip i {
  background: var(--amber);
}
.search-label {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}

.rank-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  overflow: hidden;
}
.rank-progress .bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.rank-progress .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 12px var(--cyan);
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(14, 12, 30, 0.75);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color 0.25s, box-shadow 0.25s;
  will-change: transform;
}
.card:hover {
  border-color: var(--border-hot);
  box-shadow: 0 14px 40px -14px rgba(77, 243, 255, 0.55);
}
.card.selected {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink), 0 14px 44px -12px rgba(255, 79, 216, 0.7);
}
.card.top::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 15px;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), var(--lime), transparent 30%, var(--cyan) 50%, transparent 80%, var(--lime));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotate-border 3s linear infinite;
  z-index: 2;
  pointer-events: none;
}
.card.missing {
  opacity: 0.5;
}
.card-img {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #05040c;
}
.glare {
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: overlay;
}
.card-body {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 9px;
}
.card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-text strong {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-text small {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .badge {
  position: absolute;
  top: 7px;
  background: rgba(5, 4, 12, 0.75);
  backdrop-filter: blur(4px);
}
.ref-badge {
  left: 7px;
  color: var(--lime) !important;
  border-color: rgba(182, 255, 77, 0.45) !important;
}
.card .badge.private {
  right: 7px;
}

.card.skeleton {
  aspect-ratio: 4 / 4.1;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.03) 30%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.fade-img {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.fade-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.5s, transform 0.7s;
}
.fade-img.ok img {
  opacity: 1;
  transform: none;
}
.fade-img.loading {
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.02) 30%, rgba(255, 255, 255, 0.07) 50%, rgba(255, 255, 255, 0.02) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.3s linear infinite;
}
.img-missing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 2px, transparent 2px 4px), #07060f;
}
.img-missing span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  animation: blink 1.2s steps(2) infinite;
}

.match-ring {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
}
.match-ring svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
}
.ring-fill {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px currentColor);
}
.match-ring span {
  position: relative;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.results-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 6px 0 4px;
}
.prismics-more {
  max-width: 100%;
}
.prismics-load-error {
  flex: 1 0 100%;
  color: var(--red);
  font-size: 12px;
  text-align: center;
}
.prismics-scan-status {
  flex: 1 0 100%;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
}
.empty h3 {
  color: var(--text);
  margin: 12px 0 6px;
}
.empty p {
  line-height: 1.55;
  margin: 0;
}
.empty.error {
  color: var(--red);
}
.empty-art {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  border-radius: 28px;
  display: grid;
  place-items: center;
  background: conic-gradient(from var(--angle), var(--cyan), var(--violet), var(--pink), var(--cyan));
  animation: rotate-border 5s linear infinite;
  box-shadow: 0 0 60px -10px rgba(139, 92, 246, 0.8);
}
.empty-art span {
  width: 86px;
  height: 86px;
  border-radius: 23px;
  background: var(--bg);
  display: grid;
  place-items: center;
  font-size: 44px;
  font-weight: 700;
  color: var(--cyan);
}

.local-hits {
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(120deg, rgba(182, 255, 77, 0.07), rgba(77, 243, 255, 0.05));
  border: 1px solid rgba(182, 255, 77, 0.25);
}
.glow-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--lime);
}
.glow-title.dim {
  color: var(--muted);
  margin-top: 12px;
}
.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(182, 255, 77, 0.7);
  animation: ping 1.6s infinite;
}
@keyframes ping {
  70% { box-shadow: 0 0 0 10px rgba(182, 255, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(182, 255, 77, 0); }
}
.hit-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hit {
  flex: none;
  width: 200px;
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px;
  text-align: left;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}
.hit:hover,
.hit.sel {
  border-color: var(--lime);
}
.hit .fade-img {
  width: 64px;
  height: 48px;
  border-radius: 8px;
  flex: none;
}
.hit div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.hit strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hit small {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hit .conf {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 10.5px;
}

/* ------------------------------------------------------------------ details */

.details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.details-empty {
  display: grid;
  place-items: center;
  min-height: 160px;
  text-align: center;
  color: var(--muted);
  padding: 8px 12px;
  line-height: 1.5;
}
.details-empty p {
  margin: 0;
}
.details-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.details-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.details-thumb {
  width: 96px !important;
  height: 72px !important;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.details-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}
.avatar-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  word-break: break-word;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}
.id-line {
  align-self: flex-start;
  border: 0;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-line:hover {
  color: var(--cyan);
}
.id-line span {
  margin-left: 4px;
}
.id-line.static {
  display: inline-block;
}
.desc {
  position: relative;
  font-size: 13.5px;
  color: #c9cbea;
  line-height: 1.5;
}
.desc p {
  margin: 0;
  max-height: 4.5em;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  mask-image: linear-gradient(#000 60%, transparent);
}
.desc.open p {
  max-height: none;
  mask-image: none;
}

.trail {
  border-radius: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--border);
}
.trail h3,
.community h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.trail-links {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.store-link {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(182, 255, 77, 0.35);
  background: rgba(182, 255, 77, 0.06);
  transition: transform 0.15s, box-shadow 0.2s;
}
.store-link:hover {
  transform: translateX(3px);
  box-shadow: 0 0 20px -6px var(--lime);
}
.store-link small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.credits {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 13px;
}
.credits li span {
  display: inline-block;
  min-width: 54px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
}
.credits em {
  color: var(--muted);
  margin-left: 4px;
}
.store-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.store-buttons.subtle {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.store-btn {
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 9px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 0.15s, filter 0.2s, box-shadow 0.2s;
}
.store-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.2);
}
.store-btn.booth { background: rgba(252, 77, 80, 0.22); border-color: rgba(252, 77, 80, 0.5); }
.store-btn.gumroad { background: rgba(255, 144, 232, 0.2); border-color: rgba(255, 144, 232, 0.5); }
.store-btn.jinxxy { background: rgba(139, 92, 246, 0.25); border-color: rgba(139, 92, 246, 0.6); }
.store-btn.itch { background: rgba(250, 92, 92, 0.15); border-color: rgba(250, 92, 92, 0.4); }
.store-btn.vrc { background: rgba(77, 243, 255, 0.1); border-color: rgba(77, 243, 255, 0.35); color: var(--cyan); }
.community .hit-row {
  gap: 8px;
}
.mini-shot {
  flex: none;
  width: 92px;
  height: 64px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.mini-shot:hover {
  border-color: var(--lime);
}
.details-actions {
  padding-bottom: 2px;
}

/* ------------------------------------------------------------------ modal + forms */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 2, 10, 0.6);
  backdrop-filter: blur(8px);
  perspective: 1200px;
}
.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  background: var(--panel-strong);
}
.modal.wide {
  width: min(880px, 100%);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  margin: 0;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-body {
  padding: 16px;
  overflow-y: auto;
}

.ref-form {
  display: grid;
  gap: 12px;
}
.ref-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.inline {
  display: flex;
  gap: 8px;
  align-items: center;
}
.inline input.short,
input.short {
  max-width: 150px;
}
.ref-image {
  display: grid;
  place-items: center;
  min-height: 120px;
  max-height: 260px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-hot);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}
.ref-image img {
  max-width: 100%;
  max-height: 258px;
  display: block;
}
fieldset.links {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
  margin: 0;
}
fieldset.links legend {
  font-size: 13px;
  color: var(--muted);
  padding: 0 6px;
}
fieldset.links .ghost-btn {
  justify-self: start;
}
.form-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  padding: 11px 14px;
  font-size: 14px;
  border-left: 3px solid var(--cyan);
  background: var(--panel-strong);
}
.toast.good { border-left-color: var(--lime); }
.toast.warn { border-left-color: var(--amber); }
.toast.bad { border-left-color: var(--red); }

/* ------------------------------------------------------------------ library */

.library {
  max-width: 1500px;
  margin: 0 auto;
}
.library-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.library-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  background: linear-gradient(90deg, var(--text), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.library-head p {
  margin: 0;
}
.library-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.lib-search {
  width: 240px !important;
}
.masonry {
  columns: 270px;
  column-gap: 14px;
}
.ref-card {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  break-inside: avoid;
  text-align: left;
  overflow: hidden;
  transform-style: preserve-3d;
}
.ref-card:hover {
  border-color: var(--border-hot);
}
.ref-shot {
  position: relative;
  width: 100%;
}
.ref-shot .badge {
  position: absolute;
  top: 8px;
  background: rgba(5, 4, 12, 0.75);
}
.ref-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 6px;
}
.ref-meta > div:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ref-meta strong {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-meta small {
  color: var(--muted);
}
.ref-thumb {
  width: 44px !important;
  height: 33px !important;
  border-radius: 6px;
  flex: none;
}
.ref-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px;
  font-size: 12px;
  color: #c4b5fd;
}
.ref-info .ref-tags {
  padding: 0;
}
.ref-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 18px;
}
.ref-big {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.ref-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ref-info p {
  margin: 0;
  line-height: 1.5;
  color: #c9cbea;
}

/* ------------------------------------------------------------------ settings */

.settings {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  gap: 16px;
}
.settings .panel {
  padding: 20px;
}
.settings .panel > p {
  line-height: 1.55;
  margin: 0 0 12px;
}
.settings form.inline {
  margin-bottom: 8px;
}
.vrchat-auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin: 14px 0 10px;
}
.vrchat-auth-form > label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}
.vrchat-auth-form > label input,
.vrchat-auth-form > label select {
  width: 100%;
  min-width: 0;
}
.vrchat-auth-form > button,
.vrchat-auth-form > .inline {
  justify-self: start;
}
.vrchat-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 0 10px;
  padding: 12px;
  border-color: rgba(77, 243, 255, 0.22);
}
.vrchat-session > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}
.vrchat-session strong {
  overflow-wrap: anywhere;
}
.vrchat-session button {
  flex: none;
}
.vrchat-security-note,
.vrchat-error {
  display: block;
  margin-top: 8px;
  line-height: 1.5;
}
.notice {
  padding: 12px 16px;
  color: var(--amber);
}
.provider-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
  display: grid;
  gap: 8px;
}
.provider-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s;
}
.provider-list li.on {
  border-color: rgba(77, 243, 255, 0.3);
}
.prov-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.prov-text code {
  color: var(--muted);
  font-size: 11.5px;
}
.test.ok { color: var(--lime); }
.test.bad { color: var(--red); }
.test.testing { color: var(--muted); }
.add-prov {
  margin-bottom: 14px !important;
}
.range {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.range input {
  accent-color: var(--cyan);
}
.model-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  gap: 8px;
}
.model-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.model-list li i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.model-list li.ready i { background: var(--lime); box-shadow: 0 0 8px var(--lime); }
.model-list li.loading i { background: var(--amber); animation: blink 0.8s infinite alternate; }
.model-list li.error i { background: var(--red); }
.model-list li span {
  flex: 1;
}
.model-list li em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1280px) {
  .find-grid {
    grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
    height: auto;
  }
  .find-grid > .panel {
    max-height: calc(100vh - 92px);
  }
  .find-grid > .details {
    grid-column: 1 / -1;
    max-height: none;
  }
  .core-pill {
    display: none;
  }
}

@media (max-width: 1000px) {
  .topbar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 9px 12px;
  }
  .tagline {
    display: none;
  }
  .brand {
    flex: 1 1 auto;
    order: 1;
  }
  .menu-toggle {
    display: inline-flex;
    order: 2;
    min-height: 40px;
    padding: 7px 11px;
    border-radius: 12px;
  }
  .topbar .core-pill {
    display: flex;
    flex: 1 1 100%;
    order: 4;
    justify-content: center;
    max-width: 100%;
    margin-left: 0;
    padding: 7px 10px;
    font-size: 11px;
  }
  .topbar .account-btn,
  .topbar .account-wrap {
    order: 3;
    margin-left: 0;
  }
  .topbar .get-app {
    display: none;
  }
  .nav {
    order: 5;
    display: none;
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border-radius: 16px;
  }
  .nav.mobile-open {
    display: grid;
  }
  .nav button {
    min-height: 42px;
    padding-inline: 10px;
    white-space: nowrap;
  }
  .main {
    padding: 10px 12px calc(20px + env(safe-area-inset-bottom, 0px));
  }
  .find-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 12px;
  }
  .find-grid > .results { order: 0; }
  .find-grid > .scanner { order: 1; }
  .find-grid.has-shot > .scanner { order: 0; }
  .find-grid.has-shot > .results { order: 1; }
  .mobile-image-btn { display: inline-flex; flex: none; }
  .searchbar { min-width: 0; gap: 7px; padding: 7px; }
  .searchbar input { min-width: 0; }
  .searchbar > .primary-btn { flex: none; padding: 9px 12px; }
  .find-grid > .panel {
    max-height: none;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .form-grid,
  .ref-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .lib-search {
    width: 100% !important;
  }
  .searchbar {
    top: 0;
  }
}

@media (max-width: 560px) {
  .topbar { gap: 7px; padding-inline: 10px; }
  .brand .logo { font-size: 27px; }
  .topbar .account-btn,
  .topbar .account-wrap { max-width: 42vw; }
  .empty { padding: 24px 12px; }
  .empty-art { width: 70px; height: 70px; border-radius: 22px; }
  .empty-art span { width: 62px; height: 62px; border-radius: 18px; font-size: 34px; }
  .empty p { font-size: 13px; }
  .dropzone { padding: 20px 14px 16px; }
  .drop-orbit { width: 64px; height: 64px; margin-bottom: 4px; }
  .drop-orbit span:nth-child(2) { inset: 9px; }
  .drop-orbit span:nth-child(3) { inset: 21px; }
  .dropzone small { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------------------------------------------------------------------ Prismics catalog */

.prismics-page {
  max-width: 1500px;
  margin: 0 auto;
  padding: 12px 0 32px;
}
.prismics-heading {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 24px;
  margin: 4px 0 24px;
}
.prismics-heading h1 {
  margin: 8px 0 6px;
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.045em;
  line-height: 1;
}
.prismics-heading h1 span {
  color: var(--cyan);
}
.prismics-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.prismics-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #b1b4d1;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}
.prismics-eyebrow > span,
.prismics-sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 12px rgba(182, 255, 77, 0.72);
}
.prismics-sync-card {
  flex: 0 0 280px;
  align-self: center;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 15px 17px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(77, 243, 255, 0.08), rgba(139, 92, 246, 0.1)), var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04), 0 12px 35px rgba(0, 0, 0, 0.16);
}
.prismics-sync-top {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 10px var(--mono);
  letter-spacing: 0.08em;
  color: var(--muted);
}
.prismics-sync-card strong {
  font-size: 24px;
  line-height: 1.1;
}
.prismics-sync-card strong small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.prismics-sync-card > span {
  color: var(--muted);
  font-size: 11px;
}
.prismics-sync-card .prismics-auto-update {
  color: #a9d5dc;
}
.prismics-sync-card.syncing .prismics-sync-dot {
  background: var(--amber);
  box-shadow: 0 0 12px rgba(255, 194, 77, 0.7);
  animation: prismics-pulse 1.2s ease-in-out infinite alternate;
}
.prismics-progress {
  height: 4px;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}
.prismics-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  transition: width 0.2s ease;
}
.prismics-toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.prismics-search {
  min-width: 220px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-strong);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.prismics-search:focus-within {
  border-color: var(--border-hot);
  box-shadow: 0 0 0 3px rgba(77, 243, 255, 0.08);
}
.prismics-search > span {
  color: var(--cyan);
  font-size: 25px;
  line-height: 1;
}
.prismics-search input {
  width: 100%;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}
.prismics-search input:focus {
  border: 0;
  box-shadow: none;
}
.prismics-search input::placeholder {
  color: #73799d;
}
.prismics-search button {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
}
.prismics-filters {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(12, 10, 26, 0.65);
}
.prismics-filters button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  transition: 0.18s ease;
}
.prismics-filters button small {
  font: 9px var(--mono);
  color: #747999;
}
.prismics-filters button:hover,
.prismics-filters button.active {
  border-color: rgba(77, 243, 255, 0.24);
  background: rgba(77, 243, 255, 0.09);
  color: var(--text);
}
.prismics-filters button.active small {
  color: var(--cyan);
}
.prismics-result-line {
  min-height: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
  color: var(--muted);
  font: 11px var(--mono);
}
.prismics-stale {
  color: var(--amber);
}
.prismics-notice {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 194, 77, 0.25);
  border-radius: 10px;
  background: rgba(255, 194, 77, 0.06);
  color: #f3d99d;
  font-size: 12px;
}
.prismics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 14px;
}
.prismics-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(150deg, rgba(22, 19, 46, 0.95), rgba(11, 10, 25, 0.92));
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.prismics-card:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 243, 255, 0.4);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28), 0 0 24px rgba(77, 243, 255, 0.06);
}
.prismics-card-image {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 10%, rgba(139, 92, 246, 0.26), transparent 65%), #080714;
}
.prismics-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.prismics-image-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: radial-gradient(circle, rgba(77, 243, 255, 0.12), transparent 52%);
  color: rgba(77, 243, 255, 0.45);
  font: 22px var(--mono);
  letter-spacing: 0.2em;
}
.prismics-card-kicker,
.prismics-marketplace {
  position: absolute;
  top: 8px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(5, 4, 12, 0.7);
  backdrop-filter: blur(6px);
  color: #d7dcff;
  font: 8px var(--mono);
  letter-spacing: 0.06em;
}
.prismics-card-kicker {
  left: 8px;
}
.prismics-marketplace {
  right: 8px;
  border-color: rgba(255, 79, 216, 0.45);
  color: #ffb2ef;
}
.prismics-card-content {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 11px 12px 12px;
}
.prismics-card-content h3 {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prismics-author {
  overflow: hidden;
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prismics-flags,
.prismics-style-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.prismics-flag,
.prismics-style-list span {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #c5c8e1;
  font: 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prismics-flag.pc { border-color: rgba(77, 243, 255, 0.27); color: #a6faff; }
.prismics-flag.quest { border-color: rgba(182, 255, 77, 0.23); color: #d4ff9b; }
.prismics-flag.ios { border-color: rgba(255, 79, 216, 0.24); color: #ffc1f1; }
.prismics-flag.impostor { border-color: rgba(139, 92, 246, 0.38); color: #c6adff; }
.prismics-flag.warning { border-color: rgba(255, 194, 77, 0.3); color: #ffda97; }
.prismics-style-list {
  min-height: 22px;
  margin-top: 7px;
}
.prismics-style-list span {
  border-color: rgba(139, 92, 246, 0.23);
  color: #c8b8ff;
  font-family: var(--sans);
}
.prismics-id {
  overflow: hidden;
  margin-top: 8px;
  color: #878cac;
  font: 9px var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prismics-open {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 11px;
  color: var(--cyan);
  font-size: 11px;
  text-decoration: none;
}
.prismics-open:hover {
  color: #fff;
}
.prismics-open span {
  font-size: 14px;
}
.prismics-skeleton {
  min-height: 330px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.065), rgba(255, 255, 255, 0.025));
  background-size: 220% 100%;
  animation: prismics-shimmer 1.5s linear infinite;
}
.prismics-empty {
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
  border: 1px dashed rgba(150, 165, 255, 0.2);
  border-radius: 16px;
  background: rgba(17, 15, 36, 0.35);
  text-align: center;
}
.prismics-empty h2 {
  margin: 12px 0 6px;
  font-size: 18px;
}
.prismics-empty p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.prismics-loader {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(77, 243, 255, 0.17);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: prismics-spin 0.8s linear infinite;
}
.prismics-load-more {
  display: block;
  margin: 22px auto 0;
  padding: 10px 17px;
  border: 1px solid rgba(77, 243, 255, 0.3);
  border-radius: 11px;
  background: rgba(77, 243, 255, 0.07);
  color: var(--cyan);
  font-size: 12px;
}
.prismics-load-more:hover:not(:disabled) {
  background: rgba(77, 243, 255, 0.13);
}
.prismics-footnote {
  margin-top: 18px;
  color: #777c9e;
  text-align: center;
  font-size: 10px;
}
@keyframes prismics-pulse { to { opacity: 0.4; } }
@keyframes prismics-shimmer { to { background-position: -220% 0; } }
@keyframes prismics-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .prismics-toolbar { align-items: stretch; flex-direction: column; }
  .prismics-filters { justify-content: stretch; }
  .prismics-filters button { flex: 1; justify-content: center; }
}
@media (max-width: 700px) {
  .prismics-page { padding-top: 4px; }
  .prismics-heading { flex-direction: column; gap: 14px; }
  .prismics-sync-card { flex-basis: auto; width: 100%; }
  .prismics-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
  .prismics-card-content { padding: 9px; }
  .prismics-filters button { flex-direction: column; gap: 3px; padding: 7px 3px; font-size: 11px; }
  .prismics-filters button small { font-size: 8px; }
}
/* Accounts, the Downloadable catalog and the admin panel. */

/* ------------------------------------------------------------------ account */

.topbar .core-pill {
  order: 2;
}
.topbar .account-btn,
.topbar .account-wrap {
  order: 3;
  margin-left: 10px;
}
.account-btn {
  min-height: 34px;
  padding: 6px 18px;
}
.account-wrap {
  position: relative;
}
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  transition: border-color 0.2s;
}
.account-chip:hover {
  border-color: var(--border-hot);
}
.avatar-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #0b0a18;
  font-weight: 700;
  font-size: 13px;
}
.account-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(240px, calc(100vw - 16px));
  min-width: min(200px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  display: grid;
  gap: 2px;
  z-index: 80;
}
.account-head {
  display: grid;
  min-width: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.account-head strong {
  overflow-wrap: anywhere;
}
.account-menu button {
  min-height: 44px;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text);
}
.account-menu button:hover {
  background: rgba(77, 243, 255, 0.1);
}

.auth-form {
  display: grid;
  gap: 12px;
}
.auth-form label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.auth-form p {
  margin: 0;
  line-height: 1.55;
}
.seg.wide {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.seg.wide button {
  padding: 8px 10px;
}
.spinner.dark {
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: var(--cyan);
}

/* ------------------------------------------------------------------ downloadable */

.prod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.prod-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 16px;
}
.prod-card:hover {
  border-color: var(--border-hot);
  box-shadow: 0 16px 46px -18px rgba(77, 243, 255, 0.5);
}
.prod-shot {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #05040c;
}
.prod-shot .badge {
  position: absolute;
  top: 8px;
  background: rgba(5, 4, 12, 0.8);
  backdrop-filter: blur(4px);
}
.store-badge {
  right: 8px;
  text-transform: none;
}
.store-badge.booth { color: #ff7577; border-color: rgba(252, 77, 80, 0.5); }
.store-badge.gumroad { color: #ff90e8; border-color: rgba(255, 144, 232, 0.5); }
.store-badge.jinxxy { color: #c4b5fd; border-color: rgba(139, 92, 246, 0.6); }
.store-badge.payhip { color: #7ddcff; border-color: rgba(77, 200, 255, 0.5); }
.store-badge.vrmodels { color: #b6ff4d; border-color: rgba(182, 255, 77, 0.5); }
.draft-badge {
  left: 8px;
}
.prod-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 13px 13px;
}
.prod-body strong {
  font-size: 14.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-body small {
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prod-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.price {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--lime);
}
.price.big {
  font-size: 18px;
}

.prod-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
}
.prod-main {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #05040c;
}
.prod-thumbs {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
}
.prod-thumbs button {
  flex: none;
  width: 64px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  padding: 0;
  background: none;
}
.prod-thumbs button.on {
  border-color: var(--cyan);
}
.prod-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.prod-desc {
  margin: 0;
  line-height: 1.55;
  color: #c9cbea;
  white-space: pre-wrap;
  max-height: 11em;
  overflow-y: auto;
}
.prod-facts {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
  font-size: 13px;
}
.prod-facts dt {
  color: var(--muted);
}
.prod-facts dd {
  margin: 0;
  word-break: break-word;
}

/* ------------------------------------------------------------------ upload form */

.upload-form {
  display: grid;
  gap: 14px;
}
.upload-form > label,
.import-bar label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.import-bar {
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(120deg, rgba(77, 243, 255, 0.07), rgba(139, 92, 246, 0.05));
  border: 1px solid rgba(77, 243, 255, 0.28);
  display: grid;
  gap: 10px;
}
.paste-box {
  display: grid;
  gap: 6px;
  justify-items: start;
}
.paste-box textarea {
  font-family: var(--mono);
  font-size: 11px;
}
.import-shots {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.image-gallery-editor {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}
.image-add-row {
  display: grid;
  gap: 8px;
}
.image-url-row input[type='url'] {
  flex: 1;
  min-width: 0;
}
.image-file-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.image-file-picker span {
  font-size: 12px;
}
.gallery-file-list {
  display: grid;
  gap: 5px;
}
.gallery-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 12px;
}
.gallery-file-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-file-row small {
  color: var(--muted);
  white-space: nowrap;
}
.gallery-file-row button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
}
.gallery-file-row button:hover:not(:disabled) {
  color: var(--red);
}
.import-shot {
  position: relative;
  width: 92px;
  height: 70px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.import-shot button {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 0;
  background: rgba(5, 4, 12, 0.8);
  color: var(--text);
  font-size: 11px;
  line-height: 1;
}
.import-shot button:hover {
  background: var(--red);
}
.file-drop {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 22px 16px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-hot);
  background: rgba(0, 0, 0, 0.3);
  cursor: pointer;
  text-align: center;
}
.file-drop.has {
  border-style: solid;
  border-color: var(--lime);
  background: rgba(182, 255, 77, 0.06);
}
.upload-file-stack {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.2);
}
.upload-file-stack > strong {
  color: var(--cyan);
  font-size: 12px;
}
.upload-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 12.5px;
}
.upload-file-row > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-file-row > small {
  flex: none;
  color: var(--muted);
  font-family: var(--mono);
}
.upload-file-row > button {
  flex: none;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.upload-file-row > button:hover:not(:disabled) {
  border-color: var(--red);
  color: var(--red);
}
.upload-file-row > button:disabled {
  opacity: 0.45;
  cursor: default;
}
.prod-attachment {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.18);
}
.prod-attachment > div:first-child {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
.prod-attachment strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.prod-attachment small {
  color: var(--muted);
}
.prod-attachment .ghost-btn {
  flex: none;
}
.upload-progress {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--muted);
}
.upload-progress .bar {
  height: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.upload-progress .bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 0.2s;
}

/* ------------------------------------------------------------------ admin */

.admin {
  max-width: 1100px;
}
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.admin-head p {
  margin: 0;
}
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--border);
}
.stat strong {
  font-size: 22px;
  font-family: var(--mono);
  color: var(--cyan);
}
.stat small {
  color: var(--muted);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 600;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(150, 165, 255, 0.07);
  vertical-align: middle;
}
.admin-table tr.spent {
  opacity: 0.5;
}
.row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}
.code-chip {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid rgba(182, 255, 77, 0.4);
  background: rgba(182, 255, 77, 0.07);
  color: var(--lime);
}
.code-chip:hover {
  background: rgba(182, 255, 77, 0.16);
}
.invite-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.invite-form label:not(.toggle) {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}
.invite-form label.grow {
  flex: 1;
  min-width: 180px;
}
.invite-form input[type='number'] {
  width: 110px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.32);
}
.ue-select {
  height: 30px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 6px;
}
.drive-state {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
}
.drive-state .spacer {
  flex: 1;
}
.drive-state i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
}
.drive-state.on i {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.steps-list {
  margin: 0 0 14px;
  padding-left: 20px;
  display: grid;
  gap: 6px;
  line-height: 1.55;
  color: #c9cbea;
}
.copyable {
  user-select: all;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
}
.drive-test {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.3);
}
.drive-test.ok {
  border-color: rgba(182, 255, 77, 0.45);
}
.drive-test.bad {
  border-color: rgba(255, 84, 112, 0.5);
}
.drive-test ol {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.drive-test li {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13.5px;
}
.drive-test .mark {
  flex: none;
  width: 14px;
  font-family: var(--mono);
}
.drive-test li.ok .mark {
  color: var(--lime);
}
.drive-test li.bad .mark {
  color: var(--red);
}
.drive-test .what {
  flex: none;
}
.drive-test .ms {
  margin-left: auto;
  flex: none;
  font-family: var(--mono);
}
.drive-test p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.uri-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.drive-alt {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
}
.drive-alt summary {
  cursor: pointer;
  color: var(--cyan);
  font-size: 14px;
}
.drive-alt p {
  margin: 10px 0;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ upload queue */

.queue-hint {
  display: block;
  line-height: 1.5;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
}
.queue-hint strong {
  color: var(--cyan);
}

.upq {
  position: fixed;
  /* Bottom-left: toasts own the bottom-right corner, and z-index stays under the modal (50) so an
     open dialog is never covered by the panel of the upload it just started. */
  left: 20px;
  bottom: 20px;
  z-index: 40;
  width: min(350px, calc(100vw - 40px));
  display: grid;
  gap: 8px;
  padding: 13px 14px;
  border-radius: 16px;
  /* Near-opaque: it floats over avatar art, and glass alone leaves the text behind it readable. */
  background: rgba(13, 11, 28, 0.96);
  box-shadow: 0 26px 60px -24px rgba(0, 0, 0, 0.9);
}
.upq-head {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}
.upq-head strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upq-actions {
  display: flex;
  gap: 2px;
  flex: none;
}
.upq-icon {
  border: 0;
  background: none;
  padding: 2px 5px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}
.upq-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}
.upq-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.upq-dot.good {
  background: var(--lime);
  box-shadow: 0 0 10px var(--lime);
}
.upq-dot.bad {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
}
.spinner.small {
  width: 13px;
  height: 13px;
  border-width: 2px;
  flex: none;
}
.upq-bar {
  height: 7px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.upq-bar.thin {
  height: 4px;
}
.upq-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 0.25s;
}
.upq-bar i.settled {
  background: var(--lime);
}
.upq-sub {
  display: flex;
  gap: 10px;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}
.upq-sub .link-btn {
  flex: none;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
}
.upq-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
  max-height: 230px;
  overflow-y: auto;
}
.upq-item {
  display: grid;
  gap: 4px;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
  font-size: 12.5px;
}
.upq-item.running {
  border-color: var(--border-hot);
}
.upq-item.error {
  border-color: rgba(255, 84, 112, 0.5);
}
.upq-item.done,
.upq-item.cancelled {
  opacity: 0.68;
}
.upq-item small {
  font-family: var(--mono);
  font-size: 11px;
}
.upq-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.upq-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upq-pct {
  font-family: var(--mono);
  color: var(--cyan);
  flex: none;
}
.upq-ok {
  color: var(--lime);
  flex: none;
}
.upq-item .link-btn {
  flex: none;
  font-size: 12px;
}

.queued-badge {
  color: var(--cyan);
  border-color: var(--border-hot);
}
.cyan-text {
  color: var(--cyan);
}
.card-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 0;
}

@media (max-width: 1000px) {
  .prod-detail {
    grid-template-columns: minmax(0, 1fr);
  }
  .account-name {
    display: none;
  }
  .admin-table {
    font-size: 12.5px;
  }
  .invite-form {
    display: grid;
  }
}

/* ------------------------------------------------------------------ landing */

.landing {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 48px;
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 100vh;
}
.landing-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 34px;
  letter-spacing: 1px;
  background: linear-gradient(92deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 18px;
}
.landing-pitch h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.5px;
}
.landing-pitch > p {
  margin: 0 0 26px;
  font-size: 16px;
  line-height: 1.6;
  max-width: 50ch;
}
.landing-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}
.landing-points li {
  display: grid;
  gap: 3px;
  padding-left: 16px;
  border-left: 2px solid var(--border-hot);
}
.landing-points strong {
  font-size: 15px;
}
.landing-points span {
  font-size: 13.5px;
  line-height: 1.5;
}
.landing-form {
  padding: 26px 26px 24px;
  border-radius: var(--radius);
}
.landing-form h2 {
  margin: 0 0 14px;
  font-size: 21px;
}
.landing-form .seg {
  margin-bottom: 16px;
}
.landing-form .auth-form {
  display: grid;
  gap: 13px;
}
.primary-btn.wide {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.landing-foot {
  margin: 14px 0 0;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .landing {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 32px 18px;
  }
  .landing-points {
    display: none;
  }
}
.restore-box {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 12px 13px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-hot);
  background: rgba(77, 243, 255, 0.06);
}
.restore-box p {
  margin: 0;
  line-height: 1.5;
}

.get-app {
  flex: none;
  white-space: nowrap;
  order: 4;
}
.mobile-get-app {
  display: none;
}
.landing-get-app {
  margin-top: 22px;
}
.get-app-content > p:first-child {
  margin: 0 0 16px;
}
.get-app-options {
  display: grid;
  gap: 10px;
}
.app-option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-hot);
  border-radius: 14px;
  background: rgba(6, 8, 24, 0.38);
}
.app-option.unavailable {
  border-color: var(--border);
}
.app-option-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--cyan);
  font-size: 23px;
  background: rgba(77, 243, 255, 0.1);
}
.app-option-copy {
  min-width: 0;
}
.app-option-copy h3 {
  margin: 0 0 3px;
  font-size: 15px;
}
.app-option-copy p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.app-option-copy small {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
}
.app-option-copy small span {
  color: var(--muted);
}
.app-option-action {
  justify-self: end;
}
.app-option-action a {
  text-decoration: none;
}
.get-app-foot {
  margin: 15px 0 0;
  line-height: 1.5;
}
@media (max-width: 560px) {
  .app-option {
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
  }
  .app-option-icon {
    width: 36px;
    height: 36px;
  }
  .app-option-action {
    grid-column: 2;
    justify-self: start;
    margin-top: 4px;
  }
}

/* Keep compact controls inside the viewport and make close/remove actions usable on touch. */
.main,
.main > *,
.modal,
.modal-head,
.modal-body {
  min-width: 0;
}
.modal {
  max-width: 100%;
}
.modal-head h2 {
  flex: 1 1 auto;
  min-width: 0;
}
.modal-head .icon-btn {
  flex: 0 0 40px;
}
.external-link-confirm {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.external-link-confirm p {
  margin: 0;
  line-height: 1.5;
}
.external-link-confirm code {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--cyan);
}
.external-link-confirm .form-foot {
  flex-wrap: wrap;
}
.gallery-file-row button,
.upload-file-row > button {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  place-items: center;
  font-size: 17px;
}
.import-shot button {
  top: 4px;
  right: 4px;
  width: 30px;
  height: 30px;
  font-size: 15px;
}
.upq-icon {
  display: grid;
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  place-items: center;
}
.prismics-search {
  min-width: 0;
}
.prismics-search button {
  display: grid;
  flex: 0 0 40px;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
}

@media (max-width: 1000px) {
  .modal-backdrop {
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .modal-head .icon-btn {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }
  .gallery-file-row button,
  .upload-file-row > button {
    flex-basis: 42px;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
  .upq-icon {
    min-width: 44px;
    min-height: 44px;
  }
  .prismics-search button {
    flex-basis: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  .external-link-confirm .form-foot > button {
    min-height: 44px;
  }
}

@media (max-width: 560px) {
  .import-shot button {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }
  .new-feed-filters,
  .new-source-filters,
  .prismics-filters {
    max-width: 100%;
  }
  .new-source-filters {
    width: 100%;
  }
  .new-source-filter {
    min-height: 40px;
  }
  .prismics-filters button {
    min-width: 0;
    min-height: 44px;
  }
  .external-link-confirm .form-foot > button {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------ categories */

.cat-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 16px;
}
.cat-filter button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
  color: var(--muted);
  font-size: 13.5px;
}
.cat-filter button:hover {
  color: var(--text);
  border-color: var(--border-hot);
}
.cat-filter button.on {
  color: #0a0918;
  border-color: transparent;
  background: linear-gradient(92deg, var(--cyan), var(--pink));
  font-weight: 600;
}
.cat-count {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}
.cat-filter button.on .cat-count {
  background: rgba(10, 9, 24, 0.22);
}

.cat-badge {
  left: 8px;
  top: 8px;
}
.cat-badge.prefab { color: var(--amber); border-color: rgba(255, 194, 77, 0.5); }
.cat-badge.textures { color: var(--pink); border-color: rgba(255, 79, 216, 0.5); }
.cat-badge.tools { color: var(--lime); border-color: rgba(182, 255, 77, 0.5); }
.cat-badge.vrca { color: var(--cyan); border-color: rgba(48, 234, 245, 0.5); }

/* The draft badge shares that corner, so stack them when both are showing. */
.prod-shot .draft-badge ~ .cat-badge {
  top: 34px;
}

/* ------------------------------------------------------------------ updates */

.update-check-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 22px 8px;
}
.update-check-row button {
  min-width: 148px;
  justify-content: center;
}

.update-bar {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 22px 14px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-hot);
  background: linear-gradient(92deg, rgba(77, 243, 255, 0.1), rgba(255, 79, 216, 0.08));
  font-size: 14px;
}
.update-bar .spacer {
  flex: 1;
}
.update-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}
.primary-btn.small {
  padding: 6px 14px;
  font-size: 13px;
}

@media (max-width: 760px) {
  .mobile-get-app {
    display: inline-flex;
    position: fixed;
    z-index: 40;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(4, 4, 15, 0.55), 0 0 18px rgba(77, 243, 255, 0.22);
  }
  .update-check-row {
    margin: 0 14px 8px;
  }
  .update-bar {
    margin: 0 14px 12px;
    flex-wrap: wrap;
  }
}

.app-version {
  flex: none;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.26);
}
@media (max-width: 1100px) {
  .app-version {
    display: none;
  }
}

/* ------------------------------------------------------------------ Cached New feed */

.new-feed {
  max-width: 1680px;
  margin: 0 auto;
}
.new-feed-head {
  align-items: flex-end;
}
.new-feed-tools {
  width: min(100%, 520px);
  flex-direction: column;
  align-items: stretch;
}
.new-feed-tools .lib-search {
  width: 100% !important;
}
.new-feed-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  flex-wrap: wrap;
}
.new-source-filters {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
}
.new-source-filter {
  padding: 6px 10px;
  border-color: transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}
.new-source-filter span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}
.new-source-filter.active {
  border-color: rgba(77, 243, 255, 0.32);
  background: rgba(77, 243, 255, 0.1);
  color: var(--cyan);
}
.new-source-filter.active span {
  color: var(--cyan);
}
.new-category-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}
.new-category-filter select {
  min-width: 180px;
  max-width: 245px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #151226;
  color: var(--text);
}
.new-feed-note {
  margin-top: 5px !important;
}
.new-feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
  align-items: start;
  gap: 18px;
}
.new-feed-results {
  min-width: 0;
}
.our-avatar-logger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border-color: rgba(77, 243, 255, 0.2);
}
.our-avatar-logger > div {
  min-width: 0;
}
.our-avatar-logger strong {
  color: var(--cyan);
}
.our-avatar-logger p {
  margin: 4px 0 0;
  line-height: 1.45;
}
.our-avatar-logger button {
  flex: 0 0 auto;
}
.our-avatar-logger-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}
.our-avatar-logger-actions .toggle {
  white-space: nowrap;
}
.avatar-log-console {
  min-width: 0;
  margin-top: 10px;
  border: 1px solid rgba(77, 243, 255, 0.17);
  border-radius: 10px;
  background: rgba(5, 8, 20, 0.48);
  overflow: hidden;
}
.avatar-log-console-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 9px;
  border-bottom: 1px solid var(--border);
}
.avatar-log-console-head strong {
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.avatar-log-console-head button {
  min-height: 27px;
  padding: 3px 9px;
  font-size: 0.72rem;
}
.avatar-log-console-output {
  max-height: 142px;
  overflow: auto;
  padding: 4px 8px;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  scrollbar-width: thin;
}
.avatar-log-console-output > p {
  margin: 3px 1px;
}
.avatar-log-console-line {
  display: grid;
  grid-template-columns: auto auto auto auto minmax(90px, 1fr);
  align-items: baseline;
  gap: 3px 8px;
  padding: 3px 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  overflow-wrap: anywhere;
}
.avatar-log-console-line:last-child {
  border-bottom: 0;
}
.avatar-log-console-line time,
.avatar-log-console-source,
.avatar-log-console-stage {
  color: var(--muted);
  white-space: nowrap;
}
.avatar-log-console-source {
  color: var(--cyan);
  font-weight: 700;
}
.avatar-log-console-line.outcome-error .avatar-log-console-stage,
.avatar-log-console-line.outcome-retry .avatar-log-console-stage,
.avatar-log-console-line.outcome-skipped .avatar-log-console-stage {
  color: #ffc45d;
}
.avatar-log-console-line.outcome-saved .avatar-log-console-stage {
  color: #8dff70;
}
.avatar-log-console-line code {
  color: #b9a8ff;
}
.avatar-log-console-message {
  min-width: 0;
}
.avatar-log-console-id {
  grid-column: 2 / -1;
  color: #8dff70 !important;
}
.new-log-description {
  max-height: 190px;
  overflow: auto;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.new-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 13px;
}
.new-item-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  text-align: left;
  border-radius: 15px;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.new-item-card:hover,
.new-item-card.selected {
  border-color: var(--border-hot);
  transform: translateY(-2px);
  box-shadow: 0 14px 38px -20px rgba(77, 243, 255, 0.65);
}
.new-item-card.selected {
  box-shadow: 0 0 0 1px var(--cyan), 0 14px 38px -20px rgba(77, 243, 255, 0.65);
}
.new-item-image {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #05040c;
}
.avatar-log-preview {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 92px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    radial-gradient(circle at 50% 38%, rgba(77, 243, 255, 0.16), transparent 43%),
    radial-gradient(circle at 82% 84%, rgba(229, 69, 220, 0.14), transparent 40%),
    linear-gradient(145deg, rgba(26, 25, 56, 0.98), rgba(8, 12, 25, 0.98));
  color: var(--cyan);
}
.avatar-log-preview strong {
  display: grid;
  width: clamp(44px, 36%, 76px);
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(77, 243, 255, 0.48);
  border-radius: 22px;
  background: rgba(9, 14, 29, 0.68);
  box-shadow: 0 0 28px rgba(77, 243, 255, 0.18), inset 0 0 18px rgba(229, 69, 220, 0.1);
  font-family: var(--mono);
  font-size: clamp(20px, 6vw, 34px);
  letter-spacing: 0.04em;
}
.avatar-log-preview span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-align: center;
}
.new-adult-badge,
.new-state-badge {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  background: rgba(5, 4, 12, 0.82);
  backdrop-filter: blur(4px);
}
.new-adult-badge {
  color: #ff8f9f;
  border-color: rgba(255, 84, 112, 0.6);
}
.new-state-badge {
  left: 8px;
  right: auto;
}
.new-source-badge {
  position: absolute;
  z-index: 1;
  left: 8px;
  bottom: 8px;
  border-color: rgba(77, 243, 255, 0.35);
  background: rgba(5, 4, 12, 0.84);
  color: var(--cyan);
  text-transform: none;
  backdrop-filter: blur(4px);
}
.new-source-badge.vrmodels {
  border-color: rgba(255, 79, 216, 0.38);
  color: #ff8de4;
}
.new-source-badge.avatar-source {
  border-color: rgba(171, 111, 255, 0.42);
  color: #c8a7ff;
}
.new-item-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 10px 11px 11px;
}
.new-item-body strong,
.new-item-body small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.new-item-body strong {
  font-size: 14px;
}
.new-item-body small {
  color: var(--muted);
}
.new-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.new-item-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.new-feed .new-item-meta span:first-child {
  color: var(--lime);
  font-family: var(--mono);
}
.new-feed .new-item-card.vrmodels .new-item-meta span:first-child {
  color: var(--cyan);
  font-family: inherit;
}
.new-feed .new-item-card.avatar-source .new-item-meta span:first-child {
  color: #c8a7ff;
  font-family: inherit;
}
.new-source-home {
  margin-top: 8px;
  text-decoration: none;
}
.new-show-more {
  display: flex;
  margin: 18px auto 0;
}
.new-item-details {
  position: sticky;
  top: 14px;
  min-width: 0;
  padding: 14px;
  border-radius: 16px;
  overflow: auto;
  max-height: calc(100vh - 120px);
}
.new-detail-image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 11px;
  background: #05040c;
}
.new-detail-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin: 13px 0 15px;
}
.new-detail-heading h2,
.new-detail-empty h2 {
  margin: 4px 0 0;
  font-size: 19px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.eyebrow {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.new-facts {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 9px 8px;
  margin: 0;
  padding: 13px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.new-facts dt {
  color: var(--muted);
}
.new-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.new-facts a {
  color: var(--cyan);
  text-decoration: none;
}
.new-facts a:hover {
  text-decoration: underline;
}
.new-facts .mono {
  font-family: var(--mono);
}
.new-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 124px;
  overflow: auto;
  padding: 12px 0;
}
.new-tags span {
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 11px;
}
.new-have-btn,
.new-booth-link {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-top: 9px;
  text-decoration: none;
}
.new-external-note {
  margin: 7px 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}
.new-detail-empty {
  padding: 16px 4px;
}
.new-detail-empty p {
  line-height: 1.5;
}

@media (max-width: 1050px) {
  .new-feed-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  .new-item-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}
@media (max-width: 1000px) {
  .new-feed-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .new-item-details {
    position: static;
    max-height: none;
  }
}
@media (max-width: 480px) {
  .new-feed-filters {
    align-items: stretch;
    flex-direction: column;
  }
  .new-source-filters {
    width: 100%;
  }
  .new-source-filter {
    justify-content: center;
    flex: 1;
    padding-inline: 7px;
  }
  .new-category-filter {
    align-items: flex-start;
    flex-direction: column;
  }
  .new-category-filter select {
    width: 100%;
    max-width: none;
  }
  .new-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .our-avatar-logger {
    align-items: stretch;
    flex-direction: column;
  }
  .our-avatar-logger-actions {
    justify-content: space-between;
    flex-wrap: wrap;
  }
  .avatar-log-console-line {
    grid-template-columns: auto auto auto;
  }
  .avatar-log-console-message {
    grid-column: 1 / -1;
  }
  .avatar-log-console-id {
    grid-column: 1 / -1;
  }
  .new-item-body {
    padding: 9px;
  }
  .new-item-meta {
    flex-direction: column;
    gap: 2px;
  }
}

/* ------------------------------------------------------------------ mobile app fit */

@media (max-width: 1000px) {
  .main {
    width: 100%;
    min-width: 0;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .topbar .account-wrap {
    min-width: 0;
    max-width: min(180px, 42vw);
    margin-left: 0;
  }
  .account-chip {
    max-width: 100%;
    min-height: 44px;
  }

  .admin-head {
    align-items: stretch;
  }
  .admin-head .seg {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-head .seg button {
    min-height: 42px;
  }

  .settings form.inline,
  .settings .vrchat-auth-form,
  .settings .add-prov {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }
  .settings form.inline > *,
  .settings .vrchat-auth-form > *,
  .settings .add-prov > * {
    min-width: 0;
    max-width: 100%;
  }
  .settings form.inline .primary-btn,
  .settings .vrchat-auth-form .primary-btn,
  .settings .add-prov .ghost-btn {
    justify-self: start;
    min-height: 44px;
  }
  .settings .add-prov input.short {
    max-width: none;
  }
  .settings .vrchat-session {
    align-items: stretch;
    flex-direction: column;
  }
  .settings .vrchat-session button {
    align-self: flex-start;
  }
  .provider-list li {
    min-width: 0;
    flex-wrap: wrap;
    gap: 9px;
  }
  .provider-list li .prov-text {
    flex: 1 1 calc(100% - 58px);
  }
  .provider-list li > .ghost-btn {
    margin-left: 43px;
  }
  .provider-list li > .ghost-btn + .ghost-btn {
    margin-left: 0;
  }

  .admin-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }
  .admin-table tr {
    white-space: nowrap;
  }
  .row-actions {
    flex-wrap: wrap;
  }

  .modal-backdrop {
    padding: max(12px, env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px))
      max(12px, env(safe-area-inset-left, 0px));
  }
  .modal {
    width: 100%;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    min-height: 0;
  }
  .modal-head {
    flex: none;
  }
  .modal-body {
    min-height: 0;
  }

  .toasts {
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    max-width: min(380px, calc(100vw - 24px));
  }
  .upq {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-height: min(52vh, 440px);
    max-height: min(52dvh, 440px);
    overflow: hidden;
  }
  .upq-list {
    max-height: min(30vh, 240px);
    max-height: min(30dvh, 240px);
  }
}

@media (max-width: 560px) {
  .settings .panel {
    padding: 15px;
  }
  .admin-head .seg {
    gap: 4px;
  }
  .admin-head .seg button {
    padding-inline: 6px;
    font-size: 12px;
  }
  .form-foot > button {
    min-height: 44px;
  }
  .prod-attachment {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .prod-attachment > div:first-child {
    flex: 1 1 calc(100% - 48px);
  }
  .prod-attachment .ghost-btn {
    margin-left: auto;
  }
  .upload-file-row {
    flex-wrap: wrap;
  }
  .upload-file-row > span {
    flex: 1 1 calc(100% - 48px);
  }
  .upload-file-row > small {
    margin-left: 0;
  }
  .toasts {
    right: 10px;
    max-width: calc(100vw - 20px);
  }
  .upq {
    left: 10px;
    right: 10px;
    padding: 11px;
  }
}
