:root {
  --bg: #121214;
  --bg-raised: #1a1a1e;
  --bg-hover: #232328;
  --border: #2a2a30;
  --text: #e8e8ec;
  --text-dim: #9a9aa5;
  --text-faint: #6a6a75;
  --accent: #ff5d3b;
  --accent-dim: #b8452a;
  --focus: #7fb8ff;
  --radius: 6px;
  --header-h: 56px;
  --sidebar-w: 240px;
  --font-display: "Zilla Slab", Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  /* Belt-and-suspenders against any oversized embedded content forcing the
     whole page to scroll sideways. */
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

button, input, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.site-header-row {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
}

.header-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand .brand-accent { color: var(--accent); }

.header-search {
  flex: 1;
  max-width: 420px;
  display: flex;
}
.header-search input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 9px 12px;
  color: var(--text);
}
.header-search button {
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 9px 14px;
  cursor: pointer;
  color: #1a1a1e;
  font-weight: 600;
}

.top-models-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.top-models-strip::-webkit-scrollbar { display: none; }
.top-models-strip-mobile { display: none; }

.top-model-chip {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.top-model-chip:hover { color: var(--accent); border-color: var(--accent-dim); }
.top-model-viewall {
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--accent);
  white-space: nowrap;
  margin-left: 2px;
}

.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h));
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-h));
  position: sticky;
  top: var(--header-h);
}

.sidebar-section + .sidebar-section { margin-top: 24px; }
.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list li { margin-bottom: 2px; }
.sidebar-list a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
}
.sidebar-list a:hover, .sidebar-list a.active {
  background: var(--bg-hover);
  color: var(--text);
}
.sidebar-count { color: var(--text-faint); font-size: 12px; }

.sidebar-backdrop {
  display: none;
}

main.content {
  flex: 1;
  min-width: 0;
  padding: 24px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0 0 6px;
}
.page-subtitle {
  color: var(--text-dim);
  margin: 0 0 20px;
  font-size: 14px;
}

/* ---------- Card grid ---------- */

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 14px;
}
.section-heading h2 {
  font-family: var(--font-display);
  font-size: 19px;
  margin: 0;
}
.section-heading a { font-size: 13px; color: var(--text-dim); }

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

.card {
  background: var(--bg-raised);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }

.card-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.card-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.card-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: var(--accent);
  color: #1a1a1e;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.card-views {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}

.card-body { padding: 10px 12px; }
.card-title {
  font-size: 13.5px;
  line-height: 1.35;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cats { display: flex; flex-wrap: wrap; gap: 4px; }
.card-cats span {
  font-size: 10.5px;
  color: var(--text-faint);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ---------- Pagination ---------- */

.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 32px 0 8px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
}
.pagination a:hover { border-color: var(--accent); color: var(--text); }
.pagination .current { background: var(--accent); color: #1a1a1e; border-color: var(--accent); font-weight: 600; }

/* ---------- Post detail ---------- */

.post-header { margin-bottom: 16px; }
.post-title { font-family: var(--font-display); font-size: 24px; margin: 0 0 8px; }
.post-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text-faint); font-size: 13px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.post-tags a {
  font-size: 12.5px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-dim);
}
.post-tags a:hover { border-color: var(--accent); color: var(--text); }
.post-tags .tag-model { color: var(--accent); }

.player-wrap {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}
.player-wrap video { width: 100%; display: block; max-height: 70vh; background: #000; }
.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-raised);
  flex-wrap: wrap;
}
.quality-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5px 8px;
}
.player-hint { color: var(--text-faint); font-size: 12px; margin-left: auto; }

.post-description {
  color: var(--text-dim);
  line-height: 1.7;
  margin: 16px 0;
  white-space: pre-line;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0 8px;
}
.gallery img {
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid var(--border);
}

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

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 5px; }
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="url"],
.form-row textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--text);
}
.form-row textarea { min-height: 100px; resize: vertical; }
.btn {
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 9px 16px;
  color: #1a1a1e;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--accent-dim); }
.btn.btn-secondary { background: var(--bg-hover); color: var(--text); }
.btn.btn-danger { background: #4a1f1a; color: #ff8a70; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--accent); }

.download-links-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ---------- Ad slots ---------- */
.ad-slot, .ad-native-slot {
  margin: 18px 0;
  display: flex;
  justify-content: center;
  overflow: hidden;
}
.sidebar-section .ad-slot { margin: 12px 0 0; }

/* ---------- Download unlock timer ---------- */
.download-timer-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-top: 10px;
  max-width: 420px;
}
.download-timer-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-hover);
  overflow: hidden;
}
.download-timer-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 1s linear;
}

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.admin-table th { color: var(--text-faint); font-weight: 600; }

.chip-input {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
}
.chip-input .chip {
  background: var(--bg-hover);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip-input .chip button { background: none; border: none; color: var(--text-faint); cursor: pointer; }
.chip-input input {
  flex: 1;
  min-width: 120px;
  background: none;
  border: none;
  color: var(--text);
  padding: 4px;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tabs button {
  background: none;
  border: none;
  padding: 10px 14px;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--text); border-color: var(--accent); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }
.loading-state { text-align: center; padding: 60px 20px; color: var(--text-faint); }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  z-index: 100;
}
.toast.error { border-color: #ff5d3b; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .header-menu-btn { display: block; }
  .brand { font-size: 17px; }
  .top-models-strip:not(.top-models-strip-mobile) { display: none; }
  .top-models-strip-mobile {
    display: flex;
    padding: 8px 16px 10px;
    border-top: 1px solid var(--border);
  }

  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    background: var(--bg-raised);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 60;
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 55;
  }
  .header-search { max-width: none; }
  .header-search input { min-width: 0; }
  main.content { padding: 16px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
