:root {
  color-scheme: dark;
  --bg: #06070b;
  --ink: #f8f5ef;
  --muted: #aab3c7;
  --line: rgba(255, 255, 255, 0.14);
  --panel: rgba(17, 19, 28, 0.82);
  --panel-strong: rgba(23, 25, 36, 0.96);
  --jade: #25e8c8;
  --rose: #ff4f88;
  --gold: #ffd166;
  --blue: #49b6ff;
  --violet: #8e7cff;
  --danger: #ff6b6b;
  --radius: 8px;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(115deg, rgba(37, 232, 200, 0.18), transparent 30%),
    linear-gradient(250deg, rgba(255, 79, 136, 0.14), transparent 34%),
    linear-gradient(180deg, #07090f 0%, #12131d 52%, #06070b 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(150deg, transparent 0 18%, rgba(255, 209, 102, 0.15) 18% 18.25%, transparent 18.25% 100%),
    linear-gradient(40deg, transparent 0 70%, rgba(73, 182, 255, 0.15) 70% 70.25%, transparent 70.25% 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 108px);
}

body.lock-scroll {
  overflow: hidden;
}

body.is-booting main {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.985);
}

body.is-ready main {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--jade);
  font-size: 0.74rem;
  font-weight: 820;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.7rem);
}

h2 {
  font-size: clamp(2rem, 5vw, 4.35rem);
}

h3 {
  font-size: clamp(1.45rem, 3vw, 2.5rem);
}

.lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.boot-splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 48%, rgba(37, 232, 200, 0.24), transparent 30%),
    linear-gradient(150deg, rgba(37, 232, 200, 0.18), transparent 35%),
    linear-gradient(32deg, transparent 36%, rgba(255, 209, 102, 0.13), rgba(255, 79, 136, 0.16), transparent 70%),
    linear-gradient(180deg, #070912, #10111e 54%, #05070d);
}

.boot-splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 520ms ease, transform 520ms ease, visibility 520ms step-end;
}

.boot-splash::before,
.boot-splash::after,
.splash-rays {
  position: absolute;
  inset: -18%;
  pointer-events: none;
  content: "";
}

.boot-splash::before {
  background:
    linear-gradient(108deg, rgba(37, 232, 200, 0.24), transparent 45%),
    linear-gradient(288deg, rgba(255, 79, 136, 0.18), transparent 48%);
  filter: blur(48px);
  mix-blend-mode: screen;
  animation: auroraDrift 8s ease-in-out infinite alternate;
}

.boot-splash::after {
  background:
    linear-gradient(118deg, transparent 0 43%, rgba(255, 255, 255, 0.07) 45%, transparent 49%),
    linear-gradient(118deg, transparent 0 58%, rgba(37, 232, 200, 0.08) 60%, transparent 64%);
  transform: translateX(-20%);
  animation: rayTravel 4.8s linear infinite;
}

.splash-rays {
  background:
    repeating-linear-gradient(122deg, transparent 0 92px, rgba(255, 255, 255, 0.04) 92px 95px, transparent 95px 176px);
  filter: blur(4px);
  opacity: 0.68;
  animation: rayFloat 7s ease-in-out infinite alternate;
}

.splash-stack {
  position: relative;
  z-index: 1;
  display: grid;
  width: 210px;
  height: 210px;
  place-items: center;
  margin-top: -82px;
  animation: splashReveal 820ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.float-pane {
  position: absolute;
  width: 78px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.pane-blue {
  transform: translate(-58px, -42px) rotate(-12deg);
  background-color: rgba(73, 182, 255, 0.22);
  animation: paneFloatA 4.8s ease-in-out infinite;
}

.pane-gold {
  transform: translate(56px, 32px) rotate(-6deg);
  background-color: rgba(255, 209, 102, 0.18);
  animation: paneFloatB 5.4s ease-in-out infinite;
}

.pane-rose {
  transform: translate(46px, -52px) rotate(-9deg);
  background-color: rgba(255, 79, 136, 0.18);
  animation: paneFloatC 5.1s ease-in-out infinite;
}

.logo-mark {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 50%, rgba(37, 232, 200, 0.28), transparent 56%),
    linear-gradient(135deg, #081422, #121325 50%, #05070e);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.38), 0 0 36px rgba(37, 232, 200, 0.18);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.splash-logo-mark {
  width: 132px;
  height: 132px;
  animation: logoBreathe 2.1s ease-in-out infinite alternate;
}

.compact-logo {
  width: 58px;
  height: 58px;
  border-radius: 15px;
}

.logo-pane,
.logo-lock,
.logo-shine {
  position: absolute;
  display: block;
}

.logo-pane-a {
  inset: 24% 28% 20% 12%;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--jade), var(--gold) 55%, var(--rose));
  opacity: 0.78;
  transform: rotate(-2deg);
}

.logo-pane-b {
  inset: 16% 12% 26% 26%;
  border-radius: 16px;
  background: linear-gradient(135deg, #2f7fff, var(--jade) 50%, #ffe06d);
  opacity: 0.72;
}

.logo-pane-c {
  inset: 50% 16% 20% 20%;
  border-radius: 15px;
  background: linear-gradient(135deg, #1ef6d2, #a8f0be 50%, #ff5c82);
  opacity: 0.82;
}

.logo-lock {
  left: 50%;
  top: 49%;
  width: 34%;
  height: 34%;
  transform: translate(-50%, -50%);
}

.logo-lock::before {
  position: absolute;
  inset: 9%;
  border: 5px solid rgba(255, 226, 107, 0.9);
  transform: rotate(45deg);
  content: "";
}

.logo-lock::after {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18%;
  height: 48%;
  border-radius: 99px;
  background: #05070e;
  box-shadow: 0 -11px 0 6px #05070e;
  transform: translate(-50%, -24%);
  content: "";
}

.logo-shine {
  inset: -30% auto -30% -46%;
  width: 32%;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.48), transparent);
  transform: rotate(28deg);
  animation: logoShine 1.85s linear infinite;
  mix-blend-mode: screen;
}

.splash-copy {
  position: absolute;
  top: calc(50% + 96px);
  right: 0;
  left: 0;
  z-index: 1;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 0 28px;
  text-align: center;
  animation: copyReveal 760ms ease-out 220ms both;
}

.splash-copy strong {
  font-size: clamp(2.6rem, 8vw, 3.6rem);
  line-height: 1;
}

.splash-copy span {
  color: var(--jade);
  font-weight: 750;
}

.splash-copy small {
  color: var(--muted);
}

.splash-rail {
  position: absolute;
  top: calc(50% + 205px);
  left: 50%;
  z-index: 1;
  width: 120px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  margin-left: -60px;
  animation: copyReveal 760ms ease-out 420ms both;
}

.splash-rail span {
  display: block;
  width: 42px;
  height: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), var(--gold), var(--rose));
  box-shadow: 0 0 12px rgba(37, 232, 200, 0.55);
  animation: railMove 1.85s linear infinite;
}

.gate-view {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(360px, 1fr);
  gap: clamp(30px, 6vw, 86px);
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(20px, 5vw, 72px);
  align-items: center;
}

.gate-view::before,
.gate-view::after,
.gate-orbit {
  position: absolute;
  pointer-events: none;
  content: "";
}

.gate-view::before {
  inset: -30% -18% auto -18%;
  height: 68%;
  background:
    linear-gradient(115deg, rgba(37, 232, 200, 0.22), transparent 44%),
    linear-gradient(250deg, rgba(255, 79, 136, 0.18), transparent 48%);
  filter: blur(52px);
  opacity: 0.9;
  animation: auroraDrift 9s ease-in-out infinite alternate;
}

.gate-view::after {
  inset: 0;
  background:
    linear-gradient(122deg, transparent 0 42%, rgba(255, 255, 255, 0.055) 44%, transparent 48%),
    linear-gradient(122deg, transparent 0 66%, rgba(73, 182, 255, 0.045) 68%, transparent 72%);
  animation: rayTravel 6.5s linear infinite;
}

.gate-orbit {
  right: 7vw;
  top: 10vh;
  width: min(42vw, 560px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(37, 232, 200, 0.07), 0 0 80px rgba(37, 232, 200, 0.07);
  opacity: 0.52;
}

.gate-view.compact {
  grid-template-columns: minmax(320px, 620px);
  justify-content: center;
}

.gate-card,
.viewer-header,
.viewer-tools,
.admin-panel,
.admin-sidebar,
.admin-top,
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.gate-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: clamp(28px, 5vw, 54px);
  animation: gateRise 680ms ease-out 140ms both;
}

.gate-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 28px;
}

.gate-brand strong {
  display: block;
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 900;
}

.gate-card h1 {
  max-width: 9ch;
}

.gate-form {
  display: grid;
  gap: 10px;
  margin-top: clamp(46px, 8vh, 86px);
}

.gate-form label,
.form-grid label,
.card-editor label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  min-height: 56px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  outline: 0;
}

.gate-row input {
  padding: 0 16px;
  border: 0;
  background: transparent;
}

input::placeholder {
  color: rgba(248, 245, 239, 0.45);
}

.gate-row button,
.primary-button {
  border: 0;
  color: #071013;
  font-weight: 860;
  background: linear-gradient(135deg, var(--jade), var(--gold) 52%, var(--rose));
}

.gate-row button {
  min-width: 112px;
}

.gate-row button:disabled {
  cursor: wait;
  filter: saturate(0.82);
  opacity: 0.78;
}

.gate-row:focus-within {
  border-color: rgba(37, 232, 200, 0.58);
  box-shadow: 0 0 0 4px rgba(37, 232, 200, 0.08);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.form-message.success {
  color: var(--jade);
}

.gate-preview {
  position: relative;
  z-index: 1;
  min-height: min(720px, 80vh);
  animation: gateRise 760ms ease-out 240ms both;
}

.gate-preview img,
.preview-tile {
  position: absolute;
  width: min(68%, 470px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.preview-tile::before,
.preview-tile::after,
.preview-tile span {
  position: absolute;
  content: "";
}

.preview-tile::before {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.22), transparent 48%);
  mix-blend-mode: screen;
}

.preview-tile::after {
  inset: auto 14px 14px 14px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
}

.preview-tile span {
  inset: 14px 14px auto auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.gate-preview img:nth-child(1),
.preview-tile:nth-child(1) {
  top: 5%;
  left: 4%;
  aspect-ratio: 4 / 5;
}

.gate-preview img:nth-child(2),
.preview-tile:nth-child(2) {
  top: 18%;
  right: 2%;
  aspect-ratio: 1;
}

.gate-preview img:nth-child(3),
.preview-tile:nth-child(3) {
  right: 18%;
  bottom: 4%;
  aspect-ratio: 5 / 4;
}

.tile-a {
  background: linear-gradient(135deg, #11283a, #25e8c8 55%, #ffd166);
  animation: coverFloatA 6s ease-in-out infinite alternate;
}

.tile-b {
  background: linear-gradient(135deg, #1c1328, #49b6ff 38%, #ff8a4c);
  animation: coverFloatB 6.8s ease-in-out infinite alternate;
}

.tile-c {
  background: linear-gradient(135deg, #1a1020, #ff4f88 45%, #25e8c8);
  animation: coverFloatC 7.1s ease-in-out infinite alternate;
}

.viewer-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 3vw, 30px);
}

.viewer-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 16px clamp(16px, 3vw, 28px);
  background: rgba(10, 12, 18, 0.84);
}

.ghost-button,
.danger-button,
.segment,
.round-button,
.ghost-link {
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.ghost-button,
.danger-button,
.ghost-link,
.primary-button {
  min-height: 42px;
  padding: 0 14px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.ghost-button.full {
  width: 100%;
}

.danger-button {
  color: #ffd9d9;
  border-color: rgba(255, 107, 107, 0.42);
}

.month-rail {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.month-rail::-webkit-scrollbar {
  display: none;
}

.month-tab {
  flex: 0 0 auto;
  min-width: 144px;
  min-height: 64px;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
}

.month-tab.active {
  border-color: rgba(37, 232, 200, 0.45);
  background: linear-gradient(135deg, rgba(37, 232, 200, 0.18), rgba(255, 79, 136, 0.1));
}

.month-tab strong,
.month-tab span {
  display: block;
}

.month-tab span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.84rem;
}

.feature-band {
  position: relative;
  display: grid;
  min-height: clamp(300px, 35vw, 430px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #05060a;
  box-shadow: var(--shadow);
}

.feature-band img,
.feature-band video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.06);
}

.feature-band::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, transparent 34%, rgba(5, 7, 11, 0.88));
}

.feature-copy {
  position: absolute;
  right: clamp(18px, 4vw, 44px);
  bottom: clamp(18px, 4vw, 40px);
  z-index: 1;
  display: grid;
  gap: 7px;
  max-width: min(420px, calc(100% - 36px));
  text-align: right;
}

.feature-copy span,
.feature-copy small {
  color: var(--muted);
}

.feature-copy strong {
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 1;
}

.viewer-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
  padding: 10px;
}

.segmented {
  display: flex;
  gap: 6px;
}

.segment {
  min-width: 68px;
  min-height: 40px;
  padding: 0 12px;
}

.segment.active {
  border-color: transparent;
  color: #071013;
  font-weight: 820;
  background: var(--gold);
}

.search-field {
  display: flex;
  gap: 8px;
  align-items: center;
  width: min(260px, 44vw);
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.search-field input {
  border: 0;
  background: transparent;
}

.sort-field {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.sort-field span {
  font-size: 0.84rem;
  font-weight: 760;
}

.sort-field select {
  min-height: 38px;
  border: 0;
  color: var(--ink);
  outline: 0;
  background: transparent;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.photo-card,
.admin-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.photo-button {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.photo-button img,
.photo-button video,
.admin-card > img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.photo-button img,
.photo-button video {
  transition: transform 220ms ease, filter 220ms ease;
}

.photo-card:hover img,
.photo-card:hover video {
  transform: scale(1.035);
  filter: saturate(1.12) contrast(1.05);
}

.badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 8px;
  border-radius: var(--radius);
  color: #071013;
  font-size: 0.78rem;
  font-weight: 820;
  background: linear-gradient(135deg, var(--jade), var(--gold));
}

.photo-meta {
  display: grid;
  gap: 6px;
  padding: 12px;
}

.date,
.tags {
  color: var(--muted);
  font-size: 0.8rem;
}

.title {
  overflow: hidden;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  margin: 36px auto;
  color: var(--muted);
  text-align: center;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  grid-template-rows: 72px minmax(0, 1fr) 72px;
  gap: 12px;
  padding: 16px;
  background: rgba(3, 5, 10, 0.86);
  backdrop-filter: blur(20px);
}

.round-button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  font-size: 1.55rem;
}

.round-button.close {
  grid-column: 3;
  justify-self: end;
}

.round-button.prev {
  grid-row: 2;
  align-self: center;
  justify-self: center;
}

.round-button.next {
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: center;
}

.lightbox figure {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.lightbox img,
.lightbox video {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  object-fit: contain;
  background: #05060a;
}

.lightbox figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  color: var(--muted);
}

.lightbox figcaption strong {
  color: var(--ink);
}

.admin-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  height: 100vh;
  padding: 22px;
  border-radius: 0;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brandmark {
  display: block;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
}

.admin-nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.admin-nav a {
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
}

.admin-nav a:hover {
  border-color: rgba(37, 232, 200, 0.34);
  background: rgba(255, 255, 255, 0.06);
}

.admin-workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: 20px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: clamp(16px, 3vw, 26px);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.stat-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  font-size: 2rem;
}

.admin-panel {
  padding: clamp(16px, 3vw, 24px);
}

.panel-head {
  margin-bottom: 18px;
}

.panel-head.split {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.visit-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.visit-stat {
  display: grid;
  gap: 6px;
  min-height: 84px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(37, 232, 200, 0.09), transparent 56%),
    rgba(255, 255, 255, 0.055);
}

.visit-stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.visit-stat strong {
  overflow: hidden;
  font-size: 1.45rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-table-head,
.visit-row {
  display: grid;
  grid-template-columns: 132px minmax(160px, 1fr) minmax(220px, 1.25fr) minmax(220px, 1.15fr) 64px;
  gap: 10px;
  align-items: center;
}

.visit-table-head {
  padding: 0 12px 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.visit-log {
  display: grid;
  gap: 8px;
}

.visit-row {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
}

.visit-row div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.visit-row strong,
.visit-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-row strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.visit-row span {
  color: var(--muted);
  font-size: 0.76rem;
}

.upload-form,
.card-editor {
  display: grid;
  gap: 14px;
}

.drop-zone {
  position: relative;
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px dashed rgba(37, 232, 200, 0.42);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(37, 232, 200, 0.13), transparent 44%),
    linear-gradient(315deg, rgba(255, 79, 136, 0.12), transparent 48%);
}

.drop-zone.is-dragging {
  border-color: rgba(255, 209, 102, 0.72);
  background:
    linear-gradient(135deg, rgba(37, 232, 200, 0.2), transparent 42%),
    linear-gradient(315deg, rgba(255, 79, 136, 0.18), transparent 48%),
    rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.08);
}

.drop-zone.is-busy {
  cursor: wait;
  opacity: 0.72;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.drop-zone strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.drop-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: var(--radius);
  color: #071013;
  font-size: 1.6rem;
  font-weight: 860;
  background: linear-gradient(135deg, var(--jade), var(--rose), var(--gold));
}

.upload-queue {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.upload-queue div {
  display: grid;
  gap: 4px;
}

.upload-queue span {
  color: var(--muted);
  font-size: 0.82rem;
}

.form-grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid label,
.card-editor label {
  display: grid;
  gap: 8px;
}

.form-grid input,
.card-editor input,
.batch-edit-grid input,
.batch-edit-grid select {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

.check-label,
.card-checks label {
  display: flex !important;
  flex-direction: row;
  align-items: center;
}

.check-label input,
.card-checks input {
  width: 18px;
  min-height: 18px;
}

.upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(136px, 1fr));
  gap: 10px;
}

.upload-preview-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.upload-preview-card img,
.upload-preview-card video {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.upload-preview-meta {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.upload-preview-meta strong {
  overflow: hidden;
  font-size: 0.82rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview-meta span {
  color: var(--muted);
  font-size: 0.76rem;
}

.upload-preview-meta .upload-compress-note {
  color: var(--jade);
}

.mini-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(12px);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: wait;
  filter: saturate(0.82);
  opacity: 0.68;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.admin-gallery {
  display: grid;
  gap: 10px;
}

.batch-toolbar {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.batch-summary,
.batch-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.batch-summary span {
  color: var(--muted);
  font-size: 0.88rem;
}

.batch-edit-grid {
  display: grid;
  grid-template-columns: 150px 150px minmax(180px, 1fr) 140px 140px auto;
  gap: 10px;
  align-items: end;
}

.batch-edit-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.batch-actions {
  min-width: 180px;
}

.admin-list-row {
  display: grid;
  grid-template-columns: 74px 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.image-select {
  display: grid;
  justify-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.image-select input {
  width: 18px;
  height: 18px;
}

.admin-thumb-frame {
  width: 104px;
  aspect-ratio: 1;
}

.admin-thumb {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  object-fit: cover;
  background: #05060a;
}

.list-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 214px;
  gap: 10px;
  min-width: 0;
  padding: 0;
}

.list-fields {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 132px 132px minmax(170px, 1fr);
  gap: 10px;
  min-width: 0;
}

.row-controls {
  display: grid;
  align-content: end;
  gap: 10px;
}

.card-editor {
  padding: 12px;
}

.card-editor.list-editor {
  padding: 0;
}

.card-checks,
.card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-actions {
  justify-content: space-between;
}

.wide {
  grid-column: 1 / -1;
}

.password-grid {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

@keyframes auroraDrift {
  from {
    transform: translate3d(-2%, -1%, 0) rotate(-2deg);
  }

  to {
    transform: translate3d(3%, 2%, 0) rotate(3deg);
  }
}

@keyframes rayTravel {
  from {
    transform: translateX(-18%);
  }

  to {
    transform: translateX(18%);
  }
}

@keyframes rayFloat {
  from {
    transform: translate3d(-1%, -1%, 0);
  }

  to {
    transform: translate3d(1%, 2%, 0);
  }
}

@keyframes splashReveal {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.82);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes copyReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes logoBreathe {
  from {
    box-shadow: 0 22px 58px rgba(0, 0, 0, 0.38), 0 0 24px rgba(37, 232, 200, 0.18);
    transform: scale(0.995);
  }

  to {
    box-shadow: 0 26px 72px rgba(0, 0, 0, 0.44), 0 0 44px rgba(37, 232, 200, 0.36);
    transform: scale(1.025);
  }
}

@keyframes logoShine {
  from {
    left: -46%;
  }

  to {
    left: 118%;
  }
}

@keyframes railMove {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(78px);
  }
}

@keyframes paneFloatA {
  0% {
    transform: translate(-58px, -42px) rotate(-12deg);
  }

  100% {
    transform: translate(-50px, -50px) rotate(-7deg);
  }
}

@keyframes paneFloatB {
  0% {
    transform: translate(56px, 32px) rotate(-6deg);
  }

  100% {
    transform: translate(48px, 24px) rotate(-11deg);
  }
}

@keyframes paneFloatC {
  0% {
    transform: translate(46px, -52px) rotate(-9deg);
  }

  100% {
    transform: translate(54px, -44px) rotate(-4deg);
  }
}

@keyframes gateRise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes coverFloatA {
  from {
    transform: translateY(0) rotate(-1deg);
  }

  to {
    transform: translateY(-12px) rotate(1deg);
  }
}

@keyframes coverFloatB {
  from {
    transform: translateY(0) rotate(1deg);
  }

  to {
    transform: translateY(10px) rotate(-1deg);
  }
}

@keyframes coverFloatC {
  from {
    transform: translateY(0) rotate(-0.5deg);
  }

  to {
    transform: translateY(-8px) rotate(1.5deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 980px) {
  .gate-view {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .gate-card {
    width: 100%;
  }

  .gate-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    min-height: 0;
  }

  .gate-preview img,
  .preview-tile {
    position: static;
    width: 100%;
    aspect-ratio: 4 / 5 !important;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    grid-template-rows: auto;
    grid-template-columns: 1fr;
  }

  .admin-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .batch-edit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visit-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visit-table-head {
    display: none;
  }

  .visit-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-actions {
    grid-column: 1 / -1;
  }

  .admin-list-row {
    grid-template-columns: 52px 92px minmax(0, 1fr);
  }

  .admin-thumb {
    width: 92px;
  }

  .list-editor {
    grid-template-columns: 1fr;
  }

  .list-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    background:
      linear-gradient(150deg, rgba(37, 232, 200, 0.2), transparent 34%),
      linear-gradient(32deg, transparent 34%, rgba(255, 209, 102, 0.12), rgba(255, 79, 136, 0.16), transparent 70%),
      linear-gradient(180deg, #070912 0%, #10111e 56%, #05070d 100%);
  }

  .gate-view {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 12px;
    min-height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  }

  .gate-card {
    width: 100%;
    padding: 0 0 18px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .gate-brand {
    margin-bottom: 18px;
  }

  .compact-logo {
    width: 62px;
    height: 62px;
    border-radius: 16px;
  }

  h1 {
    font-size: clamp(3.2rem, 16vw, 4.9rem);
  }

  .gate-card h1 {
    max-width: 8ch;
  }

  .lead {
    max-width: 26ch;
    font-size: 1rem;
  }

  .gate-form {
    margin-top: clamp(34px, 7vh, 62px);
  }

  .gate-row {
    grid-template-columns: minmax(0, 1fr) 84px;
    min-height: 54px;
  }

  .gate-row input,
  .gate-row button {
    min-height: 54px;
  }

  .gate-row button {
    min-width: 84px;
  }

  .gate-preview {
    order: -1;
    display: block;
    width: 100%;
    height: min(330px, 41svh);
    min-height: 286px;
    margin-top: 2px;
  }

  .gate-preview img,
  .preview-tile {
    position: absolute;
    width: auto;
  }

  .gate-preview img:nth-child(1),
  .preview-tile:nth-child(1) {
    top: 0;
    left: 2%;
    width: 62%;
    aspect-ratio: 4 / 5 !important;
  }

  .gate-preview img:nth-child(2),
  .preview-tile:nth-child(2) {
    top: 38px;
    right: 0;
    width: 54%;
    aspect-ratio: 1 !important;
  }

  .gate-preview img:nth-child(3),
  .preview-tile:nth-child(3) {
    right: 10%;
    bottom: 0;
    display: block;
    width: 72%;
    aspect-ratio: 5 / 3.4 !important;
  }

  .viewer-header {
    top: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    margin: -12px -12px 0;
  }

  .viewer-header h2 {
    font-size: clamp(1.9rem, 10vw, 3.2rem);
  }

  .viewer-shell,
  .admin-workspace {
    padding: 12px;
  }

  .viewer-header,
  .admin-top,
  .panel-head.split {
    align-items: start;
    flex-direction: column;
  }

  .month-tab {
    min-width: 132px;
  }

  .feature-band {
    min-height: 300px;
  }

  .feature-copy {
    right: 16px;
    bottom: 16px;
  }

  .viewer-tools {
    display: grid;
  }

  .segmented,
  .search-field,
  .sort-field,
  .admin-search {
    width: 100%;
  }

  .sort-field select {
    flex: 1;
  }

  .segment {
    flex: 1;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-meta {
    padding: 10px;
  }

  .title {
    white-space: normal;
  }

  .lightbox {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    grid-template-rows: 58px minmax(0, 1fr) 58px;
    padding: 10px;
  }

  .round-button.prev,
  .round-button.next {
    align-self: end;
  }

  .stats-row,
  .visit-stats,
  .visit-row,
  .form-grid,
  .mini-grid,
  .admin-nav,
  .batch-edit-grid {
    grid-template-columns: 1fr;
  }

  .batch-summary,
  .batch-actions {
    align-items: start;
    flex-direction: column;
  }

  .admin-list-row {
    grid-template-columns: 44px 78px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .admin-thumb-frame {
    width: 78px;
  }

  .image-select span {
    display: none;
  }

  .list-fields {
    grid-template-columns: 1fr;
  }

  .row-controls,
  .card-actions {
    justify-content: stretch;
  }

  .card-actions button {
    flex: 1;
  }

  .form-actions {
    display: grid;
  }
}

@media (max-width: 420px) {
  .viewer-page .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .photo-meta {
    gap: 4px;
  }

  .date,
  .tags {
    font-size: 0.72rem;
  }
}

/* App-like viewer experience */
.viewer-page .app-like-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 760px;
  place-items: center;
  overflow: hidden;
  padding: 18px;
}

.viewer-page .viewer-device {
  position: relative;
  width: min(430px, 100%);
  height: min(900px, calc(100dvh - 36px));
  min-height: 740px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 42px;
  background:
    linear-gradient(150deg, rgba(37, 232, 200, 0.16), transparent 35%),
    linear-gradient(32deg, transparent 33%, rgba(255, 209, 102, 0.12), rgba(255, 79, 136, 0.15), transparent 73%),
    #070912;
  box-shadow: 0 34px 110px rgba(0, 0, 0, 0.55);
}

.viewer-page .viewer-device::before,
.viewer-page .viewer-device::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.viewer-page .viewer-device::before {
  inset: -12% -20%;
  z-index: 0;
  background:
    linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.055) 44%, transparent 48%),
    linear-gradient(120deg, transparent 0 68%, rgba(73, 182, 255, 0.055) 70%, transparent 74%);
  animation: appRay 7s linear infinite;
}

.viewer-page .viewer-device::after {
  top: 18px;
  left: 50%;
  z-index: 20;
  width: 118px;
  height: 30px;
  border-radius: 999px;
  background: #05060a;
  transform: translateX(-50%);
}

.viewer-page .mobile-browser-bar {
  display: none;
}

.viewer-page .app-view {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  overflow-y: auto;
  padding: 54px 16px 104px;
  scrollbar-width: none;
}

.viewer-page .app-view::-webkit-scrollbar {
  display: none;
}

.viewer-page .app-view-active {
  display: block;
}

.viewer-page .app-view .viewer-header {
  position: relative;
  top: auto;
  z-index: 1;
  flex-direction: row;
  align-items: center;
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
}

.viewer-page .brand-row {
  display: flex;
  min-width: 0;
  gap: 10px;
  align-items: center;
}

.viewer-page .brand-row img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
}

.viewer-page .brand-row .eyebrow {
  margin: 0;
  font-size: 0.74rem;
}

.viewer-page .brand-row h2 {
  margin-top: 2px;
  overflow: hidden;
  font-size: 1.12rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-page .icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
}

.viewer-page .icon-button .lock-label {
  display: none;
}

.viewer-page .desktop-info-pill {
  display: none;
}

.viewer-page .viewer-tools {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.viewer-page .app-view .feature-band {
  min-height: 270px;
  border-color: var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.36);
}

.viewer-page .app-view .feature-band img,
.viewer-page .app-view .feature-band video {
  height: 270px;
}

.viewer-page .app-view .feature-band::after {
  background: linear-gradient(180deg, transparent 38%, rgba(5, 7, 13, 0.9));
}

.viewer-page .app-view .feature-copy {
  right: 16px;
  bottom: 16px;
  left: 16px;
  gap: 5px;
  max-width: none;
  text-align: left;
}

.viewer-page .app-view .feature-copy strong {
  overflow-wrap: anywhere;
  font-size: 2.1rem;
}

.viewer-page .app-view .month-rail {
  gap: 8px;
  margin: 14px -16px 0;
  padding: 0 16px 2px;
}

.viewer-page .app-view .month-tab {
  min-width: 96px;
  min-height: 50px;
  padding: 8px 10px;
}

.viewer-page .app-view .month-tab span {
  margin-top: 2px;
  font-size: 0.72rem;
}

.viewer-page .app-view .viewer-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin: 14px 0;
  padding: 0;
}

.viewer-page .app-view .segmented {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.viewer-page .app-view .segment {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
}

.viewer-page .app-view .segment.active {
  color: #061013;
  background: linear-gradient(135deg, var(--jade), var(--gold), var(--rose));
}

.viewer-page .app-view .search-field,
.viewer-page .app-view .sort-field {
  width: auto;
  min-height: 42px;
  margin: 0;
  background: rgba(255, 255, 255, 0.06);
}

.viewer-page .app-view .search-field {
  min-width: 0;
}

.viewer-page .app-view .search-field input {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  outline: 0;
}

.viewer-page .app-view .sort-field {
  padding: 0 9px;
}

.viewer-page .app-view .sort-field span {
  display: none;
}

.viewer-page .app-view .sort-field select {
  min-width: 86px;
  color: var(--ink);
}

.viewer-page .app-view .gallery-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.viewer-page .app-view .photo-card {
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: none;
}

.viewer-page .app-view .photo-card:nth-child(3n + 1) {
  grid-row: span 2;
}

.viewer-page .app-view .photo-button img,
.viewer-page .app-view .photo-button video {
  aspect-ratio: 4 / 5;
}

.viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button img,
.viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button video {
  aspect-ratio: 3 / 4.4;
}

.viewer-page .app-view .photo-meta {
  gap: 4px;
  padding: 9px;
}

.viewer-page .app-view .date,
.viewer-page .app-view .tags {
  font-size: 0.72rem;
}

.viewer-page .app-view .title {
  font-size: 0.92rem;
  white-space: nowrap;
}

.viewer-page .viewer-tabs {
  position: absolute;
  right: 16px;
  top: 74px;
  left: 16px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(5, 7, 13, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(22px);
}

.viewer-page .viewer-tabs button {
  display: grid;
  min-width: 0;
  min-height: 38px;
  place-items: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 820;
}

.viewer-page .viewer-tabs button.active {
  color: #061013;
  background: linear-gradient(135deg, var(--jade), var(--gold), var(--rose));
}

.viewer-page .plain-top {
  margin-bottom: 16px;
}

.viewer-page .plain-top span {
  display: block;
  color: var(--jade);
  font-size: 0.74rem;
  font-weight: 860;
  text-transform: uppercase;
}

.viewer-page .plain-top h1 {
  margin: 4px 0 0;
  font-size: 3rem;
  line-height: 1;
}

.viewer-page .month-list {
  display: grid;
  gap: 10px;
}

.viewer-page .month-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: inherit;
  text-align: left;
  background: rgba(255, 255, 255, 0.06);
}

.viewer-page .month-row img,
.viewer-page .month-row video {
  width: 74px;
  aspect-ratio: 1;
  border-radius: var(--radius);
  object-fit: cover;
}

.viewer-page .month-row strong {
  display: block;
  margin-bottom: 5px;
}

.viewer-page .month-row span,
.viewer-page .month-row small {
  color: var(--muted);
}

.viewer-page .profile-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-top: 56px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  text-align: center;
  background: rgba(255, 255, 255, 0.06);
}

.viewer-page .profile-panel img {
  width: 90px;
  border-radius: 24px;
}

.viewer-page .profile-panel p {
  margin: 0;
  color: var(--muted);
}

.viewer-page .ghost-action {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.07);
}

@keyframes appRay {
  from {
    transform: translateX(-12%);
  }

  to {
    transform: translateX(12%);
  }
}

@media (max-width: 520px) {
  .viewer-page .app-like-shell {
    height: 100dvh;
    min-height: 0;
    padding: 0;
  }

  .viewer-page .viewer-device {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    border-radius: 0;
  }

  .viewer-page .viewer-device::after {
    display: none;
  }

  .viewer-page .mobile-browser-bar {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 14;
    display: grid;
    gap: 10px;
    padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
    background:
      linear-gradient(180deg, rgba(7, 9, 18, 0.92), rgba(7, 9, 18, 0.72)),
      linear-gradient(135deg, rgba(37, 232, 200, 0.1), rgba(255, 79, 136, 0.08));
    backdrop-filter: blur(22px);
  }

  .viewer-page .mobile-browser-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
  }

  .viewer-page .mobile-browser-main .brand-row strong {
    display: block;
    font-size: 1.18rem;
    line-height: 1.1;
  }

  .viewer-page .mobile-browser-main .icon-button {
    width: auto;
    min-width: 62px;
    padding: 0 12px;
  }

  .viewer-page .mobile-browser-main .lock-symbol {
    display: none;
  }

  .viewer-page .mobile-browser-main .lock-label {
    display: inline;
  }

  .viewer-page .viewer-tabs {
    position: static;
    right: auto;
    left: auto;
    top: auto;
    min-height: 46px;
    padding: 4px;
    box-shadow: none;
  }

  .viewer-page .app-view {
    padding-top: calc(128px + env(safe-area-inset-top));
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .viewer-page .app-view .viewer-header {
    display: none;
  }
}

/* Polished viewer cards and immersive preview */
.viewer-page .app-view .gallery-grid {
  align-items: start;
  grid-auto-flow: row;
}

.viewer-page .app-view .photo-card,
.viewer-page .app-view .photo-card:nth-child(3n + 1) {
  display: grid;
  grid-row: auto;
  grid-template-rows: auto 72px;
}

.viewer-page .app-view .photo-button {
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.viewer-page .app-view .photo-button img,
.viewer-page .app-view .photo-button video,
.viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button img,
.viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button video {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.viewer-page .app-view .photo-meta {
  align-content: center;
  min-height: 72px;
}

.viewer-page .app-view .photo-meta .date,
.viewer-page .app-view .photo-meta .tags {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-page .lightbox {
  z-index: 90;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  place-items: center;
  gap: 0;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 232, 200, 0.16), transparent 31%),
    radial-gradient(circle at 82% 86%, rgba(255, 79, 136, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(2, 4, 10, 0.92), rgba(4, 6, 13, 0.98));
  backdrop-filter: blur(28px);
}

.viewer-page .lightbox::before {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(118deg, transparent 0 43%, rgba(255, 255, 255, 0.055) 45%, transparent 49%),
    linear-gradient(118deg, transparent 0 62%, rgba(255, 209, 102, 0.05) 64%, transparent 69%);
  opacity: 0.78;
  animation: appRay 8s ease-in-out infinite alternate;
}

.viewer-page .lightbox figure {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  width: min(1120px, 100%);
  height: min(920px, calc(100svh - 44px));
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 16px;
  place-items: center;
}

.viewer-page .lightbox img,
.viewer-page .lightbox video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100svh - 178px);
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  object-fit: contain;
  background: rgba(5, 6, 10, 0.72);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.viewer-page .lightbox figcaption {
  display: grid;
  justify-items: center;
  width: min(560px, 100%);
  gap: 6px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: rgba(8, 10, 18, 0.68);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(22px);
}

.viewer-page .lightbox figcaption strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(1.15rem, 3vw, 1.7rem);
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-page .lightbox figcaption span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-page .round-button {
  position: fixed;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.62);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.viewer-page .round-button.close {
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  grid-column: auto;
}

.viewer-page .round-button.prev,
.viewer-page .round-button.next {
  top: 50%;
  grid-column: auto;
  grid-row: auto;
  align-self: auto;
  justify-self: auto;
  transform: translateY(-50%);
}

.viewer-page .round-button.prev {
  left: max(18px, env(safe-area-inset-left));
}

.viewer-page .round-button.next {
  right: max(18px, env(safe-area-inset-right));
}

@media (max-width: 520px) {
  .viewer-page .lightbox {
    padding: calc(58px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
  }

  .viewer-page .lightbox figure {
    height: 100%;
    gap: 14px;
  }

  .viewer-page .lightbox img {
    width: auto;
    max-width: 100%;
    max-height: calc(100svh - 188px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .viewer-page .lightbox figcaption {
    padding: 13px 16px;
  }

  .viewer-page .round-button.prev,
  .viewer-page .round-button.next {
    top: 50%;
    bottom: auto;
    width: 42px;
    height: 42px;
    transform: translateY(-50%);
  }

  .viewer-page .round-button.prev {
    left: 18px;
  }

  .viewer-page .round-button.next {
    right: 18px;
  }
}

/* Keep desktop viewer in the original wide layout; App chrome is mobile-only. */
@media (min-width: 521px) {
  .viewer-page .app-like-shell {
    display: block;
    width: min(1480px, 100%);
    height: auto;
    min-height: 0;
    margin: 0 auto;
    overflow: visible;
    padding: clamp(14px, 3vw, 30px);
  }

  .viewer-page .viewer-device {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .viewer-page .viewer-device::before,
  .viewer-page .viewer-device::after,
  .viewer-page .mobile-browser-bar,
  .viewer-page .viewer-tabs {
    display: none;
  }

  .viewer-page .app-view {
    position: static;
    display: none;
    overflow: visible;
    padding: 0;
  }

  .viewer-page .app-view[data-view="gallery"] {
    display: block;
  }

  .viewer-page .app-view[data-view="months"],
  .viewer-page .app-view[data-view="profile"] {
    display: none !important;
  }

  .viewer-page .app-view .viewer-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin: 0;
    padding: 16px clamp(16px, 3vw, 28px);
    background: rgba(10, 12, 18, 0.84);
  }

  .viewer-page .brand-row {
    display: flex;
  }

  .viewer-page .brand-row img {
    display: block;
    width: 50px;
    height: 50px;
    border-radius: 14px;
  }

  .viewer-page .brand-row .eyebrow {
    margin: 0;
    color: var(--ink);
    font-size: 1.28rem;
    text-transform: none;
  }

  .viewer-page .brand-row h2 {
    display: none;
  }

  .viewer-page .desktop-info-pill {
    display: flex;
    width: fit-content;
    min-width: 272px;
    margin-left: auto;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 7px 10px 7px 13px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: var(--ink);
    background:
      linear-gradient(135deg, rgba(37, 232, 200, 0.16), transparent 42%),
      linear-gradient(315deg, rgba(255, 79, 136, 0.13), rgba(255, 209, 102, 0.08), transparent 62%),
      rgba(255, 255, 255, 0.075);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 14px 36px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(18px);
  }

  .viewer-page .desktop-clock {
    display: grid;
    min-width: 72px;
    gap: 1px;
  }

  .viewer-page .desktop-clock span,
  .viewer-page .desktop-weather-copy span {
    color: rgba(247, 249, 255, 0.64);
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .viewer-page .desktop-clock strong,
  .viewer-page .desktop-weather-copy strong {
    color: var(--ink);
    font-size: 0.98rem;
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: 0;
  }

  .viewer-page .desktop-weather {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
  }

  .viewer-page .desktop-weather-mark {
    display: grid;
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 14px;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 900;
    background:
      linear-gradient(150deg, rgba(255, 209, 102, 0.9), rgba(255, 79, 136, 0.78) 52%, rgba(73, 182, 255, 0.9)),
      #49b6ff;
    box-shadow: 0 10px 24px rgba(255, 79, 136, 0.22);
  }

  .viewer-page .desktop-weather-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
  }

  .viewer-page .viewer-header .viewer-lock-trigger {
    display: inline-flex;
    width: auto;
    min-width: 78px;
    height: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: var(--radius);
  }

  .viewer-page .viewer-header .lock-symbol {
    display: none;
  }

  .viewer-page .viewer-header .lock-label {
    display: inline;
  }

  .viewer-page .app-view .month-rail {
    gap: 10px;
    margin: 16px 0;
    padding: 0;
  }

  .viewer-page .app-view .month-tab {
    min-width: 144px;
    min-height: 64px;
    padding: 11px 13px;
  }

  .viewer-page .app-view .month-tab span {
    margin-top: 6px;
    font-size: 0.84rem;
  }

  .viewer-page .app-view .feature-band {
    min-height: clamp(300px, 35vw, 430px);
    box-shadow: var(--shadow);
  }

  .viewer-page .app-view .feature-band img,
  .viewer-page .app-view .feature-band video {
    width: 100%;
    height: 100%;
  }

  .viewer-page .app-view .feature-copy {
    right: clamp(18px, 4vw, 44px);
    bottom: clamp(18px, 4vw, 40px);
    left: auto;
    max-width: min(420px, calc(100% - 36px));
    text-align: right;
  }

  .viewer-page .app-view .feature-copy strong {
    font-size: clamp(2rem, 5vw, 4.5rem);
  }

  .viewer-page .app-view .viewer-tools {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin: 16px 0;
    padding: 10px;
  }

  .viewer-page .app-view .segmented {
    display: flex;
    grid-column: auto;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .viewer-page .app-view .segment {
    min-width: 68px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
  }

  .viewer-page .app-view .segment.active {
    border-color: transparent;
    color: #071013;
    background: var(--gold);
  }

  .viewer-page .app-view .search-field {
    width: min(260px, 44vw);
  }

  .viewer-page .app-view .sort-field {
    padding: 0 12px;
  }

  .viewer-page .app-view .sort-field span {
    display: inline;
  }

  .viewer-page .app-view .sort-field select {
    min-width: 0;
  }

  .viewer-page .app-view .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
  }

  .viewer-page .app-view .photo-card,
  .viewer-page .app-view .photo-card:nth-child(3n + 1) {
    display: block;
    grid-row: auto;
    grid-template-rows: none;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  }

  .viewer-page .app-view .photo-button {
    border-radius: 0;
  }

  .viewer-page .app-view .photo-button img,
  .viewer-page .app-view .photo-button video,
  .viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button img,
  .viewer-page .app-view .photo-card:nth-child(3n + 1) .photo-button video {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  .viewer-page .app-view .photo-meta {
    display: grid;
    min-height: 0;
    gap: 6px;
    padding: 12px;
  }

  .viewer-page .app-view .date,
  .viewer-page .app-view .tags {
    font-size: 0.8rem;
  }

  .viewer-page .app-view .title {
    font-size: 1rem;
    white-space: nowrap;
  }

  .viewer-page .lightbox {
    z-index: 30;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) 72px;
    grid-template-rows: 72px minmax(0, 1fr) 72px;
    gap: 12px;
    place-items: stretch;
    padding: 16px;
    background: rgba(3, 5, 10, 0.86);
    backdrop-filter: blur(20px);
  }

  .viewer-page .lightbox::before {
    display: none;
  }

  .viewer-page .lightbox figure {
    position: static;
    z-index: auto;
    grid-column: 2;
    grid-row: 2;
    display: grid;
    width: auto;
    height: auto;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    place-items: stretch;
  }

  .viewer-page .lightbox img,
  .viewer-page .lightbox video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    min-height: 0;
    border-radius: var(--radius);
    object-fit: contain;
    box-shadow: none;
  }

  .viewer-page .lightbox figcaption {
    display: flex;
    width: auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .viewer-page .lightbox figcaption strong {
    font-size: 1rem;
    white-space: normal;
  }

  .viewer-page .round-button {
    position: static;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: none;
    backdrop-filter: none;
  }

  .viewer-page .round-button.close {
    grid-column: 3;
    justify-self: end;
  }

  .viewer-page .round-button.prev {
    grid-row: 2;
    align-self: center;
    justify-self: center;
  }

  .viewer-page .round-button.next {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    justify-self: center;
  }
}

@media (min-width: 521px) and (max-width: 760px) {
  .viewer-page .desktop-info-pill {
    min-width: 0;
    padding: 7px 10px;
  }

  .viewer-page .desktop-weather {
    display: none;
  }
}
