:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: #11161d;
  --panel-2: #151b24;
  --text: #f6f7fb;
  --muted: #a8b3c4;
  --line: rgba(255, 255, 255, 0.12);
  --cyan: #48d7ff;
  --pink: #ff5ea8;
  --lime: #a8ff6a;
  --amber: #ffcf5d;
  --danger: #ff7676;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.sl-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(6, 7, 10, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.sl-nav {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.sl-brand {
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: 0;
}

.sl-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sl-links a, .sl-pill, .sl-menu, .sl-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  text-decoration: none;
  cursor: pointer;
}

.sl-links a:not(.sl-pill) {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.sl-menu { display: none; }
.sl-btn.primary, .sl-pill {
  border-color: rgba(72, 215, 255, 0.45);
  background: linear-gradient(135deg, rgba(72, 215, 255, 0.23), rgba(255, 94, 168, 0.18));
}
.sl-btn.compact { min-height: 36px; padding: 0 12px; }

.sl-hero {
  position: relative;
  min-height: 68vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.sl-hero-img, .sl-hero-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sl-hero-empty {
  background:
    linear-gradient(90deg, rgba(72, 215, 255, 0.26) 0 10%, transparent 10% 12%, rgba(255, 94, 168, 0.25) 12% 23%, transparent 23% 25%, rgba(168, 255, 106, 0.23) 25% 36%, transparent 36% 38%),
    repeating-linear-gradient(90deg, #141922 0 72px, #090b10 72px 78px),
    repeating-linear-gradient(0deg, transparent 0 72px, rgba(255,255,255,0.08) 72px 78px);
}

.sl-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 7, 10, 0.1), rgba(6, 7, 10, 0.66) 55%, #06070a 100%);
}

.sl-hero-copy {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 60px;
}

.sl-kicker {
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sl-hero h1 {
  font-size: clamp(3.2rem, 8vw, 7rem);
  line-height: 0.92;
  margin: 10px 0 14px;
  letter-spacing: 0;
}

.sl-hero p {
  max-width: 680px;
  color: #d8deeb;
  font-size: 1.16rem;
  margin: 0 0 24px;
}

.sl-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.sl-stats {
  width: min(1180px, calc(100% - 32px));
  margin: -28px auto 0;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #0d1118;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sl-stats div, .sl-admin-stats div {
  padding: 20px;
  border-right: 1px solid var(--line);
}
.sl-stats div:last-child, .sl-admin-stats div:last-child { border-right: 0; }
.sl-stats strong, .sl-admin-stats strong { display: block; font-size: 1.65rem; }
.sl-stats span, .sl-admin-stats span { color: var(--muted); font-size: 0.9rem; }

.sl-story, .sl-gallery-section, .sl-dashboard, .sl-page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.sl-story {
  padding: 78px 0 48px;
  display: grid;
  grid-template-columns: 0.9fr 1fr 1fr;
  gap: 26px;
  align-items: start;
}

.sl-story h2, .sl-gallery-head h2, .sl-section-head h2, .sl-page-hero h1 {
  margin: 6px 0 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.sl-story p {
  margin: 0;
  color: var(--muted);
}

.sl-gallery-section { padding: 24px 0 84px; }
.sl-gallery-head, .sl-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sl-filter { display: flex; gap: 8px; align-items: center; }
.sl-filter select, .sl-upload-form input, .sl-upload-form textarea, .sl-admin-row input {
  width: 100%;
  background: #0c1017;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.sl-mosaic {
  columns: 7 128px;
  column-gap: 8px;
}

.sl-tile {
  position: relative;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
  background: #0c1017;
  cursor: zoom-in;
  break-inside: avoid;
}

.sl-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}
.sl-tile:hover img { transform: scale(1.04); filter: saturate(1.15); }
.sl-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(255, 207, 93, 0.92);
  color: #17100a;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 800;
}

.sl-empty-gallery, .sl-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.sl-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 48px 18px;
  background: rgba(0, 0, 0, 0.88);
}
.sl-lightbox img {
  max-width: min(1200px, 94vw);
  max-height: 78vh;
  object-fit: contain;
  border-radius: 8px;
}
.sl-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  padding: 0 12px;
  cursor: pointer;
}
.sl-modal-open { overflow: hidden; }

.sl-page-hero { padding: 56px 0 22px; }
.sl-page-hero p { color: var(--muted); max-width: 720px; }
.sl-dashboard { padding-bottom: 80px; }
.sl-alert {
  padding: 12px 14px;
  border: 1px solid rgba(168, 255, 106, 0.35);
  border-radius: 8px;
  background: rgba(168, 255, 106, 0.08);
  margin-bottom: 14px;
}
.sl-alert.bad {
  border-color: rgba(255, 118, 118, 0.45);
  background: rgba(255, 118, 118, 0.09);
}
.sl-admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 18px;
  background: #0d1118;
}
.sl-panel { margin-bottom: 18px; }
.sl-upload-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sl-upload-form label { color: var(--muted); display: grid; gap: 6px; }
.sl-upload-form label:nth-child(5), .sl-drop, .sl-checks { grid-column: 1 / -1; }
.sl-checks { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.sl-checks input { width: auto; }

.sl-admin-list { display: grid; gap: 12px; }
.sl-admin-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.sl-admin-row img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 8px;
}
.sl-admin-row form:first-of-type {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.sl-admin-row label { color: var(--muted); display: grid; gap: 4px; }
.sl-row-actions { display: flex; justify-content: flex-end; }
.sl-delete-form { align-self: stretch; display: flex; align-items: center; }
.sl-link-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  text-decoration: underline;
}

.sl-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.sl-login {
  width: min(520px, calc(100% - 32px));
}
.sl-login-panel {
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
}
.sl-login-panel h1 { margin: 8px 0; line-height: 1.05; }
.sl-login-panel p, .sl-login-back { color: var(--muted); }
.sl-login-back { display: inline-flex; margin-left: 12px; }

.sl-footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  color: var(--muted);
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.sl-footer strong { color: var(--text); }

@media (max-width: 820px) {
  .sl-menu { display: inline-flex; }
  .sl-links {
    display: none;
    position: absolute;
    left: 16px;
    right: 16px;
    top: 64px;
    padding: 10px;
    background: #0d1118;
    border: 1px solid var(--line);
    border-radius: 8px;
    flex-direction: column;
    align-items: stretch;
  }
  .sl-links.is-open { display: flex; }
  .sl-stats, .sl-admin-stats { grid-template-columns: repeat(2, 1fr); }
  .sl-stats div:nth-child(2), .sl-admin-stats div:nth-child(2) { border-right: 0; }
  .sl-story { grid-template-columns: 1fr; }
  .sl-gallery-head { align-items: stretch; flex-direction: column; }
  .sl-filter { align-items: stretch; }
  .sl-upload-form, .sl-admin-row, .sl-admin-row form:first-of-type { grid-template-columns: 1fr; }
  .sl-delete-form { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .sl-hero { min-height: 74vh; }
  .sl-hero h1 { font-size: 3.2rem; }
  .sl-stats, .sl-admin-stats { grid-template-columns: 1fr; }
  .sl-stats div, .sl-admin-stats div { border-right: 0; border-bottom: 1px solid var(--line); }
  .sl-stats div:last-child, .sl-admin-stats div:last-child { border-bottom: 0; }
  .sl-filter { flex-direction: column; }
}
