:root {
  --bg: #000000;
  --surface: #111111;
  --text: #ffffff;
  --muted: #888888;
  --accent: #ffffff;
  --border: #222222;
  --radius: 0;
  --font-hero: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-ui: "Barlow", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  opacity: 0.65;
}

.nav-muted {
  opacity: 0.35;
  pointer-events: none;
}

/* ——— Home ——— */

.page-home {
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

.home-header,
.home-footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(0.85rem, 2.5vw, 1.75rem) clamp(1rem, 4vw, 2.5rem);
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  pointer-events: none;
}

.home-header > *,
.home-footer > * {
  pointer-events: auto;
}

.home-header {
  top: 0;
}

.home-footer {
  bottom: 0;
}

.home-brand,
.home-footer-brand {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.65rem, 2vw, 1.5rem);
}

.site-nav a {
  font-size: 11px;
  letter-spacing: 0.16em;
}

.nav-login {
  border: 1px solid rgba(255, 255, 255, 0.55);
  padding: 0.55rem 1rem;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.nav-login:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.nav-login--active {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.home-footer-tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.14em;
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-footer-copy {
  font-size: 11px;
  letter-spacing: 0.1em;
}

.home-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(5rem, 14vh, 8rem) clamp(0.5rem, 2vw, 1.5rem);
  overflow-x: hidden;
}

.hero-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
}

.hero-greeting,
.hero-name {
  text-align: center;
  font-family: var(--font-hero);
  font-size: clamp(2.2rem, 11vw, 8.5rem);
  font-weight: 500;
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: #fff;
  position: relative;
}

.hero-greeting {
  margin: 0;
  padding: 0 0.5rem;
  z-index: 3;
  margin-bottom: clamp(-2.25rem, -7vw, -1rem);
}

.hero-carousel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: min(96vw, 520px);
  margin: 0 auto;
  touch-action: pan-y;
}

.hero-stack {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 420px;
  height: clamp(200px, 38vw, 480px);
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.hero-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.hero-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
}

.hero-slide img,
.hero-slide__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  background: #111;
}

.hero-slide__img:not([src]) {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.hero-slide__img[src] {
  opacity: 1;
}

.hero-carousel__nav {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.hero-carousel__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.hero-carousel__nav:disabled {
  opacity: 0.25;
  cursor: default;
}

.hero-carousel--solo .hero-carousel__nav {
  visibility: hidden;
  pointer-events: none;
}

.hero-name {
  margin-top: clamp(-2.5rem, -8vw, -1.25rem);
  z-index: 2;
  padding: 0 0.25rem;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

/* Desktop: фото почти на весь экран + текст поверх */
@media (min-width: 769px) {
  .page-home {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .page-home .home-hero {
    padding: 0;
    min-height: 0;
    flex: 1;
    align-items: stretch;
  }

  .hero-center {
    display: grid;
    grid-template-areas: "hero-stack";
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    justify-items: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: clamp(4rem, 8.5vh, 5.5rem) clamp(1.25rem, 3vw, 2.75rem)
      clamp(3.5rem, 7vh, 5rem);
    box-sizing: border-box;
  }

  .hero-greeting,
  .hero-carousel,
  .hero-name {
    grid-area: hero-stack;
  }

  .hero-carousel {
    position: relative;
    z-index: 1;
    align-self: center;
    justify-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-width: none;
    margin: 0;
    gap: 0;
  }

  .hero-stack {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    flex: 0 0 auto;
    border-radius: 3px;
    box-shadow: 0 16px 56px rgba(0, 0, 0, 0.55);
  }

  .hero-slide img {
    object-fit: cover;
    object-position: center;
  }

  .hero-greeting,
  .hero-name {
    font-size: clamp(2.25rem, 4.5vw, 4.5rem);
    line-height: 0.92;
  }

  .hero-greeting {
    align-self: start;
    justify-self: center;
    z-index: 3;
    margin: 0;
    padding: 0.2em 0.5rem 0;
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7);
  }

  .hero-name {
    align-self: end;
    justify-self: center;
    z-index: 3;
    margin: 0;
    padding: 0 0.25rem 0.25em;
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.7);
  }

  .hero-name .hero-line {
    line-height: 0.92;
  }

  .hero-name .hero-line + .hero-line {
    margin-top: -0.02em;
  }

  .hero-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .hero-carousel__nav--prev {
    left: clamp(0.5rem, 1.25vw, 1rem);
  }

  .hero-carousel__nav--next {
    right: clamp(0.5rem, 1.25vw, 1rem);
  }
}

/* Планшет и телефон: свайп, стрелки скрыты */
@media (max-width: 768px) {
  .hero-carousel__nav {
    display: none;
  }

  .hero-carousel {
    max-width: 100%;
    width: 100%;
    padding: 0 0.25rem;
  }
}

/* Мобилка: hero на весь экран */
@media (max-width: 768px) {
  .page-home {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  .home-hero {
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: calc(3.25rem + env(safe-area-inset-top, 0px)) 0
      calc(3.25rem + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
  }

  .hero-center {
    flex: 1;
    display: grid;
    grid-template-rows: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
    align-items: center;
    justify-items: center;
    width: 100%;
    min-height: 0;
    gap: 0.25rem;
  }

  .hero-greeting,
  .hero-name {
    font-size: clamp(2.5rem, 14vw, 5rem);
    line-height: 0.88;
    letter-spacing: -0.02em;
  }

  .hero-greeting {
    width: 100%;
    margin: 0;
    padding: 0 0.35rem;
    margin-bottom: clamp(-2.5rem, -11vw, -1.25rem);
  }

  .hero-carousel {
    width: 100%;
    max-width: 100%;
    flex: 1;
    min-height: 0;
    align-self: stretch;
  }

  .hero-stack {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1;
  }

  .hero-name {
    width: 100%;
    margin-top: clamp(-2.75rem, -12vw, -1rem);
    padding: 0 0.25rem;
  }

  .hero-name .hero-line {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  .home-footer {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    row-gap: 0.35rem;
  }

  .home-footer-tagline {
    position: static;
    transform: none;
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .home-footer-brand {
    order: 1;
  }

  .home-footer-copy {
    order: 2;
  }

  .site-footer--minimal {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 1rem;
    text-align: center;
  }

  .site-footer--minimal .footer-tagline {
    position: static;
    transform: none;
    width: 100%;
    order: 3;
  }
}

@media (max-width: 480px) {
  .hero-greeting,
  .hero-name {
    font-size: clamp(2.2rem, 15vw, 3.75rem);
  }

  .hero-greeting {
    margin-bottom: clamp(-2rem, -10vw, -1rem);
  }

  .home-brand,
  .site-nav a {
    font-size: 9px;
  }

  .nav-login {
    padding: 0.45rem 0.75rem;
    min-height: 2.5rem;
  }

  .page-gallery main,
  .page-admin main {
    padding: 5rem 1rem 4rem;
  }

  .gallery-page-title {
    font-size: clamp(2rem, 12vw, 3rem);
  }

  .lightbox {
    padding: 1rem;
  }
}

/* ——— Gallery page ——— */

.page-gallery main {
  max-width: min(100%, 1680px);
  margin: 0 auto;
  padding: 6rem clamp(1rem, 3vw, 2.5rem) 5rem;
}

.site-header--minimal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: none;
}

.site-header--minimal .logo {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
}

.site-header--minimal {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.site-header--minimal .site-nav a {
  font-size: 11px;
  letter-spacing: 0.16em;
}

.site-footer--minimal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  border-top: none;
  margin-top: 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  position: relative;
}

.site-footer--minimal .footer-tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.gallery-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.gallery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  max-width: 100%;
}

.gallery-tags.hidden {
  display: none;
}

.gallery-tag {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  padding: 0.45rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.gallery-tag:hover,
.gallery-tag.is-active {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.gallery-empty {
  flex: 1 1 100%;
  width: 100%;
  margin: 2rem 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.95rem;
}

.upload-tags-field {
  margin-top: 1rem;
}

.field-hint {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
}

.gallery-page-title {
  font-family: var(--font-hero);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1;
}

/* Grid view — flex masonry; column width = 1/N of row (N = max cols for breakpoint) */
.gallery-grid {
  --gallery-gap: 12px;
  --gallery-cols: 7;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-start;
  gap: var(--gallery-gap);
  width: 100%;
}

.gallery-grid__col {
  flex: 0 1
    calc(
      (100% - (var(--gallery-cols) - 1) * var(--gallery-gap)) / var(--gallery-cols)
    );
  max-width: calc(
    (100% - (var(--gallery-cols) - 1) * var(--gallery-gap)) / var(--gallery-cols)
  );
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gallery-gap);
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  cursor: pointer;
  background: #1a1a1a;
  border: none;
  padding: 0;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
  vertical-align: top;
  opacity: 0;
  transition: transform 0.45s ease, opacity 0.35s ease;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
  background: #1a1a1a;
}

.gallery-item img.is-loaded,
.gallery-item img[src] {
  opacity: 1;
}

.gallery-item:hover img {
  transform: scale(1.02);
  opacity: 0.94;
}

@media (min-width: 900px) {
  .gallery-grid {
    --gallery-gap: 14px;
  }

  .gallery-item img {
    max-height: 520px;
  }
}

@media (max-width: 899px) {
  .gallery-grid {
    --gallery-cols: 4;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    --gallery-gap: 8px;
    --gallery-cols: 2;
  }

  .gallery-item img {
    max-height: 360px;
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
}

.admin-lightbox {
  background: rgba(0, 0, 0, 0.97);
}

.lightbox.hidden {
  display: none;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text);
  font-size: 2.5rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-download {
  flex-shrink: 0;
  padding: 0.5rem 0 0;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.lightbox-download:hover {
  color: var(--text);
  opacity: 1;
}

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

.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  width: auto;
  max-width: 95vw;
  margin: 0;
  background: transparent;
}

.lightbox-stage {
  position: relative;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
}

.lightbox-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
}

@media (min-width: 900px) {
  .lightbox {
    padding: 1rem 1.5rem;
  }

  .lightbox-layout {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
    max-height: 94vh;
  }

  .lightbox-inner {
    margin: 0 auto;
    flex-shrink: 0;
  }

  /* Теги справа, фото остаётся по центру экрана */
  .lightbox-editor:not(.hidden) {
    position: absolute;
    right: clamp(0.75rem, 2vw, 2rem);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: min(300px, 24vw);
    min-width: 240px;
    max-height: min(88vh, calc(100vh - 4rem));
    overflow-y: auto;
  }
}

.lightbox-layer--hd {
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.lightbox-layer--hd.is-visible {
  opacity: 1;
}

.lightbox-inner figcaption {
  text-align: center;
  margin-top: 1rem;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.lightbox-editor {
  width: min(95vw, 520px);
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
}

.lightbox-editor__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.lightbox-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  max-width: 100%;
  padding: 0.3rem 0.55rem;
  font-size: 0.8rem;
  line-height: 1.2;
  text-transform: lowercase;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: default;
}

.lightbox-tag-chip.is-selected {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.14);
}

.lightbox-tag-chip--edit {
  padding: 0.15rem 0.45rem;
  cursor: text;
}

.lightbox-tag-chip__text {
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 12rem;
}

.lightbox-tag-chip__remove {
  display: none;
  width: 1.1rem;
  height: 1.1rem;
  padding: 0;
  margin-left: 0.1rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.lightbox-tag-chip.is-selected .lightbox-tag-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lightbox-tag-chip__remove:hover {
  background: rgba(240, 128, 128, 0.55);
}

.lightbox-tag-chip__input {
  width: 6.5rem;
  min-width: 4rem;
  max-width: 10rem;
  padding: 0.2rem 0.35rem;
  font-size: 0.8rem;
  text-transform: lowercase;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text);
  outline: none;
}

.lightbox-tag-add {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.lightbox-tag-add:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.lightbox-tag-suggestions {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.lightbox-tag-suggestions.hidden {
  display: none;
}

.lightbox-tag-suggestions button {
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: lowercase;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.lightbox-tag-suggestions button:hover {
  border-color: var(--text);
  background: rgba(255, 255, 255, 0.12);
}

.lightbox-editor__status {
  font-size: 0.75rem;
  color: var(--muted);
}

.lightbox-editor__status--ok {
  color: #8fd49a;
}

.lightbox-editor__status--error {
  color: #f08080;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.hidden {
  display: none !important;
}

/* ——— Admin ——— */

.page-admin {
  text-transform: none;
  letter-spacing: normal;
  font-size: 16px;
  background: var(--bg);
  min-height: 100vh;
}

.page-admin button {
  font-family: inherit;
  color: inherit;
}

.page-admin .site-header--minimal .nav-login {
  display: none;
}

.page-admin main {
  padding: 5.5rem 1rem 3rem;
}

.admin-wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.admin-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-title {
  margin: 0;
  font-family: var(--font-hero);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-subtitle {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-back {
  flex-shrink: 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.25rem;
}

.admin-back:hover {
  color: var(--text);
  opacity: 1;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  margin-bottom: 1rem;
}

.admin-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.admin-card__desc {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-form .field {
  margin-bottom: 1rem;
}

.admin-form label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.admin-form input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-form input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-toolbar__user {
  font-size: 0.9rem;
  color: var(--muted);
}

.admin-toolbar__user strong {
  color: var(--text);
  font-weight: 600;
}

.upload-zone {
  position: relative;
  margin-bottom: 1rem;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-zone:hover,
.upload-zone.is-dragover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.04);
}

.upload-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-zone__body {
  padding: clamp(2rem, 8vw, 3rem) 1rem;
  text-align: center;
  pointer-events: none;
}

.upload-zone__icon {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 1.75rem;
  opacity: 0.6;
}

.upload-zone__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.upload-zone__hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.preview-panel {
  margin-bottom: 1rem;
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.preview-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-panel__head strong {
  color: var(--text);
}

.file-preview {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-height: min(50vh, 420px);
  overflow-y: auto;
}

.file-preview__item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.65rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.file-preview__media {
  position: relative;
  aspect-ratio: 1;
  width: 88px;
}

.file-preview__tags-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.file-preview__tags-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.file-preview__tags {
  width: 100%;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.file-preview__zoom {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: #111;
  cursor: zoom-in;
  overflow: hidden;
  transition: border-color 0.2s ease, opacity 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.file-preview__zoom:hover {
  border-color: rgba(255, 255, 255, 0.45);
  opacity: 0.92;
}

.file-preview__zoom img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.admin-lightbox .lightbox-inner {
  max-width: min(92vw, 720px);
}

.admin-lightbox .lightbox-inner img {
  max-height: 80vh;
  background-color: #0a0a0a;
}

.file-preview__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.file-preview__remove:hover {
  background: #c44;
  transform: scale(1.05);
}

.upload-progress {
  height: 4px;
  margin-bottom: 1rem;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.upload-progress__bar {
  height: 100%;
  width: 0%;
  background: #fff;
  border-radius: 4px;
  transition: width 0.25s ease;
}

.upload-actions {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.upload-actions .btn-primary {
  flex: 1;
}

.btn {
  font: inherit;
  cursor: pointer;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary,
.btn.btn-primary {
  background: #fff;
  border-color: #fff;
  color: #000;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled),
.btn.btn-primary:hover:not(:disabled) {
  background: #e8e8e8;
  opacity: 1;
}

.btn-ghost {
  border-color: transparent;
  color: var(--muted);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
  color: var(--text);
  opacity: 1;
}

.btn-block {
  display: block;
  width: 100%;
}

.form-message {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  min-height: 1.25rem;
  color: var(--text);
}

.form-message--error {
  color: #f08080;
}

.form-message--success {
  color: #8fd49a;
}

.form-message--warn {
  color: #c9a227;
}

@media (max-width: 480px) {
  .page-admin main {
    padding: 4.75rem 0.75rem 2rem;
  }

  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-back {
    align-self: flex-start;
  }

  .admin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-ghost {
    align-self: flex-start;
  }

  .upload-actions {
    flex-direction: column;
  }

  .upload-actions .btn-primary {
    width: 100%;
  }
}
