:root {
  color-scheme: light;
  --bg-page: #ebe8e2;
  --bg-panel: #f4f1eb;
  --bg-soft: #f4f1eb;
  --text-primary: #282522;
  --text-secondary: #716b63;
  --border-subtle: rgba(26, 24, 20, 0.08);
  --accent: #a88b5d;
  --accent-soft: rgba(168, 139, 93, 0.13);
  --bg-sticky: rgba(244, 241, 235, 0.94);
  --overlay-muted: rgba(26, 24, 20, 0.16);
  --image-surface: #eceae5;
  --image-info-bg: linear-gradient(transparent, rgba(255, 255, 255, 0.76));
  --image-info-text: #242321;
  --image-info-muted: #6f6250;
  --floating-bg: rgba(255, 255, 255, 0.88);
  --floating-hover: rgba(255, 255, 255, 0.98);
  --bg: var(--bg-page);
  --ink: var(--bg-panel);
  --panel: var(--bg-panel);
  --panel-2: var(--bg-soft);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --quiet: var(--text-secondary);
  --line: var(--border-subtle);
  --line-strong: rgba(26, 24, 20, 0.16);
  --gold: var(--accent);
  --rose: #cf8292;
  --jade: #8eb7a7;
  --warm-shadow: rgba(31, 28, 24, 0.08);
  --velvet: var(--bg-page);
  --shadow: 0 8px 22px rgba(31, 28, 24, 0.08);
  --rail-width: 3.25rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #000000;
  --bg-panel: transparent;
  --bg-soft: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --accent: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --bg-sticky: rgba(0, 0, 0, 0.92);
  --overlay-muted: rgba(0, 0, 0, 0.72);
  --image-surface: #000000;
  --image-info-bg: transparent;
  --image-info-text: #ffffff;
  --image-info-muted: rgba(255, 255, 255, 0.65);
  --floating-bg: rgba(0, 0, 0, 0.62);
  --floating-hover: rgba(10, 10, 10, 0.88);
  --line-strong: rgba(255, 255, 255, 0.18);
  --warm-shadow: transparent;
  --shadow: none;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  background: var(--bg);
}

body {
  position: relative;
  height: auto;
  min-height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background: var(--bg);
}

body::before,
body::after {
  display: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  grid-column: 1;
  grid-row: 1;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  width: var(--rail-width);
  height: 100vh;
  padding: 0.72rem 0.38rem;
  border-right: 1px solid rgba(26, 24, 20, 0.05);
  border-left: 0;
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 0.82rem;
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding-bottom: 0.15rem;
}

.brand > div {
  display: none;
}

.brand-mark {
  width: 2.05rem;
  height: 2.05rem;
  border: 1px solid rgba(26, 24, 20, 0.06);
  border-radius: 0.7rem;
  color: #6f6a61;
  background: rgba(255, 255, 255, 0.46);
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 720;
  letter-spacing: 0;
}

.brand-mark::before {
  content: "SG";
}

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--gold);
  font-size: 0.7rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 0.98rem;
  line-height: 1.1;
  font-weight: 680;
}

.nav-group {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 0.36rem;
}

.nav-item,
.tab,
.icon-button,
.primary-button,
.favorite-button {
  border: 1px solid var(--border-subtle);
  color: var(--text);
  background: transparent;
}

.nav-item {
  position: relative;
  width: 2.35rem;
  min-height: 2.35rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-color: transparent;
  border-radius: 999px;
  color: #7a756c;
  background: transparent;
  text-align: center;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.sidebar .nav-item[hidden] {
  display: none !important;
}

.sidebar .nav-item[data-filter] {
  display: none !important;
}

.nav-item[data-rail-action="settings"] {
  margin-top: auto;
}

.nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 0.55rem);
  top: 50%;
  z-index: 300;
  min-width: max-content;
  padding: 0.38rem 0.55rem;
  border: 1px solid rgba(26, 24, 20, 0.06);
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(31, 28, 24, 0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transform: translate(-0.25rem, -50%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: transparent;
  background: #f4efe7;
  color: #4f4940;
}

.nav-item:hover::after,
.nav-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

.nav-icon {
  position: relative;
  width: 1.08rem;
  height: 1.08rem;
  display: block;
  color: currentColor;
}

.nav-icon-home::before {
  content: "";
  position: absolute;
  left: 0.24rem;
  top: 0.56rem;
  width: 0.86rem;
  height: 0.65rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 0.16rem 0.16rem;
}

.nav-icon-home::after {
  content: "";
  position: absolute;
  left: 0.27rem;
  top: 0.18rem;
  width: 0.78rem;
  height: 0.78rem;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: rotate(45deg);
}

.nav-icon-gallery::before {
  content: "";
  position: absolute;
  left: 0.12rem;
  top: 0.12rem;
  width: 0.42rem;
  height: 0.42rem;
  border: 2px solid currentColor;
  border-radius: 0.12rem;
  box-shadow: 0.68rem 0 0 -2px currentColor, 0 0.68rem 0 -2px currentColor, 0.68rem 0.68rem 0 -2px currentColor;
}

.nav-icon-douyin::before {
  content: "";
  position: absolute;
  left: 0.24rem;
  top: 0.12rem;
  width: 0.62rem;
  height: 0.78rem;
  border: 1.5px solid currentColor;
  border-radius: 0.2rem;
}

.nav-icon-douyin::after {
  content: "";
  position: absolute;
  left: 0.52rem;
  top: 0.37rem;
  width: 0;
  height: 0;
  border-top: 0.18rem solid transparent;
  border-bottom: 0.18rem solid transparent;
  border-left: 0.28rem solid currentColor;
}

.nav-icon-motion::before {
  content: "";
  position: absolute;
  left: 0.08rem;
  top: 0.34rem;
  width: 0.92rem;
  height: 0.42rem;
  border-top: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  border-radius: 50%;
  transform: rotate(-12deg);
}

.nav-icon-motion::after {
  content: "";
  position: absolute;
  right: 0.08rem;
  top: 0.22rem;
  width: 0.28rem;
  height: 0.28rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(34deg);
}

.nav-icon-compare::before,
.nav-icon-compare::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  width: 0.5rem;
  height: 0.95rem;
  border: 2px solid currentColor;
  border-radius: 0.16rem;
}

.nav-icon-compare::before {
  left: 0.12rem;
}

.nav-icon-compare::after {
  right: 0.12rem;
}

.nav-icon-upload::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  right: 0.28rem;
  bottom: 0.16rem;
  height: 0.38rem;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 0.15rem 0.15rem;
}

.nav-icon-upload::after {
  content: "";
  position: absolute;
  left: 0.62rem;
  top: 0.17rem;
  width: 0.1rem;
  height: 0.82rem;
  background: currentColor;
  box-shadow: 0 0 0 1px currentColor;
}

.nav-icon-more::before {
  content: "";
  position: absolute;
  left: 0.16rem;
  top: 0.58rem;
  width: 0.2rem;
  height: 0.2rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0.5rem 0 0 currentColor, 1rem 0 0 currentColor;
}

.nav-icon-settings::before {
  content: "";
  position: absolute;
  left: 0.28rem;
  top: 0.28rem;
  width: 0.78rem;
  height: 0.78rem;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.nav-icon-settings::after {
  content: "";
  position: absolute;
  left: 0.58rem;
  top: 0.58rem;
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 -0.56rem 0 -0.02rem currentColor, 0 0.56rem 0 -0.02rem currentColor, -0.56rem 0 0 -0.02rem currentColor, 0.56rem 0 0 -0.02rem currentColor;
}

.nav-icon-home::before {
  left: 0.2rem;
  top: 0.48rem;
  width: 0.68rem;
  height: 0.5rem;
  border-width: 1.5px;
  border-top: 0;
}

.nav-icon-home::after {
  left: 0.23rem;
  top: 0.16rem;
  width: 0.62rem;
  height: 0.62rem;
  border-top-width: 1.5px;
  border-left-width: 1.5px;
}

.nav-icon-gallery::before {
  left: 0.12rem;
  top: 0.12rem;
  width: 0.32rem;
  height: 0.32rem;
  border-width: 1.5px;
  box-shadow: 0.5rem 0 0 -1.5px currentColor, 0 0.5rem 0 -1.5px currentColor, 0.5rem 0.5rem 0 -1.5px currentColor;
}

.nav-icon-recent::before {
  content: "";
  position: absolute;
  inset: 0.14rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.nav-icon-recent::after {
  content: "";
  position: absolute;
  left: 0.52rem;
  top: 0.3rem;
  width: 0.26rem;
  height: 0.34rem;
  border-left: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-8deg);
  transform-origin: left bottom;
}

.nav-icon-compare::before,
.nav-icon-compare::after {
  top: 0.17rem;
  width: 0.36rem;
  height: 0.74rem;
  border-width: 1.5px;
}

.nav-icon-upload::before {
  left: 0.24rem;
  right: 0.24rem;
  bottom: 0.14rem;
  height: 0.3rem;
  border-width: 1.5px;
  border-top: 0;
}

.nav-icon-upload::after {
  left: 0.5rem;
  top: 0.15rem;
  width: 0.08rem;
  height: 0.66rem;
  box-shadow: 0 0 0 0.75px currentColor;
}

.nav-icon-settings::before {
  left: 0.23rem;
  top: 0.23rem;
  width: 0.62rem;
  height: 0.62rem;
  border-width: 1.5px;
}

.nav-icon-settings::after {
  left: 0.46rem;
  top: 0.46rem;
  width: 0.16rem;
  height: 0.16rem;
  box-shadow: 0 -0.44rem 0 -0.02rem currentColor, 0 0.44rem 0 -0.02rem currentColor, -0.44rem 0 0 -0.02rem currentColor, 0.44rem 0 0 -0.02rem currentColor;
}

.mobile-nav {
  display: none;
}

.pull-refresh-indicator {
  display: none;
}

.mobile-nav-favorite-icon {
  position: relative;
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  color: currentColor;
}

.mobile-nav-favorite-icon::before,
.mobile-nav-favorite-icon::after {
  content: "";
  position: absolute;
  top: 0.32rem;
  width: 0.55rem;
  height: 0.85rem;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 0.55rem 0.55rem 0 0;
  transform-origin: 50% 100%;
}

.mobile-nav-favorite-icon::before {
  left: 0.22rem;
  transform: rotate(-45deg);
}

.mobile-nav-favorite-icon::after {
  right: 0.22rem;
  transform: rotate(45deg);
}

.side-card {
  padding: 1rem;
  border: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-panel) 64%, transparent);
  box-shadow: none;
}

.dna-row {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.72rem;
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.dna-row i {
  height: 0.28rem;
  background: var(--bg-soft);
  overflow: hidden;
}

.dna-row i::before {
  content: "";
  display: block;
  width: var(--value);
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--rose), var(--jade));
}

.drop-zone {
  position: relative;
  min-height: 8.5rem;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 28%, transparent);
  background:
    linear-gradient(135deg, var(--accent-soft), transparent 68%),
    var(--bg-panel);
  display: grid;
  align-content: center;
  gap: 0.36rem;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop-zone.dragging {
  border-color: var(--rose);
  background: color-mix(in srgb, var(--rose) 12%, var(--bg-panel));
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-size: 1.3rem;
}

.drop-zone p {
  margin-bottom: 0;
  color: var(--text);
  font-size: 0.95rem;
}

.drop-zone span,
.side-meta {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.side-meta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.side-meta p {
  margin-bottom: 0.65rem;
}

.main {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  padding: 1.15rem clamp(1rem, 2.7vw, 2.6rem) 2.5rem;
  background: transparent;
}

.module-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.module-cache .editorial-stage,
.module-cache .side-card,
.module-cache .side-meta {
  display: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 5.25rem;
  padding: 0.75rem 0 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg);
  opacity: 1;
  transform: translateY(0);
  transition: transform 220ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.topbar > div:first-child {
  display: none;
}

body.landing-view .topbar,
body.landing-view .gallery,
body.landing-view .shuffle-fab {
  display: none;
}

body.is-landing .sidebar,
body.is-landing .mobile-nav {
  display: none;
}

body.is-landing .shell {
  grid-template-columns: minmax(0, 1fr);
}

body.is-landing .main {
  grid-column: 1;
  min-height: 100vh;
  padding: 0;
  display: grid;
  align-items: center;
}

body.gallery-view .landing-page,
.landing-page[hidden] {
  display: none;
}

body.channel-view .topbar,
body.channel-view .gallery-head,
body.channel-view .gallery,
body.channel-view .shuffle-fab {
  display: none;
}

.channel-page[hidden] {
  display: none;
}

.channel-page {
  min-height: calc(100vh - 3.65rem);
  padding: clamp(2.4rem, 6vw, 6.5rem) clamp(0.25rem, 3vw, 2.2rem);
}

.channel-hero {
  max-width: 54rem;
}

.channel-kicker {
  margin: 0 0 0.9rem;
  color: #9c7645;
  font-size: 0.76rem;
  font-weight: 760;
  letter-spacing: 0.18em;
}

.channel-hero h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(2.6rem, 7vw, 6.4rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.96;
}

.channel-hero > p:last-child {
  max-width: 42rem;
  margin: 1.15rem 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.12rem);
  line-height: 1.8;
}

.channel-empty {
  min-height: 20rem;
  margin-top: clamp(2.5rem, 6vw, 5.5rem);
  padding: clamp(2rem, 5vw, 4.5rem);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid var(--border-subtle);
  border-radius: 2rem;
  background: color-mix(in srgb, var(--bg-panel) 70%, transparent);
}

.channel-empty strong {
  margin-top: 1.25rem;
  color: var(--text-primary);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
}

.channel-empty p {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.channel-empty-icon {
  position: relative;
  width: 4rem;
  height: 4rem;
  display: block;
  border: 1px solid color-mix(in srgb, var(--text-primary) 18%, transparent);
  border-radius: 1.3rem;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
}

.channel-empty-icon-play::after {
  content: "";
  position: absolute;
  left: 1.62rem;
  top: 1.28rem;
  border-top: 0.72rem solid transparent;
  border-bottom: 0.72rem solid transparent;
  border-left: 1.05rem solid currentColor;
}

.channel-empty-icon-motion::before,
.channel-empty-icon-motion::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  width: 2.3rem;
  height: 0.8rem;
  border-top: 2px solid currentColor;
  border-radius: 50%;
}

.channel-empty-icon-motion::before {
  top: 1.15rem;
  transform: rotate(10deg);
}

.channel-empty-icon-motion::after {
  top: 2.05rem;
  transform: rotate(-10deg);
}

@media (max-width: 767px) {
  .channel-page {
    min-height: calc(100dvh - 5.4rem);
    padding: 2.5rem 0.2rem calc(6.8rem + env(safe-area-inset-bottom));
  }

  .channel-empty {
    min-height: 18rem;
    border-radius: 1.4rem;
  }
}

.landing-page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: clamp(2rem, 5vw, 5rem);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 18%, rgba(190, 158, 104, 0.18), rgba(190, 158, 104, 0) 32%),
    radial-gradient(circle at 82% 78%, rgba(120, 105, 82, 0.16), rgba(120, 105, 82, 0) 38%),
    linear-gradient(135deg, #f3eee4 0%, #e8dfd1 46%, #d8cbb8 100%);
}

.landing-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at center, rgba(250, 247, 240, 0.78) 0%, rgba(250, 247, 240, 0.56) 24%, rgba(232, 223, 209, 0.14) 52%, rgba(216, 203, 184, 0.04) 100%);
  pointer-events: none;
}

.landing-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.08), rgba(132, 108, 72, 0.08));
}

.landing-copy {
  display: grid;
  justify-items: center;
  position: relative;
  z-index: 2;
  width: min(640px, calc(100vw - 2rem));
  max-width: 640px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
  transform: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.landing-copy::before {
  content: "";
  position: absolute;
  inset: -90px -130px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at center, rgba(250, 247, 240, 0.94) 0%, rgba(250, 247, 240, 0.84) 38%, rgba(232, 223, 209, 0.42) 70%, rgba(232, 223, 209, 0) 100%);
  filter: blur(12px);
}

.landing-kicker {
  margin-bottom: 1.05rem;
  color: #9a7746;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.landing-copy h2 {
  margin-bottom: 0.6rem;
  color: #1f1d1a;
  font-size: clamp(4.5rem, 9vw, 8rem);
  line-height: 0.9;
  font-weight: 780;
  letter-spacing: 0;
}

.landing-subtitle {
  margin-top: 1.375rem;
  margin-bottom: 0;
  color: #3f3a33;
  font-size: 1.5rem;
  font-weight: 700;
}

.landing-description {
  max-width: 520px;
  margin-top: 1.25rem;
  margin-bottom: 0;
  color: #5f5951;
  font-size: 1rem;
  line-height: 1.8;
}

.landing-actions {
  display: flex;
  max-width: 420px;
  margin-top: 2rem;
  align-items: center;
  justify-content: center;
}

.landing-primary,
.landing-shortcut {
  border: 1px solid rgba(26, 24, 20, 0.08);
  border-radius: 999px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.landing-primary {
  min-height: 3.25rem;
  border-color: transparent;
  color: #ffffff;
  background: #1f1d1a;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  padding: 1rem 2.5rem;
  font-size: 1rem;
  font-weight: 650;
}

.landing-primary:hover {
  transform: translateY(-1px);
  background: #2c2924;
}

.landing-shortcut:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.74);
}

.landing-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-height: 100%;
  pointer-events: none;
}

.landing-visual-glass {
  display: none;
}

.landing-preview-stack {
  position: absolute;
  inset: 0;
}

.landing-visual-card {
  position: absolute;
  aspect-ratio: 0.64;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 28px 90px rgba(31, 29, 26, 0.14);
  transform: rotate(var(--r, 0deg));
  animation: landingFloat 10s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.landing-visual-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1) contrast(1.04) brightness(0.99);
}

@keyframes landingFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--r, 0deg));
  }

  50% {
    transform: translate3d(0, var(--float, -10px), 0) rotate(var(--r, 0deg));
  }
}

.landing-shortcuts {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.landing-shortcut {
  position: relative;
  min-width: 0;
  min-height: 6rem;
  padding: 1.1rem 1.2rem;
  border-radius: 22px;
  display: grid;
  align-content: center;
  gap: 0.35rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.06);
}

.landing-shortcut::after {
  content: "";
  position: absolute;
  right: 1.1rem;
  top: 1.1rem;
  width: 0.48rem;
  height: 0.48rem;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  opacity: 0.34;
  transform: rotate(45deg);
}

.landing-shortcut span {
  color: var(--text-primary);
  font-size: 1.02rem;
  font-weight: 720;
}

.landing-shortcut strong {
  color: #6f6961;
  font-size: 0.82rem;
  line-height: 1.5;
  font-weight: 520;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.75rem);
  line-height: 1;
  font-weight: 680;
}

.toolbar {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.search {
  flex: 1 1 0;
  min-width: 12rem;
  width: auto;
  max-width: none;
  height: 3.75rem;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 1.25rem;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  gap: 0.78rem;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-icon {
  position: relative;
  width: 1.2rem;
  height: 1.2rem;
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 0;
}

.search-icon::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.08rem;
  width: 0.68rem;
  height: 0.68rem;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: 0.08rem;
  bottom: 0.12rem;
  width: 0.44rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
}

.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-primary);
  background: transparent;
  font-size: 1.05rem;
}

.search input::placeholder {
  color: var(--text-secondary);
}

.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--bg-panel);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
}

.icon-button,
.primary-button,
.favorite-button,
.tab {
  min-height: 2.7rem;
  border-radius: 999px;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.icon-button {
  width: 3.45rem;
  min-width: 3.45rem;
  display: grid;
  place-items: center;
}

.topbar .icon-button,
.topbar .primary-button {
  min-height: 2.8rem;
  border-radius: 999px;
}

.topbar .icon-button {
  width: 2.8rem;
  min-width: 2.8rem;
  height: 2.8rem;
  border-color: rgba(26, 24, 20, 0.05);
  color: #6f6a61;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: none;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar .icon-button:hover,
.topbar .icon-button:focus-visible {
  border-color: rgba(26, 24, 20, 0.07);
  color: #4f4940;
  background: rgba(255, 255, 255, 0.82);
}

.topbar .layout-button.is-active,
.topbar .layout-button[aria-pressed="true"] {
  border-color: transparent;
  color: #2f2b25;
  background: #f4efe7;
}

.topbar #uploadButton {
  display: none;
}

.public-browse-mode #uploadButton,
.public-browse-mode #fileInput,
.public-browse-mode #dropZone,
.public-browse-mode [data-mobile-action="upload"],
.public-browse-mode [data-rail-action="upload"],
.public-browse-mode .drawer-upload,
.public-browse-mode .mark-button,
.public-browse-mode [data-mark],
.public-browse-mode [data-filter="cover"],
.public-browse-mode [data-filter="training"],
.public-browse-mode .tile-badge {
  display: none !important;
}

.primary-button {
  min-width: max-content;
  padding: 0 1.2rem;
  border-color: color-mix(in srgb, var(--accent) 52%, transparent);
  background: var(--gold);
  color: color-mix(in srgb, var(--text-primary) 82%, #000);
  font-weight: 720;
}

.filter-button span {
  position: relative;
  width: 1.08rem;
  height: 0.86rem;
  display: block;
  color: currentColor;
}

.filter-button span::before,
.filter-button span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
}

.filter-button span::before {
  top: 0.15rem;
  box-shadow: 0 0.58rem 0 currentColor;
}

.filter-button span::after {
  top: 0.04rem;
  width: 0.24rem;
  height: 0.24rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: var(--bg-soft);
  box-shadow: 0.62rem 0.58rem 0 -1px var(--bg-soft), 0.62rem 0.58rem 0 1px currentColor;
}

.top-settings-button {
  display: none;
}

.layout-button span {
  width: 1rem;
  height: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 0.36rem);
  grid-template-rows: repeat(2, 0.36rem);
  gap: 0.24rem;
}

.layout-button span::before,
.layout-button span::after {
  content: "";
  border: 1.5px solid currentColor;
  border-radius: 0.12rem;
}

.primary-button:hover,
.icon-button:hover,
.favorite-button:hover,
.tab:hover,
.tab.active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  background: var(--accent-soft);
  color: var(--text);
}

.tile-action:hover,
.tile-action:focus-visible {
  color: var(--text-primary);
}

.drawer-shell {
  display: none;
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  right: min(25rem, calc(100vw - var(--rail-width)));
  bottom: 0;
  left: 0;
  z-index: 119;
  display: block;
  background: rgba(31, 28, 24, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background 160ms ease, opacity 160ms ease, visibility 160ms ease;
}

body.drawer-open .drawer-backdrop.open,
body.settings-open .settings-backdrop.open {
  background: var(--overlay-muted);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-backdrop {
  position: fixed;
  top: 0;
  right: min(25rem, calc(100vw - var(--rail-width)));
  bottom: 0;
  left: 0;
  z-index: 119;
  display: block;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background 160ms ease, opacity 160ms ease, visibility 160ms ease;
}

.filter-drawer,
.settings-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 120;
  width: min(25rem, calc(100vw - var(--rail-width)));
  height: 100%;
  min-height: 100vh;
  padding: 1rem;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--bg-panel);
  background-image: linear-gradient(var(--bg-panel), var(--bg-panel));
  box-shadow: var(--shadow);
  overflow-y: auto;
  isolation: isolate;
  transform: translateZ(0);
  display: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.filter-drawer.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.settings-drawer.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1.2;
}

.drawer-close {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  color: var(--text-secondary);
  background: var(--bg-soft);
  font-size: 1.25rem;
}

.drawer-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.drawer-mobile-tools {
  display: none;
}

.drawer-section-head {
  margin-bottom: 0.65rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-section-head span {
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 720;
}

.drawer-section-head small,
.drawer-note {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.55;
}

.drawer-filter-list {
  display: grid;
  gap: 0.45rem;
}

.drawer-filter-list.compact {
  grid-template-columns: 1fr;
}

.drawer-filter {
  min-height: 2.75rem;
  padding: 0 0.78rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.65rem;
  color: var(--text-primary);
  background: var(--bg-panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.drawer-filter:hover,
.drawer-filter.active {
  border-color: color-mix(in srgb, var(--accent) 42%, transparent);
  background: var(--accent-soft);
}

.drawer-filter strong {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 680;
}

.drawer-dna .dna-row {
  grid-template-columns: 5rem minmax(0, 1fr);
  color: var(--text-secondary);
}

.drawer-dna .dna-row i {
  background: var(--border-subtle);
}

.drawer-note {
  margin-bottom: 0.75rem;
}

.drawer-upload {
  width: 100%;
  min-height: 2.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 0.75rem;
  color: color-mix(in srgb, var(--text-primary) 82%, #000);
  background: var(--gold);
  font-weight: 720;
}

.theme-options {
  display: grid;
  gap: 0.55rem;
}

.theme-option {
  min-height: 3.2rem;
  padding: 0.65rem 0.78rem;
  border: 1px solid var(--border-subtle);
  border-radius: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-panel);
  text-align: left;
}

.theme-option span,
.theme-option small {
  display: block;
}

.theme-option span {
  font-size: 0.92rem;
  font-weight: 720;
}

.theme-option small {
  margin-top: 0.18rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.theme-option:hover,
.theme-option.active {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: var(--accent-soft);
}

.scroll-locked {
  overflow: hidden !important;
  height: 100% !important;
}

.editorial-stage {
  position: relative;
  min-height: clamp(24rem, 44vw, 38rem);
  margin: 0.9rem 0 1.1rem;
  padding: clamp(1rem, 2vw, 1.4rem);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(13rem, 0.72fr) minmax(18rem, 0.95fr) minmax(10rem, 0.46fr);
  gap: clamp(0.85rem, 1.6vw, 1.35rem);
  background: var(--bg-panel);
  overflow: hidden;
  box-shadow: none;
}

.editorial-stage::before {
  display: none;
}

.editorial-stage::after {
  display: none;
}

.stage-image {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: var(--bg-soft);
  overflow: hidden;
  box-shadow: none;
}

.stage-image img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  transition: transform 360ms ease, filter 360ms ease;
}

.stage-image:hover img {
  transform: scale(1.035);
  filter: contrast(1.04) saturate(1.04);
}

.stage-image span {
  position: absolute;
  left: 0.85rem;
  bottom: 0.8rem;
  padding: 0.35rem 0.52rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--floating-bg);
  backdrop-filter: none;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-real {
  min-height: 100%;
}

.hero-anime {
  align-self: end;
  height: 68%;
}

.stage-copy {
  position: relative;
  z-index: 1;
  align-self: end;
  padding: 0.8rem 0.2rem 0.35rem;
}

.stage-copy h3 {
  max-width: 44rem;
  margin-bottom: clamp(1.2rem, 2vw, 1.8rem);
  font-size: clamp(1.8rem, 4vw, 5rem);
  line-height: 0.98;
  font-weight: 690;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.hero-stats div {
  min-width: 0;
  padding: 0.85rem 0.9rem;
  border-left: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--bg-panel) 58%, transparent);
}

.hero-stats strong {
  display: block;
  font-size: clamp(1.28rem, 2vw, 2.05rem);
  line-height: 1;
}

.hero-stats span {
  display: block;
  margin-top: 0.42rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.gallery-head {
  position: sticky;
  top: 5.25rem;
  z-index: 50;
  margin: 0 -0.15rem 0.78rem;
  padding: 0.54rem 0.15rem;
  display: grid;
  grid-template-columns: auto auto minmax(9rem, 1fr);
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-sticky);
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
  transform: translateY(0);
  transition: transform 220ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

body.topbar-hidden .topbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-110%);
}

body.topbar-hidden .gallery-head {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-110% - 5.25rem));
}

.gallery-head.filter-peek {
  outline: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  outline-offset: 0.18rem;
}

.view-tabs {
  display: flex;
  align-items: center;
  gap: 0.34rem;
  flex-wrap: wrap;
}

.tab {
  min-height: 1.85rem;
  padding: 0 0.68rem;
  border-color: transparent;
  border-radius: 999px;
  color: #746f66;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.74rem;
  line-height: 1;
}

.tab:hover {
  border-color: transparent;
  background: rgba(244, 239, 231, 0.64);
  color: #4f4940;
}

.tab.active {
  border-color: transparent;
  background: #f4efe7;
  color: #403a32;
}

.gallery-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: right;
}

.gallery-head {
  display: none;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.gallery {
  --masonry-gap: 1.125rem;
  display: flex;
  align-items: flex-start;
  gap: var(--masonry-gap);
  margin-top: 1.5rem;
  width: 100%;
  background: transparent;
  box-shadow: none;
  overflow-anchor: none;
  opacity: 1;
  transition: opacity 160ms ease;
}

.masonry-gallery,
.masonry-column,
.masonry-spacer,
.tile {
  overflow-anchor: none;
}

.gallery.is-shuffling {
  opacity: 0.62;
}

.shuffle-fab {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 90;
  min-height: 2.75rem;
  padding: 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  border: 1px solid rgba(26, 24, 20, 0.06);
  border-radius: 999px;
  color: #4f4940;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(31, 28, 24, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 660;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, opacity 160ms ease;
}

.shuffle-fab span[aria-hidden="true"] {
  color: #8b806f;
  font-size: 0.82rem;
  line-height: 1;
}

.shuffle-fab:hover,
.shuffle-fab:focus-visible {
  border-color: rgba(26, 24, 20, 0.08);
  color: #332f29;
  background: rgba(255, 255, 255, 0.88);
}

.shuffle-fab:disabled {
  cursor: default;
  opacity: 0.58;
}

body.lightbox-open .shuffle-fab,
body.drawer-open .shuffle-fab,
body.settings-open .shuffle-fab {
  opacity: 0;
  pointer-events: none;
}

.gallery.compact {
  --masonry-gap: 0.75rem;
}

.masonry-column {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--masonry-gap);
}

.masonry-spacer {
  flex: 0 0 auto;
  min-height: 0;
  pointer-events: none;
}

.tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f0ed;
  box-shadow: none;
  cursor: pointer;
  transform: translateY(0);
  transition: transform 160ms ease;
}

.tile.tile-image-loaded {
  background: transparent;
}

.tile:hover,
.tile:focus-visible {
  outline: none;
  transform: translateY(-0.5px);
}

.tile::before {
  display: none;
}

.tile img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 10rem;
  border-radius: inherit;
  object-fit: cover;
  opacity: 0;
  background: transparent;
  transition: opacity 170ms ease, transform 220ms ease;
}

.tile img.is-loaded {
  opacity: 1;
}

.tile:hover img {
  filter: none;
}

.tile-info {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 1.7rem 0.72rem 0.64rem;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--image-info-bg);
  opacity: 0;
  transition: opacity 170ms ease;
}

.tile:hover .tile-info,
.tile:focus-visible .tile-info {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) and (min-width: 768px) {
  .tile {
    transition: transform 180ms ease;
  }

  .tile:hover,
  .tile:focus-visible {
    transform: translateY(-3px);
  }

  .tile:hover img,
  .tile:focus-visible img {
    transform: scale(1.025);
    filter: none;
  }

  .tile:hover .tile-info,
  .tile:focus-visible .tile-info {
    opacity: 1;
  }

  .tile:hover .tile-actions,
  .tile:focus-visible .tile-actions,
  .tile-actions:focus-within {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tile,
  .tile img {
    transition: opacity 160ms ease;
  }

  .tile:hover,
  .tile:focus-visible {
    transform: none;
  }

  .tile:hover img,
  .tile:focus-visible img {
    transform: none;
  }

  .lightbox-slide,
  .lightbox-slide-animating {
    transition: opacity 160ms ease !important;
  }

  .gallery,
  .shuffle-fab {
    transition: none;
  }

  .landing-visual-card {
    animation: none;
  }
}

.tile-info span {
  color: var(--image-info-text);
  font-size: 0.72rem;
  text-shadow: none;
}

.tile-info strong {
  color: var(--image-info-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.tile-actions {
  position: absolute;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 0.32rem;
  opacity: 0;
  transform: translateY(0.2rem);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tile:hover .tile-actions,
.tile:focus-visible .tile-actions,
.tile-actions:focus-within {
  opacity: 1;
  transform: translateY(0);
}

.tile-action {
  min-height: 1.85rem;
  padding: 0 0.55rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-primary);
  background: var(--floating-bg);
  backdrop-filter: none;
  font-size: 0.72rem;
  text-decoration: none;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.tile-action:hover,
.tile-action:focus-visible {
  border-color: var(--line-strong);
  background: var(--floating-hover);
}

.tile-favorite.active {
  color: color-mix(in srgb, var(--text-primary) 82%, #000);
  background: var(--gold);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.tile-badge {
  position: absolute;
  left: 0.56rem;
  top: 0.56rem;
  z-index: 3;
  display: none;
  padding: 0.26rem 0.42rem;
  border: 1px solid color-mix(in srgb, var(--accent) 62%, transparent);
  color: color-mix(in srgb, var(--accent) 12%, #17110a);
  background: color-mix(in srgb, var(--accent) 92%, var(--bg-panel));
  font-size: 0.68rem;
  font-weight: 720;
}

.tile-badge.show {
  display: inline-flex;
}

.compare-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(24rem, 1fr));
  gap: 0.95rem;
}

.compare-card {
  border: 0;
  border-radius: 1rem;
  background: var(--bg-panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.pair-review {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.compare-title {
  min-height: 2.9rem;
  padding: 0 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.compare-title span {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compare-title strong {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 560;
}

.compare-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--border-subtle);
}

.compare-images button {
  position: relative;
  min-height: 28rem;
  padding: 0;
  border: 0;
  background: var(--bg-soft);
  overflow: hidden;
}

.compare-images img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 300ms ease, filter 300ms ease;
}

.compare-images button:hover img {
  transform: scale(1.026);
  filter: contrast(1.04) saturate(1.04);
}

.compare-images span {
  position: absolute;
  left: 0.72rem;
  bottom: 0.72rem;
  padding: 0.32rem 0.48rem;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  background: var(--floating-bg);
  backdrop-filter: none;
  font-size: 0.72rem;
}

.review-strip {
  min-height: 3.35rem;
  padding: 0.58rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr auto auto;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-panel);
}

.review-strip div {
  min-width: 0;
}

.review-strip span {
  display: block;
  color: var(--quiet);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.review-strip strong {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 580;
}

.review-strip button {
  min-height: 2rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--floating-bg);
}

.review-strip button:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
}

.empty {
  padding: 4rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg-panel) 62%, transparent);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: block;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.lightbox.open {
  display: block;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 13, 12, 0.82);
  backdrop-filter: blur(24px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.lightbox.open .lightbox-backdrop {
  opacity: 1;
}

.lightbox-panel {
  position: absolute;
  inset: 0;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.lightbox-figure {
  flex: 1 1 auto;
  min-width: 0;
  width: 96vw;
  max-width: 96vw;
  max-height: 94vh;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 190ms ease, transform 220ms cubic-bezier(0.22, 0.8, 0.2, 1);
}

.lightbox.open .lightbox-figure {
  opacity: 1;
  transform: scale(1);
}

.lightbox-stage {
  position: relative;
  width: 96vw;
  height: 94vh;
  max-width: 96vw;
  max-height: 94vh;
  min-height: 0;
  overflow: hidden;
  touch-action: pan-y;
  contain: layout;
  isolation: isolate;
}

.lightbox-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  display: block;
  object-fit: contain;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-user-drag: none;
  user-select: none;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: none;
  transition: opacity 160ms ease;
}

.lightbox-slide-current {
  z-index: 2;
  opacity: 1;
}

.lightbox-slide-incoming {
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}

.lightbox-slide-animating,
.lightbox-stage.is-dragging .lightbox-slide {
  will-change: transform, opacity;
}

.lightbox figcaption,
.lightbox .favorite-button,
.lightbox .inspector,
.lightbox-info-toggle {
  display: none !important;
}

.lightbox-download-mobile {
  display: none;
}

.favorite-button {
  padding: 0 0.9rem;
}

.favorite-button.active {
  background: var(--gold);
  color: color-mix(in srgb, var(--accent) 12%, #17110a);
}

.lightbox-close,
.lightbox-arrow {
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 6;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.35rem;
}

.lightbox-arrow {
  position: fixed;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox-close:hover,
.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-arrow.prev {
  left: 28px;
}

.lightbox-arrow.next {
  right: 28px;
}

.inspector h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 680;
}

.meta-grid {
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.meta-grid div {
  min-width: 0;
  padding-bottom: 0.58rem;
  border-bottom: 1px solid var(--line);
}

.meta-grid dt {
  margin-bottom: 0.25rem;
  color: var(--quiet);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.meta-grid dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.curation-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.mark-button {
  min-height: 2.45rem;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--bg-soft);
}

.mark-button:hover,
.mark-button.active {
  border-color: color-mix(in srgb, var(--accent) 58%, transparent);
  color: color-mix(in srgb, var(--accent) 12%, #17110a);
  background: var(--gold);
}

.usage-panel {
  padding: 0.82rem;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.usage-panel span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--gold);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.usage-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.6;
}

.paired-preview {
  margin-top: auto;
}

.paired-preview button {
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  overflow: hidden;
}

.paired-preview img {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: cover;
  opacity: 0.86;
  transition: transform 220ms ease, opacity 220ms ease;
}

.paired-preview button:hover img {
  transform: scale(1.025);
  opacity: 1;
}

.paired-preview span {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  padding: 0.28rem 0.42rem;
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: var(--floating-bg);
  backdrop-filter: none;
  font-size: 0.72rem;
}

.paired-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] html {
  background: #000000;
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .gallery-head,
:root[data-theme="dark"] .lightbox,
:root[data-theme="dark"] .inspector,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .compare-card,
:root[data-theme="dark"] .review-strip {
  background: transparent;
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
}

:root[data-theme="dark"] .sidebar {
  z-index: 100;
  opacity: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 15, 0.95);
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
}

:root[data-theme="dark"] .filter-drawer,
:root[data-theme="dark"] .settings-drawer {
  z-index: 120;
  opacity: 1;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.98);
  background-image: none;
  box-shadow: none;
  backdrop-filter: none;
  transform: none;
}

:root[data-theme="dark"] .drawer-backdrop,
:root[data-theme="dark"] .settings-backdrop {
  z-index: 119;
}

:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .gallery-head {
  z-index: 50;
  background: rgba(0, 0, 0, 0.96);
  background-image: none;
}

:root[data-theme="dark"] .lightbox {
  z-index: 200;
}

:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .filter-drawer,
:root[data-theme="dark"] .settings-drawer,
:root[data-theme="dark"] .inspector,
:root[data-theme="dark"] .empty,
:root[data-theme="dark"] .compare-card {
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .brand-mark,
:root[data-theme="dark"] .nav-item,
:root[data-theme="dark"] .tab,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .favorite-button,
:root[data-theme="dark"] .drawer-close,
:root[data-theme="dark"] .drawer-filter,
:root[data-theme="dark"] .theme-option,
:root[data-theme="dark"] .review-strip button,
:root[data-theme="dark"] .mark-button,
:root[data-theme="dark"] .usage-panel,
:root[data-theme="dark"] .paired-preview button,
:root[data-theme="dark"] .tile-action,
:root[data-theme="dark"] .lightbox-close,
:root[data-theme="dark"] .lightbox-arrow {
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  background: transparent;
  box-shadow: none;
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .tab:hover,
:root[data-theme="dark"] .tab.active,
:root[data-theme="dark"] .icon-button:hover,
:root[data-theme="dark"] .icon-button:focus-visible,
:root[data-theme="dark"] .favorite-button:hover,
:root[data-theme="dark"] .drawer-filter:hover,
:root[data-theme="dark"] .drawer-filter.active,
:root[data-theme="dark"] .theme-option:hover,
:root[data-theme="dark"] .theme-option.active,
:root[data-theme="dark"] .review-strip button:hover,
:root[data-theme="dark"] .mark-button:hover,
:root[data-theme="dark"] .mark-button.active,
:root[data-theme="dark"] .tile-action:hover,
:root[data-theme="dark"] .tile-action:focus-visible,
:root[data-theme="dark"] .lightbox-close:hover,
:root[data-theme="dark"] .lightbox-arrow:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

:root[data-theme="dark"] .primary-button,
:root[data-theme="dark"] .drawer-upload,
:root[data-theme="dark"] .favorite-button.active,
:root[data-theme="dark"] .tile-favorite.active {
  border-color: rgba(255, 255, 255, 0.18);
  color: #000000;
  background: #ffffff;
  box-shadow: none;
}

:root[data-theme="dark"] .primary-button:hover,
:root[data-theme="dark"] .drawer-upload:hover,
:root[data-theme="dark"] .favorite-button.active:hover,
:root[data-theme="dark"] .tile-favorite.active:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="dark"] .search {
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  background: #0a0a0a;
  box-shadow: none;
}

:root[data-theme="dark"] .search:focus-within {
  border-color: rgba(255, 255, 255, 0.18);
  background: #0a0a0a;
  box-shadow: none;
}

:root[data-theme="dark"] .sidebar {
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .brand-mark {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .nav-item {
  color: rgba(255, 255, 255, 0.58);
  background: transparent;
}

:root[data-theme="dark"] .nav-item:hover,
:root[data-theme="dark"] .nav-item.active,
:root[data-theme="dark"] .tab:hover,
:root[data-theme="dark"] .tab.active {
  border-color: transparent;
  color: #ffffff;
  background: rgba(244, 239, 231, 0.12);
}

:root[data-theme="dark"] .tab {
  border-color: transparent;
  color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .topbar .icon-button {
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .topbar .icon-button:hover,
:root[data-theme="dark"] .topbar .icon-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

:root[data-theme="dark"] .topbar .layout-button.is-active,
:root[data-theme="dark"] .topbar .layout-button[aria-pressed="true"] {
  border-color: transparent;
  color: #ffffff;
  background: rgba(244, 239, 231, 0.18);
}

:root[data-theme="dark"] .shuffle-fab {
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  background: rgba(12, 12, 12, 0.72);
  box-shadow: none;
}

:root[data-theme="dark"] .shuffle-fab span[aria-hidden="true"] {
  color: rgba(255, 255, 255, 0.68);
}

:root[data-theme="dark"] .shuffle-fab:hover,
:root[data-theme="dark"] .shuffle-fab:focus-visible {
  background: rgba(28, 28, 28, 0.88);
}

:root[data-theme="dark"] .search input,
:root[data-theme="dark"] .drawer-header h2,
:root[data-theme="dark"] .drawer-section-head span,
:root[data-theme="dark"] .theme-option span,
:root[data-theme="dark"] .compare-title span,
:root[data-theme="dark"] .lightbox figcaption strong,
:root[data-theme="dark"] .inspector h3 {
  color: #ffffff;
}

:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .search input::placeholder,
:root[data-theme="dark"] .drawer-section-head small,
:root[data-theme="dark"] .drawer-note,
:root[data-theme="dark"] .theme-option small,
:root[data-theme="dark"] .drawer-filter strong,
:root[data-theme="dark"] .compare-title strong,
:root[data-theme="dark"] .review-strip strong,
:root[data-theme="dark"] .meta-grid dd,
:root[data-theme="dark"] .usage-panel p {
  color: rgba(255, 255, 255, 0.65);
}

:root[data-theme="dark"] .review-strip span,
:root[data-theme="dark"] .meta-grid dt,
:root[data-theme="dark"] .usage-panel span,
:root[data-theme="dark"] .lightbox figcaption span {
  color: rgba(255, 255, 255, 0.45);
}

:root[data-theme="dark"] .gallery {
  background: transparent;
}

:root[data-theme="dark"] .tile {
  border-radius: 12px;
  background: #0b0b0b;
  box-shadow: none;
  opacity: 1;
}

:root[data-theme="dark"] .tile.tile-image-loaded {
  background: transparent;
}

:root[data-theme="dark"] .tile img {
  border-radius: inherit;
  background: transparent;
  filter: none;
  transition: opacity 170ms ease, transform 220ms ease;
}

:root[data-theme="dark"] .tile:hover img,
:root[data-theme="dark"] .tile:focus-visible img {
  filter: none;
}

:root[data-theme="dark"] .tile-info {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 0.72rem;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  transform: none;
  pointer-events: none;
}

:root[data-theme="dark"] .tile:hover .tile-info,
:root[data-theme="dark"] .tile:focus-visible .tile-info {
  opacity: 1;
}

:root[data-theme="dark"] .tile-info span {
  color: #ffffff;
}

:root[data-theme="dark"] .tile-info strong {
  color: rgba(255, 255, 255, 0.65);
}

:root[data-theme="dark"] .tile-actions {
  opacity: 1;
  transform: none;
}

:root[data-theme="dark"] .tile-badge {
  border-color: rgba(255, 255, 255, 0.18);
  color: #000000;
  background: #ffffff;
}

:root[data-theme="dark"] .compare-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.5rem;
  box-shadow: none;
}

:root[data-theme="dark"] .compare-title,
:root[data-theme="dark"] .review-strip,
:root[data-theme="dark"] .meta-grid div {
  border-color: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .compare-images {
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .compare-images button {
  background: #000000;
}

:root[data-theme="dark"] .compare-images img {
  border-radius: 0;
  filter: none;
  transition: filter 160ms ease;
}

:root[data-theme="dark"] .compare-images button:hover img {
  transform: none;
  filter: brightness(1.05);
}

:root[data-theme="dark"] .compare-images span {
  border-color: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  background: rgba(0, 0, 0, 0.52);
}

:root[data-theme="dark"] .lightbox-backdrop {
  background: rgba(14, 13, 12, 0.88);
  backdrop-filter: blur(24px);
}

:root[data-theme="dark"] .lightbox-slide {
  background: rgba(0, 0, 0, 0.18);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .lightbox-close,
:root[data-theme="dark"] .lightbox-arrow {
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
}

:root[data-theme="dark"] .lightbox-close:hover,
:root[data-theme="dark"] .lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}

:root[data-theme="dark"] .drop-zone {
  border-color: rgba(255, 255, 255, 0.08);
  background: transparent;
}

:root[data-theme="dark"] .drop-zone.dragging {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .dna-row i,
:root[data-theme="dark"] .drawer-dna .dna-row i {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .dna-row i::before {
  background: #ffffff;
}

@media (max-width: 1120px) {
  .editorial-stage {
    grid-template-columns: minmax(12rem, 0.7fr) minmax(18rem, 1fr);
  }

  .hero-anime {
    display: none;
  }
}

@media (max-width: 980px) {
  .shell {
    display: grid;
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    width: var(--rail-width);
    height: 100vh;
    padding: 0.8rem 0.65rem;
    border-left: 0;
    border-bottom: 0;
  }

  .nav-group {
    display: flex;
    flex-direction: column;
  }

  .side-card,
  .drop-zone,
  .side-meta {
    display: none;
  }

  .topbar,
  .gallery-head {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: row;
    min-height: 5.25rem;
  }

  .toolbar,
  .search {
    width: 100%;
  }

  .gallery-head p {
    text-align: left;
  }

  .landing-page {
    grid-template-columns: 1fr;
    min-height: 100vh;
    place-items: center;
    padding: 2.5rem 1.5rem;
  }

  .landing-copy {
    justify-self: center;
  }

  .landing-visual {
    min-height: 100%;
  }

  .landing-visual-card {
    max-width: 28vw;
  }

  .editorial-stage {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-real {
    height: 28rem;
  }

  .lightbox-panel {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .lightbox-figure {
    flex: 1 1 auto;
    width: 96vw;
    max-width: 96vw;
  }

  .inspector {
    flex: none;
    grid-column: 2;
    grid-row: 2;
    width: auto;
    max-width: none;
    max-height: 14rem;
  }

  .lightbox-arrow {
    position: fixed;
    transform: translateY(-50%);
  }

  .lightbox-arrow.prev {
    left: 28px;
  }

  .lightbox-arrow.next {
    right: 28px;
  }
}

@media (max-width: 620px) {
  :root {
    --rail-width: 4.5rem;
  }

  .main {
    padding-inline: 0.8rem;
  }

  .sidebar {
    padding: 0.65rem 0.5rem;
  }

  .brand-mark {
    width: 2.45rem;
    height: 2.45rem;
  }

  .nav-item {
    width: 2.65rem;
    min-height: 2.65rem;
  }

  .nav-group {
    gap: 0.42rem;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search {
    flex-basis: 100%;
    order: 1;
    height: 3.6rem;
  }

  .filter-button {
    order: 2;
  }

  .layout-button {
    order: 3;
  }

  .primary-button {
    order: 4;
  }

  .gallery-head {
    top: 8.8rem;
  }

  .editorial-stage {
    padding: 0.7rem;
    gap: 0.7rem;
  }

  .stage-copy h3 {
    margin-bottom: 0.8rem;
    font-size: clamp(1.55rem, 8vw, 2.2rem);
    line-height: 1.03;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
  }

  .hero-stats div {
    padding: 0.65rem 0.45rem;
  }

  .hero-stats span {
    font-size: 0.72rem;
  }

  .hero-real {
    height: 14rem;
  }

  .gallery {
    --masonry-gap: 0.68rem;
  }

  .gallery.compact {
    --masonry-gap: 0.62rem;
  }

  .tile {
    margin-bottom: 0;
  }

  .compare-board {
    grid-template-columns: 1fr;
  }

  .compare-images button {
    min-height: 20rem;
  }

  .lightbox-panel {
    inset: 0.7rem;
    grid-template-columns: 2.35rem minmax(0, 1fr) 2.35rem;
    gap: 0.55rem;
  }

  .lightbox-arrow {
    width: 2.1rem;
    height: 4rem;
  }

  .inspector {
    max-height: 12rem;
    padding: 0.75rem;
  }

  .curation-actions {
    grid-template-columns: 1fr;
  }

  .paired-preview img {
    height: 8rem;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .main {
    padding-inline: clamp(1rem, 2.2vw, 1.8rem);
  }

  .gallery {
    gap: 0.625rem;
  }
}

@media (max-width: 767px) {
  html,
  body {
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y;
  }

  .shell {
    display: block;
    min-height: 100vh;
  }

  .sidebar {
    display: none !important;
  }

  .main {
    min-width: 0;
    padding: 0 10px calc(0.75rem + env(safe-area-inset-bottom));
  }

  body.is-landing .main {
    min-height: 100dvh;
    padding: 0 10px;
  }

  .landing-page {
    min-height: 100dvh;
    padding: 20px 16px calc(28px + env(safe-area-inset-bottom));
    align-content: center;
  }

  .landing-page::before {
    background:
      radial-gradient(circle at center, rgba(255, 255, 255, 0.86) 0%, rgba(255, 255, 255, 0.68) 38%, rgba(250, 248, 243, 0.28) 72%, rgba(250, 248, 243, 0.12) 100%);
  }

  .landing-copy {
    justify-self: center;
    width: min(100%, 560px);
    max-width: none;
    padding: 0;
    border-radius: 0;
    text-align: center;
    transform: none;
  }

  .landing-copy::before {
    inset: -58px -38px;
    filter: blur(10px);
  }

  .landing-copy h2 {
    font-size: clamp(2.75rem, 14vw, 4.25rem);
  }

  .landing-subtitle {
    margin-bottom: 0.85rem;
    font-size: clamp(1.15rem, 5vw, 1.45rem);
  }

  .landing-description {
    margin-bottom: 1.15rem;
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .landing-actions {
    display: flex;
    width: auto;
    max-width: none;
    justify-content: center;
  }

  .landing-primary {
    min-height: 3.1rem;
    padding: 0.9rem 1.6rem;
    font-size: 0.95rem;
  }

  .landing-visual {
    min-height: 100%;
  }

  .landing-visual-card {
    width: clamp(118px, 35vw, 158px) !important;
    border-radius: 20px;
    opacity: 0.6 !important;
  }

  .landing-visual-card:nth-child(n + 7) {
    display: none;
  }

  .landing-visual-card:nth-child(1) {
    left: 3% !important;
    top: 6% !important;
    right: auto !important;
    bottom: auto !important;
  }

  .landing-visual-card:nth-child(2) {
    left: 7% !important;
    right: auto !important;
    top: auto !important;
    bottom: 7% !important;
  }

  .landing-visual-card:nth-child(3) {
    left: -5% !important;
    top: 45% !important;
    right: auto !important;
    bottom: auto !important;
  }

  .landing-visual-card:nth-child(4) {
    left: auto !important;
    right: 3% !important;
    top: 8% !important;
    bottom: auto !important;
  }

  .landing-visual-card:nth-child(5) {
    left: auto !important;
    right: 5% !important;
    top: auto !important;
    bottom: 8% !important;
  }

  .landing-visual-card:nth-child(6) {
    left: auto !important;
    right: -4% !important;
    top: 48% !important;
    bottom: auto !important;
  }

  .landing-visual-card:nth-child(7) {
    left: auto !important;
    right: 14% !important;
    top: -6% !important;
    bottom: auto !important;
  }

  .landing-visual-card:nth-child(8) {
    left: 18% !important;
    right: auto !important;
    top: auto !important;
    bottom: -7% !important;
  }

  .landing-shortcuts {
    grid-template-columns: 1fr;
    gap: 0.55rem;
  }

  .landing-shortcut {
    min-height: 4.25rem;
    padding: 0.86rem 0.95rem;
    border-radius: 1.1rem;
  }

  .topbar {
    top: 0;
    min-height: calc(48px + env(safe-area-inset-top) + 12px);
    padding: calc(12px + env(safe-area-inset-top)) 2px 0;
    background: var(--bg-sticky);
    transition: transform 180ms ease, opacity 160ms ease;
  }

  .toolbar {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .search {
    order: 1;
    flex: 1 1 auto;
    flex-basis: auto;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    gap: 9px;
    background: var(--bg-soft);
    box-shadow: none;
  }

  .search input {
    font-size: 0.95rem;
  }

  .search input::placeholder {
    color: var(--text-secondary);
  }

  .search:focus-within {
    border-color: color-mix(in srgb, var(--text-primary) 18%, transparent);
    background: var(--bg-panel);
    box-shadow: none;
  }

  .search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
  }

  .topbar .icon-button {
    min-width: 48px;
    width: 48px;
    min-height: 48px;
    height: 48px;
    border: 1px solid rgba(26, 24, 20, 0.05);
    border-radius: 18px;
    color: #6f6a61;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .topbar .icon-button:hover,
  .topbar .icon-button:focus-visible {
    border-color: rgba(26, 24, 20, 0.07);
    color: #4f4940;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
  }

  .top-settings-button {
    order: 3;
    display: grid;
  }

  .filter-button {
    order: 2;
  }

  .top-settings-button .nav-icon {
    width: 22px;
    height: 22px;
  }

  .layout-button,
  .topbar #uploadButton {
    display: none;
  }

  .gallery-head {
    display: none;
    min-height: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  .gallery-head::-webkit-scrollbar {
    display: none;
  }

  body.topbar-hidden .gallery-head {
    transform: none;
  }

  .view-tabs {
    display: none;
    gap: 0.5rem;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    overflow: visible;
    scrollbar-width: none;
  }

  .view-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab {
    display: none;
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0 0.8rem;
    border-radius: 1.2rem;
    flex: 0 0 auto;
    font-size: 0.94rem;
  }

  .gallery-head p {
    display: none;
    margin: 0;
    padding: 0;
  }

  #resultLabel {
    display: none;
  }

  .drawer-mobile-tools {
    display: block;
  }

  .gallery {
    margin-top: 12px;
  }

  .shuffle-fab {
    right: 16px;
    bottom: calc(20px + env(safe-area-inset-bottom));
    min-height: 2.55rem;
    padding: 0 0.9rem;
    font-size: 0.82rem;
  }

  .gallery,
  .gallery.compact {
    --masonry-gap: 9px;
  }

  .tile {
    margin-bottom: 0;
    border-radius: 10px;
    transform: none;
  }

  .tile:hover,
  .tile:focus-visible {
    transform: none;
  }

  .tile img {
    min-height: 0;
    border-radius: 10px;
  }

  .tile:hover img {
    filter: none;
  }

  .tile.mobile-actions-open img {
    filter: brightness(0.9);
  }

  .tile-info {
    padding: 1.6rem 0.58rem 0.54rem;
  }

  .tile-info span,
  .tile-info strong {
    font-size: 0.68rem;
  }

  .tile-actions {
    right: 0.42rem;
    bottom: 0.42rem;
    gap: 0.28rem;
    opacity: 0;
    transform: translateY(0.15rem);
  }

  .tile:hover .tile-actions,
  .tile:focus-visible .tile-actions,
  .tile:hover .tile-info,
  .tile:focus-visible .tile-info {
    opacity: 0;
  }

  .tile.mobile-actions-open .tile-actions,
  .tile.mobile-actions-open .tile-info,
  .tile-actions:focus-within {
    opacity: 1;
    transform: translateY(0);
  }

  .tile-action {
    min-height: 2rem;
    padding: 0 0.52rem;
    font-size: 0.7rem;
  }

  .tile-badge {
    left: 0.42rem;
    top: 0.42rem;
  }

  .drawer-backdrop,
  .settings-backdrop {
    inset: 0;
    right: 0;
  }

  .filter-drawer,
  .settings-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: min(86vh, 42rem);
    padding: 0.85rem 0.9rem calc(1rem + env(safe-area-inset-bottom));
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
    border-radius: 1rem 1rem 0 0;
    display: none;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(100%);
    transition: transform 220ms ease;
    touch-action: pan-y;
  }

  .filter-drawer.open,
  .settings-drawer.open {
    display: block;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  .filter-drawer[data-dragging="true"],
  .settings-drawer[data-dragging="true"] {
    transition: none;
  }

  .drawer-header {
    min-height: 3.1rem;
    padding-top: 0.2rem;
  }

  .drawer-header::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.45rem;
    width: 2.6rem;
    height: 0.22rem;
    border-radius: 999px;
    background: var(--border-subtle);
    transform: translateX(-50%);
  }

  .drawer-filter {
    min-height: 2.65rem;
  }

  .pull-refresh-indicator {
    position: fixed;
    left: 50%;
    top: calc(env(safe-area-inset-top) + 0.55rem);
    z-index: 80;
    min-height: 2rem;
    padding: 0 0.78rem;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    color: var(--text-secondary);
    background: color-mix(in srgb, var(--bg-panel) 90%, transparent);
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, calc(-120% + var(--pull-distance, 0px) * 0.34));
    transition: opacity 140ms ease, visibility 140ms ease, transform 140ms ease;
  }

  .pull-refresh-indicator.show {
    opacity: 1;
    visibility: visible;
  }

  .pull-refresh-indicator.ready {
    color: var(--text-primary);
    border-color: var(--line-strong);
  }

  .pull-refresh-icon {
    width: 0.82rem;
    height: 0.82rem;
    border: 1.5px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
  }

  .pull-refresh-indicator.refreshing .pull-refresh-icon {
    animation: pullRefreshSpin 760ms linear infinite;
  }

  .pull-refresh-text {
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
  }

  @keyframes pullRefreshSpin {
    to {
      transform: rotate(360deg);
    }
  }

  .mobile-nav {
    display: none !important;
  }

  .mobile-nav-item {
    min-width: 0;
    min-height: 2.9rem;
    padding: 0.22rem 0.12rem;
    border: 1px solid transparent;
    border-radius: 0.8rem;
    color: var(--text-secondary);
    background: transparent;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 0.16rem;
    font-size: 0.68rem;
    line-height: 1;
  }

  .mobile-nav-item .nav-icon,
  .mobile-nav-favorite-icon {
    width: 1.18rem;
    height: 1.18rem;
  }

  .mobile-nav-item.active {
    border-color: color-mix(in srgb, var(--accent) 42%, transparent);
    color: var(--text-primary);
    background: var(--accent-soft);
  }

  body.lightbox-open .mobile-nav,
  body.lightbox-open .topbar,
  body.lightbox-open .gallery-head {
    display: none;
  }

  .lightbox {
    z-index: 1000;
    width: 100vw;
    height: 100dvh;
    background: rgba(14, 13, 12, 0.82);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    touch-action: pan-y;
  }

  .lightbox.open {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(14, 13, 12, 0.88);
    backdrop-filter: blur(24px);
  }

  .lightbox-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: block;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 0;
    overflow: hidden;
  }

  .lightbox-figure {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: calc(env(safe-area-inset-top) + 6px) 6px calc(env(safe-area-inset-bottom) + 6px) 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }

  .lightbox-stage {
    width: 96vw;
    height: 88vh;
    max-width: 96vw;
    max-height: min(88vh, calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px));
    min-height: 0;
    background: transparent;
    touch-action: pan-y;
    contain: layout;
    isolation: isolate;
  }

  .lightbox-slide {
    margin: 0;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: none;
    background: transparent;
    filter: none;
    transform: none;
    transition: opacity 160ms ease;
  }

  .lightbox figcaption {
    display: none;
    min-height: 0;
    height: 0;
    padding: 0;
    pointer-events: none;
  }

  .lightbox figcaption span {
    margin: 0;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0;
  }

  .lightbox figcaption span::before {
    content: attr(data-mobile-label);
    font-size: 0.78rem;
  }

  .lightbox figcaption strong {
    display: none;
  }

  .lightbox-info-toggle,
  .lightbox-close {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 0.55rem);
    z-index: 7;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    box-shadow: none;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
  }

  .lightbox-download-mobile {
    position: fixed;
    right: calc(env(safe-area-inset-right) + 0.75rem);
    bottom: calc(env(safe-area-inset-bottom) + 0.9rem);
    z-index: 7;
    display: grid;
    place-items: center;
    min-width: 4.2rem;
    height: 2.75rem;
    padding: 0 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.48);
    font-size: 0.82rem;
  }

  .lightbox-close {
    right: max(12px, env(safe-area-inset-right));
    font-size: 1.4rem;
  }

  .lightbox-info-toggle {
    display: none;
  }

  .lightbox-arrow {
    display: none;
    pointer-events: none;
  }

  .lightbox-arrow::before {
    content: "";
    position: absolute;
    top: 50%;
    width: 2.35rem;
    height: 2.35rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.42);
    opacity: 0;
    transform: translateY(-50%);
    transition: opacity 160ms ease;
  }

  .lightbox-arrow::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0.58rem;
    height: 0.58rem;
    border-top: 2px solid #ffffff;
    border-left: 2px solid #ffffff;
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .lightbox.controls-visible .lightbox-arrow::before,
  .lightbox.controls-visible .lightbox-arrow::after {
    opacity: 0.64;
  }

  .lightbox-arrow.prev {
    left: 0;
  }

  .lightbox-arrow.next {
    right: 0;
  }

  .lightbox-arrow.prev::before {
    left: 0.7rem;
  }

  .lightbox-arrow.next::before {
    right: 0.7rem;
  }

  .lightbox-arrow.prev::after {
    left: 1.65rem;
    transform: translateY(-50%) rotate(-45deg);
  }

  .lightbox-arrow.next::after {
    right: 1.65rem;
    transform: translateY(-50%) rotate(135deg);
  }

  .inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 8;
    width: 100%;
    max-height: min(42dvh, 20rem);
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem 1rem 0 0;
    color: #ffffff;
    background: #080808;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    overflow: auto;
    transform: translateY(110%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  .lightbox.inspector-open .inspector {
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
  }

  .inspector .eyebrow,
  .usage-panel,
  .paired-preview,
  .curation-actions {
    display: none;
  }

  .inspector h3 {
    color: #ffffff;
    font-size: 0.98rem;
  }

  .meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .meta-grid div {
    padding: 0;
    border-bottom: 0;
  }

  .meta-grid div:nth-child(3),
  .meta-grid div:nth-child(4) {
    display: none;
  }

  .meta-grid dt {
    color: rgba(255, 255, 255, 0.45);
  }

  .meta-grid dd {
    color: rgba(255, 255, 255, 0.72);
  }

  .favorite-button {
    display: none;
  }

  .favorite-button.active {
    color: #000000;
    background: #ffffff;
  }
}

@media (max-width: 767px) {
  :root[data-theme="dark"] .main {
    background: #000000;
  }

  :root[data-theme="dark"] .topbar {
    background: #000000;
  }

  :root[data-theme="dark"] .search {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.025);
    box-shadow: none;
  }

  :root[data-theme="dark"] .search:focus-within {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: none;
  }

  :root[data-theme="dark"] .search input::placeholder,
  :root[data-theme="dark"] .search-icon {
    color: rgba(255, 255, 255, 0.58);
  }

  :root[data-theme="dark"] .topbar .icon-button {
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(12, 12, 12, 0.72);
    box-shadow: none;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  :root[data-theme="dark"] .topbar .icon-button:hover,
  :root[data-theme="dark"] .topbar .icon-button:focus-visible {
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    background: rgba(28, 28, 28, 0.88);
    box-shadow: none;
  }

  :root[data-theme="dark"] .topbar .layout-button.is-active,
  :root[data-theme="dark"] .topbar .layout-button[aria-pressed="true"] {
    border-color: transparent;
    color: #ffffff;
    background: rgba(244, 239, 231, 0.18);
  }

  :root[data-theme="dark"] .mobile-nav {
    border-top-color: rgba(255, 255, 255, 0.08);
    background: #000000;
  }

  :root[data-theme="dark"] .mobile-nav-item {
    color: rgba(255, 255, 255, 0.65);
    background: transparent;
  }

  :root[data-theme="dark"] .mobile-nav-item.active {
    border-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
  }

  :root[data-theme="dark"] .pull-refresh-indicator {
    color: rgba(255, 255, 255, 0.65);
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(10, 10, 10, 0.94);
  }

  :root[data-theme="dark"] .pull-refresh-indicator.ready {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
  }

  :root[data-theme="dark"] .filter-drawer,
  :root[data-theme="dark"] .settings-drawer {
    border-top-color: rgba(255, 255, 255, 0.08);
    border-left: 0;
    background: rgba(10, 10, 10, 0.98);
    transform: translateY(100%);
  }

  :root[data-theme="dark"] .filter-drawer.open,
  :root[data-theme="dark"] .settings-drawer.open {
    transform: translateY(0);
  }

  :root[data-theme="dark"] .lightbox {
    z-index: 1000;
    background: rgba(14, 13, 12, 0.82);
  }

  :root[data-theme="dark"] .lightbox-backdrop {
    background: rgba(14, 13, 12, 0.88);
  }

  :root[data-theme="dark"] .lightbox-panel {
    background: transparent;
  }

  :root[data-theme="dark"] .tile-actions,
  :root[data-theme="dark"] .tile-info {
    opacity: 0;
  }

  :root[data-theme="dark"] .tile,
  :root[data-theme="dark"] .tile img {
    border-radius: 10px;
  }

  :root[data-theme="dark"] .tile.mobile-actions-open .tile-actions,
  :root[data-theme="dark"] .tile.mobile-actions-open .tile-info,
  :root[data-theme="dark"] .tile-actions:focus-within {
    opacity: 1;
  }
}
