:root,
[data-theme="light"] {
  --bg: #f6f1f7;
  --bg-2: #ffffff;
  --ink: #2a2030;
  --mute: #7a6b80;
  --line: #eadceb;
  --accent: #d9468a;
  --accent-2: #7c3aed;
  --grad: linear-gradient(135deg, #ff6b9d, #7c3aed);
  --shadow: 0 12px 32px rgba(124, 58, 237, 0.08);
  --danger: #c2415a;
  --ok: #2f9e6b;
  --radius: 20px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #141018;
  --bg-2: #1d1724;
  --ink: #f4ecf6;
  --mute: #b3a3ba;
  --line: #3a2f42;
  --accent: #ff7eb0;
  --accent-2: #c4b5fd;
  --grad: linear-gradient(135deg, #ff6b9d, #8b5cf6);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  --danger: #f87171;
  --ok: #4ade80;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; max-width: 100%; }
html { background: var(--bg); overflow-x: clip; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  overflow-x: clip;
  background:
    radial-gradient(900px 480px at 0% -10%, rgba(255, 107, 157, 0.16), transparent 55%),
    radial-gradient(800px 420px at 100% 0%, rgba(124, 58, 237, 0.12), transparent 50%),
    var(--bg);
}
html.scroll-lock,
html.scroll-lock body {
  overflow: hidden;
  overscroll-behavior: none;
}
html.nav-open .maincol,
html.nav-open .colophon {
  pointer-events: none;
}
body.scroll-lock {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
input, select { height: 42px; padding: 0 12px; width: 100%; }
textarea { min-height: 90px; padding: 10px 12px; width: 100%; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 70, 138, 0.16);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  height: var(--header-h);
  min-height: var(--header-h);
  padding: 0 14px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.top-count {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  color: var(--mute);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  font-size: 20px;
  cursor: pointer;
  background: var(--bg-2);
  box-shadow: var(--shadow);
}
.icon-btn[aria-expanded="true"] {
  background: #d9468a;
  color: #fff;
  border-color: #d9468a;
  box-shadow: 0 0 0 3px rgba(217, 70, 138, 0.28);
}

.page {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
}
.maincol { min-width: 0; }
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  align-self: start;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  max-height: calc(100dvh - var(--header-h) - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.side-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.side-head h2 { margin: 0; font-size: 18px; line-height: 1.2; }
.close-side { display: none; }
#filter-form { display: grid; gap: 12px; }
.field { display: grid; gap: 6px; }
.field span, .checks legend {
  font-size: 12px;
  color: var(--mute);
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { border: 1px dashed var(--line); border-radius: 12px; padding: 8px 10px; }
.check-list { display: grid; gap: 6px; max-height: 160px; overflow: auto; }
.check-list label { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.check-list input { width: auto; height: auto; }
.btn, .ghost {
  height: 42px;
  padding: 0 14px;
  cursor: pointer;
}
.btn {
  background: var(--grad);
  color: #fff;
  border: 0;
}
.ghost { background: transparent; }

#view-catalog, #view-girl { min-width: 0; max-width: 100%; }
.toolbar { margin-bottom: 14px; }
.count { margin: 0; color: var(--mute); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: block;
  text-decoration: none;
  overflow: hidden;
  border-radius: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}
.card:hover { transform: translateY(-4px); }
.card-photo { aspect-ratio: 3/4; background: #eee; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card[hidden] { display: none !important; }
.card-body { padding: 12px 14px 14px; }
.card h2 { margin: 0 0 6px; font-size: 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--mute); font-size: 12px; }
.price { color: var(--accent); font-weight: 600; }
.tag {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.empty {
  text-align: center;
  padding: 70px 16px;
  color: var(--mute);
  font-size: 24px;
}
.pager { display: flex; justify-content: center; gap: 8px; margin: 22px 0; }
.pager button { min-width: 42px; height: 42px; cursor: pointer; }
.pager .on { background: var(--grad); color: #fff; border: 0; }

.back {
  display: inline-block;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}
.girl-hero img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin: 12px 0 20px;
}
.thumbs img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
}
.thumbs img.on { border-color: var(--accent); }
.girl-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 22px;
}
.girl-grid h1 { margin: 0 0 10px; font-size: 36px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.facts b { display: block; color: var(--mute); font-size: 12px; }
.raw {
  white-space: pre-wrap;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  line-height: 1.5;
}
.profile-box, .panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.profile-ava { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; }
.contact-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rev-item, .hist-item { border-top: 1px solid var(--line); padding: 8px 0; }
.stars { color: #f4b400; }
.notice { color: var(--danger); min-height: 1.2em; }
.ok { color: var(--ok); }
.rev-form { display: grid; gap: 8px; }
.rev-form .row { display: flex; gap: 8px; min-width: 0; }
.rev-form .row > * { min-width: 0; }

.colophon { text-align: center; color: var(--mute); padding: 10px 16px 28px; font-size: 12px; }
.scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(20, 10, 24, 0.45);
  border: 0;
  padding: 0;
  margin: 0;
}
.scrim[hidden] { display: none !important; }

.lightbox[hidden] { display: none; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 6, 14, 0.92);
  display: grid;
  place-items: center;
}
.lb-stage {
  width: min(92vw, 1100px);
  height: min(86vh, 860px);
  overflow: hidden;
  display: grid;
  place-items: center;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
  transform-origin: center center;
  user-select: none;
}
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 0;
  cursor: pointer;
}
.lb-close { top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 72px; font-size: 36px; }
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-count {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  margin: 0;
}

@media (min-width: 861px) {
  #menu-btn,
  .close-side { display: none; }
  .scrim { display: none !important; }
}

@media (max-width: 860px) {
  .page {
    display: block;
    padding: 12px;
  }
  .sidebar {
    position: fixed;
    z-index: 45;
    top: var(--header-h);
    left: 0;
    right: auto;
    bottom: 0;
    width: min(300px, calc(100vw - 64px));
    max-width: calc(100vw - 64px);
    height: calc(100dvh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    align-self: auto;
    margin: 0;
    border-radius: 0 20px 0 0;
    transform: translate3d(-105%, 0, 0);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.22s ease, visibility 0.22s ease;
  }
  .sidebar.open {
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }
  .close-side { display: inline-flex; }
  .scrim:not([hidden]) { display: block; }
  .girl-grid,
  .facts { grid-template-columns: 1fr; }
  .top-count { font-size: 12px; }
  .girl-grid h1 { font-size: 28px; }
  .lb-nav { width: 40px; height: 56px; font-size: 28px; }
  .lb-nav.prev { left: 4px; }
  .lb-nav.next { right: 4px; }
  .rev-form .row { flex-direction: column; }
}
