:root {
  --ink: #14110f;
  --ink-soft: #3a342e;
  --muted: #7a7168;
  --paper: #f6f1ea;
  --paper-2: #efe8de;
  --surface: rgba(255, 252, 248, 0.92);
  --line: rgba(20, 17, 15, 0.1);
  --accent: #e11d8a;
  --accent-2: #0b5fff;
  --ok: #1f7a4c;
  --danger: #b42318;
  --radius: 18px;
  --nav-h: 72px;
  --nav-gap: 12px;
  --topbar-h: 68px;
  --page-x: 20px;
  --page-gap: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --shadow: 0 18px 40px rgba(20, 17, 15, 0.08);
  --font-display: "Syne", "Arial Black", sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background-color: #f6f1ea;
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: var(--safe-top);
}

/* Градиент на отдельном слое — не перерисовывается при скролле */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(900px 480px at 8% -8%, rgba(225, 29, 138, 0.1), transparent 55%),
    radial-gradient(720px 420px at 100% 0%, rgba(11, 95, 255, 0.08), transparent 50%),
    linear-gradient(180deg, #fbf7f2 0%, #f6f1ea 45%, #ece4d8 100%);
}

body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Убрать синие тап-подсветки (не трогаем touch-action у body — иначе ломается скролл) */
button,
a,
.chip,
.nav-item,
.mp-btn,
.gallery-item,
.price-row,
.upload-zone,
.tab,
label,
.bottom-nav,
.topbar {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

button,
a,
.chip,
.nav-item,
.mp-btn,
.tab,
label {
  touch-action: manipulation;
}

input,
textarea,
select,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
  touch-action: auto;
}

:focus {
  outline: none;
}

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

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

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  padding-top: calc(var(--topbar-h) + 10px);
  /* nav floats above bottom: nav-gap + nav-h + breathing room */
  padding-bottom: calc(var(--nav-gap) + var(--nav-h) + var(--safe-bottom) + 28px);
}

.app.auth-shell {
  padding-bottom: calc(var(--safe-bottom) + 24px);
}

.topbar {
  position: fixed;
  top: var(--safe-top);
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  width: min(440px, 100%);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--page-x);
  min-height: var(--topbar-h);
  background: #fbf7f2;
  border-bottom: 1px solid rgba(20, 17, 15, 0.06);
  backface-visibility: hidden;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #070A12;
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.04em;
  box-shadow: 0 10px 24px rgba(7, 10, 18, 0.28);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand h1 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand p {
  font-size: 0.75rem;
  color: var(--muted);
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
}

.link-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  padding: 0;
  cursor: pointer;
}

.main {
  flex: 1;
  width: 100%;
  padding: 12px var(--page-x) 8px;
  display: flex;
  flex-direction: column;
  gap: var(--page-gap);
}

.main > .panel,
.main > .btn-primary,
.main > .btn-secondary,
.main > .balance-hero,
.main > .gallery,
.main > .hero-block,
.main > .alert {
  flex-shrink: 0;
}

.hero-block {
  padding: 4px 0 2px;
}

.hero-block .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero-block h2 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}

.hero-block p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 32ch;
}

.panel {
  background: #fffcf8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(20, 17, 15, 0.06);
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-head h3 { margin: 0; }

.step-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.upload-zone {
  position: relative;
  border: 1.5px dashed rgba(20, 17, 15, 0.18);
  border-radius: 16px;
  min-height: 180px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.7), rgba(246,241,234,0.4));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.upload-zone.dragover {
  border-color: var(--accent);
  transform: scale(0.99);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  color: var(--ink-soft);
}

.upload-placeholder svg { opacity: 0.55; }
.upload-placeholder span { font-weight: 700; font-size: 0.95rem; }
.upload-placeholder small { color: var(--muted); font-size: 0.78rem; }

.photo-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
}

.btn-upload,
.btn-primary,
.btn-secondary,
.btn-ghost {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 0.95rem;
  transition: opacity 0.15s ease, box-shadow 0.2s ease;
}

.btn-upload,
.btn-primary {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, #ff4db8, #e11d8a 55%, #c21674);
  color: #fff;
  box-shadow: 0 10px 22px rgba(225, 29, 138, 0.24);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  background: var(--ink);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.mp-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mp-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px 12px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.mp-btn.active[data-mp="wb"] {
  border-color: transparent;
  background: linear-gradient(135deg, #ff4db8, #e11d8a);
  color: #fff;
}

.mp-btn.active[data-mp="ozon"] {
  border-color: transparent;
  background: linear-gradient(135deg, #3d7cff, #0b5fff);
  color: #fff;
}

.tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

textarea,
.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  font: inherit;
  color: var(--ink);
  resize: vertical;
}

textarea:focus,
.field input:focus,
.field select:focus {
  outline: 2px solid rgba(225, 29, 138, 0.25);
  border-color: rgba(225, 29, 138, 0.45);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.field span {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 400px) {
  .field-row { grid-template-columns: 1fr; }
}

.stack-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-actions .btn-primary,
.stack-actions .btn-secondary,
.stack-actions .btn-ghost,
.stack-actions a.btn-secondary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-image {
  width: 100%;
  border-radius: 14px;
  display: block;
  margin: 10px 0 12px;
  box-shadow: var(--shadow);
}

.result-meta {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.4;
}

.edit-hint {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 12px;
}

.alert {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.alert-warn {
  background: #fff4e5;
  border: 1px solid #f5d7a1;
  color: #7a4b00;
}

.alert a { font-weight: 700; }

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  bottom: calc(var(--nav-gap) + var(--safe-bottom));
  width: min(400px, calc(100% - (var(--page-x) * 2)));
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 8px;
  background: #14110f;
  color: #fff;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(20, 17, 15, 0.22);
  z-index: 40;
  backface-visibility: hidden;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  border-radius: 14px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.15s ease;
}

.nav-item:active { opacity: 0.75; }

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.nav-item.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(255,77,184,0.35), rgba(225,29,138,0.18));
}

.view.hidden {
  display: none !important;
}


.balance-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 12px;
}

.balance-card {
  background: linear-gradient(145deg, #1a1412, #2a211c);
  color: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.balance-card .label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}

.balance-card .value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.04em;
}

.balance-card .sub {
  margin-top: 8px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.7);
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plan-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(225, 29, 138, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
}

.pricing-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}

.price-row.popular {
  border-color: rgba(225, 29, 138, 0.4);
  box-shadow: 0 0 0 3px rgba(225, 29, 138, 0.08);
}

.price-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1rem;
}

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

.price-row .amount {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 6px;
  text-align: right;
}

.price-row .buy-btn {
  padding: 10px 12px;
  font-size: 0.82rem;
  border-radius: 12px;
  white-space: nowrap;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gallery-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  color: inherit;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.gallery-meta {
  padding: 8px 10px 10px;
}

.gallery-meta strong {
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-meta span {
  font-size: 0.72rem;
  color: var(--muted);
}

.auth-card {
  margin-top: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--paper-2);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.auth-tabs button {
  border: none;
  background: transparent;
  border-radius: 11px;
  padding: 10px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(20,17,15,0.08);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 17, 15, 0.62);
  display: grid;
  place-items: center;
  z-index: 50;
  color: #fff;
  text-align: center;
  padding: 24px;
}

.loading-overlay.hidden,
.hidden { display: none !important; }

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  transform: translate3d(-50%, 0, 0);
  bottom: calc(var(--nav-gap) + var(--nav-h) + var(--safe-bottom) + 20px);
  max-width: min(400px, calc(100% - 24px));
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 60;
  box-shadow: var(--shadow);
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translate3d(-50%, 10px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

.toast.error { background: var(--danger); }

.empty-state {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}

.empty-state a { font-weight: 700; }

.profile-email {
  font-size: 0.95rem;
  font-weight: 700;
  word-break: break-all;
}

.referral-list {
  display: grid;
  gap: 8px;
}

.referral-row {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 0.86rem;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  margin: 4px 0 2px;
}

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

body[data-mp="ozon"] .btn-primary,
body[data-mp="ozon"] .btn-upload {
  background: linear-gradient(135deg, #3d7cff, #0b5fff);
  box-shadow: 0 12px 28px rgba(11, 95, 255, 0.28);
}

body[data-mp="ozon"] .nav-item.active {
  background: linear-gradient(180deg, rgba(61,124,255,0.35), rgba(11,95,255,0.18));
}

/* —— Motion: короткие GPU-friendly переходы, без бесконечных анимаций —— */
.anim {
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s),
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s);
}

.anim.anim-in {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.brand-mark {
  animation: none;
}

.hero-block h2 {
  animation: none;
}

.btn-primary,
.btn-upload,
.btn-secondary,
.btn-ghost {
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-primary::after,
.btn-upload::after {
  content: none;
}

.btn-upload:active,
.btn-primary:active:not(:disabled),
.btn-secondary:active,
.btn-ghost:active {
  opacity: 0.88;
  transform: translate3d(0, 1px, 0);
}

.tap-bounce {
  animation: tapBounce 0.28s ease;
}

@keyframes tapBounce {
  0% { transform: translate3d(0, 0, 0); }
  40% { transform: translate3d(0, 1px, 0) scale(0.98); }
  100% { transform: translate3d(0, 0, 0); }
}

.panel,
.balance-card,
.plan-card {
  transition: none;
}

.upload-zone {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.upload-zone:not(:has(.photo-preview:not(.hidden))) {
  animation: none;
}

.price-row {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.price-row.popular {
  animation: none;
  box-shadow: 0 0 0 3px rgba(225, 29, 138, 0.12);
}

.price-row:active {
  transform: translate3d(0, 1px, 0);
}

.gallery-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gallery-item:active {
  transform: translate3d(0, 1px, 0);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transform: translateZ(0);
}

.mp-btn {
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.15s ease, transform 0.15s ease;
}

.mp-btn:active {
  opacity: 0.88;
  transform: translate3d(0, 1px, 0);
}

@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover:not(:disabled),
  .btn-upload:hover,
  .btn-secondary:hover {
    transform: translate3d(0, -1px, 0);
  }

  .price-row:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: 0 12px 28px rgba(20, 17, 15, 0.08);
  }

  .gallery-item:hover {
    transform: translate3d(0, -2px, 0);
    box-shadow: var(--shadow);
  }

  .brand-mark {
    animation: brandFloat 5s ease-in-out infinite;
  }

  @keyframes brandFloat {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -3px, 0); }
  }
}

.discount-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(31, 122, 76, 0.12);
  color: var(--ok);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: middle;
}

.old-price {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: line-through;
  text-align: right;
  margin-bottom: 2px;
}

.per-card {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
}

.loading-overlay {
  animation: fadeOverlay 0.2s ease;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.result-image {
  animation: resultPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.result-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 4px;
}

.result-thumb {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: var(--muted);
}

.result-thumb img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.result-thumb span {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 4px 2px 6px;
}

.result-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(225, 29, 138, 0.18);
  color: var(--ink);
}

.gallery-item.project-card,
.gallery button.gallery-item {
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.gallery-placeholder {
  width: 100%;
  aspect-ratio: 3/4;
  background: var(--paper-2);
}

.gallery-extra {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--paper) 88%, var(--accent) 4%);
}

.gallery-extra h3 {
  margin: 0;
  font-size: 1.05rem;
}

.gallery-extra-note {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.78;
  line-height: 1.4;
}

.gallery-extra .field select,
.gallery-extra .field textarea {
  width: 100%;
}

.gallery-extra-status {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.75;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 10, 9, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 12px 88px;
  touch-action: pan-y;
}

.lightbox.hidden { display: none !important; }

.lightbox-stage {
  width: min(440px, 100%);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-close {
  position: absolute;
  top: calc(10px + var(--safe-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
}

.lightbox-nav.prev { left: 8px; }
.lightbox-nav.next { right: 8px; }

.lightbox-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(16px + var(--safe-bottom));
  width: min(400px, calc(100% - 24px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #fff;
  font-weight: 700;
}

.lightbox-bar .btn-secondary {
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.88rem;
}

@keyframes resultPop {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .anim { opacity: 1 !important; transform: none !important; }
  .brand-mark { animation: none !important; }
}
