:root {
  --cream: #F6F1E8;
  --cream-soft: #FBF8F2;
  --beige: #E8DECF;
  --olive: #7E8464;
  --olive-dark: #62684F;
  --text: #3F3A34;
  --text-soft: #746C62;
  --terracotta: #B97A5B;
  --border: #D9CFBF;
  --shadow: rgba(63, 58, 52, 0.12);
  --font-serif: "Didot", "Bodoni 72", "Bodoni MT", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  background: var(--cream);
  font-family: var(--font-sans);
}

body:not(.admin-body) {
  min-height: 100dvh;
  background: linear-gradient(180deg, var(--cream-soft) 0%, var(--cream) 56%, var(--beige) 100%);
}

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

button {
  color: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

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

main {
  min-height: 100vh;
}

body:not(.admin-body) main {
  min-height: 100dvh;
}

.is-hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.technical-page {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 32px;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.technical-page h1 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.technical-page p {
  width: min(100%, 34rem);
  margin: 16px 0 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.technical-page code {
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(251, 248, 242, 0.8);
  color: var(--olive-dark);
  font-family: Consolas, "Liberation Mono", monospace;
}

.cta-button,
.secondary-button {
  display: inline-grid;
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
  padding: 12px 16px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cta-button {
  border: 1px solid var(--olive);
  color: var(--cream-soft);
  background: var(--olive);
  box-shadow: 0 12px 24px rgba(98, 104, 79, 0.18);
}

.secondary-button {
  border: 1px solid rgba(126, 132, 100, 0.3);
  color: var(--olive-dark);
  background: rgba(251, 248, 242, 0.72);
}

.cta-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.back-button:focus-visible {
  outline: 3px solid rgba(185, 122, 91, 0.32);
  outline-offset: 3px;
}

.cta-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.text-button,
.back-button {
  border: 0;
  color: var(--olive-dark);
  background: transparent;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
}

.back-button {
  justify-self: start;
  width: auto;
  min-height: 36px;
  padding: 0;
  text-align: left;
}

.wedding-access-denied,
.wedding-app,
.gallery-page {
  position: relative;
  overflow: hidden;
  color: var(--text);
  background: linear-gradient(180deg, var(--cream-soft) 0%, var(--cream) 58%, var(--beige) 100%);
  font-family: var(--font-sans);
  isolation: isolate;
}

.wedding-access-denied,
.wedding-app {
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
}

.wedding-access-denied {
  display: grid;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  place-items: center;
}

.access-denied-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 360px);
  text-align: center;
}

.access-denied-content p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.45;
}

.access-denied-note {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.wedding-branch {
  position: absolute;
  z-index: 0;
  width: 144px;
  height: 188px;
  pointer-events: none;
  opacity: 0.5;
}

.wedding-branch::before {
  position: absolute;
  inset: 10px 48px 10px 48px;
  border-left: 1px solid rgba(126, 132, 100, 0.42);
  border-radius: 50%;
  content: "";
  transform: rotate(-16deg);
}

.wedding-branch::after {
  position: absolute;
  top: 34px;
  left: 54px;
  width: 28px;
  height: 12px;
  border-radius: 100% 0;
  background: rgba(126, 132, 100, 0.24);
  box-shadow:
    -18px 36px 0 rgba(126, 132, 100, 0.2),
    20px 70px 0 rgba(126, 132, 100, 0.18),
    -14px 106px 0 rgba(185, 122, 91, 0.16);
  content: "";
  transform: rotate(-24deg);
}

.wedding-branch-top {
  top: -56px;
  right: -40px;
  transform: rotate(12deg);
}

.wedding-branch-bottom {
  bottom: -72px;
  left: -44px;
  transform: rotate(190deg);
}

.wedding-app {
  display: block;
}

.app-screen {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.app-screen[hidden] {
  display: none;
}

.app-screen.is-active {
  opacity: 1;
  transform: translateY(0);
}

.app-screen[data-screen="success"],
.app-screen[data-screen="partialError"] {
  grid-template-rows: minmax(0, 1fr) auto;
}

.app-screen[data-screen="select"] .app-screen__content {
  padding-block: 16px;
}

.app-screen[data-screen="select"] .app-screen__actions {
  padding-top: 8px;
}

.app-screen__header,
.app-screen__content,
.app-screen__actions {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  margin-inline: auto;
}

.app-screen__header {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 4px;
  text-align: center;
}

.compact-header {
  gap: 4px;
  text-align: left;
}

.app-screen__content {
  min-height: 0;
  overflow-y: auto;
  padding-block: 24px;
  scrollbar-width: thin;
}

.app-screen__content-center {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.app-screen__actions {
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

.app-screen__actions-muted p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
}

.wedding-home {
  grid-template-rows: minmax(0, 1fr) auto;
}

.wedding-home__hero {
  align-content: center;
  overflow: hidden;
  padding-block: 24px 20px;
}

.wedding-home .wedding-home__date {
  width: min(100%, 320px);
  margin: 0 auto 10px;
  color: rgba(98, 104, 79, 0.78);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.wedding-home .wedding-home__brand {
  width: 100%;
  max-width: 390px;
  color: var(--olive);
  font-size: 2.62rem;
  line-height: 1.04;
  white-space: nowrap;
}

.wedding-home .wedding-home__brand span {
  margin-inline: 0.04em;
  color: var(--terracotta);
  font-size: 1.16em;
  transform: translateY(0.015em);
}

.wedding-home__ornament {
  position: relative;
  width: 132px;
  height: 20px;
  margin: 18px auto 20px;
  opacity: 0.58;
}

.wedding-home__ornament::before {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(126, 132, 100, 0.48), transparent);
  content: "";
}

.wedding-home__ornament::after {
  position: absolute;
  top: 4px;
  left: 50%;
  width: 20px;
  height: 9px;
  border-radius: 100% 0;
  background: rgba(126, 132, 100, 0.24);
  box-shadow:
    -17px 3px 0 rgba(185, 122, 91, 0.16),
    17px 3px 0 rgba(126, 132, 100, 0.18);
  content: "";
  transform: translateX(-50%) rotate(-18deg);
}

.wedding-home .wedding-home__intro {
  width: min(100%, 360px);
  margin: 0 auto;
  color: var(--text);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.13;
}

.wedding-home .wedding-home__copy {
  width: min(100%, 340px);
  margin: 14px auto 0;
  color: var(--text-soft);
  font-size: 1.16rem;
  line-height: 1.35;
}

.wedding-home .wedding-home__actions {
  padding-top: 0;
}

.wedding-home .wedding-home__privacy {
  width: min(100%, 340px);
  margin: 0 auto 4px;
  color: var(--text-soft);
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: center;
}

.brand-title {
  width: min(100%, 340px);
  margin: 0 auto;
  color: var(--olive);
  font-family: var(--font-serif);
  font-size: 3.15rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 0.92;
  text-wrap: balance;
}

.brand-title span {
  display: inline-block;
  margin-inline: 0.03em;
  color: var(--terracotta);
  font-family: "Bodoni 72", "Bodoni MT", "Times New Roman", serif;
  font-size: 1.08em;
  font-style: italic;
  letter-spacing: 0;
  transform: translateY(0.02em);
}

.wedding-date {
  margin: 0;
  color: var(--olive-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.compact-header h2 {
  margin: 0;
  color: var(--olive);
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.compact-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.42;
}

.compact-header strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
}

.app-status-block {
  align-content: center;
  gap: 8px;
  padding-block: 32px 24px;
}

.app-status-block h2 {
  width: min(100%, 340px);
  margin: 8px auto 0;
  color: var(--olive);
  font-family: var(--font-serif);
  font-size: 2.35rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.02;
  text-wrap: balance;
}

.status-symbol {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  margin-inline: auto;
  border-radius: 50%;
  place-items: center;
}

.status-symbol-success {
  border: 1px solid rgba(126, 132, 100, 0.34);
  background: rgba(126, 132, 100, 0.1);
}

.status-symbol-success::after {
  width: 13px;
  height: 24px;
  border-right: 2px solid var(--olive);
  border-bottom: 2px solid var(--olive);
  content: "";
  transform: rotate(42deg) translate(-2px, -2px);
}

.status-symbol-warning {
  border: 1px solid rgba(185, 122, 91, 0.34);
  background: rgba(185, 122, 91, 0.1);
  color: var(--terracotta);
  font-size: 1.35rem;
  font-weight: 700;
}

.status-symbol-warning::after {
  content: "!";
}

.app-lead {
  width: min(100%, 336px);
  margin: 0;
  color: var(--text);
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.28;
}

.app-copy,
.app-privacy-note,
.app-screen__content-center > p {
  width: min(100%, 348px);
  margin: 12px auto 0;
  color: var(--text-soft);
  font-size: 1rem;
  line-height: 1.48;
}

.app-status-block > p {
  margin-top: 4px;
}

.app-screen__content-center > p:first-child {
  margin-top: 0;
}

.app-privacy-note {
  margin-top: 16px;
  color: var(--olive-dark);
  font-size: 0.92rem;
}

.selection-summary {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 700;
}

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

.selection-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

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

.selection-tile {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(251, 248, 242, 0.72);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
  place-items: center;
}

.selection-grid-single .selection-tile {
  aspect-ratio: 4 / 3;
  max-height: 228px;
}

.selection-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selection-tile small {
  position: absolute;
  inset-inline: 4px;
  bottom: 4px;
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--cream-soft);
  background: rgba(63, 58, 52, 0.72);
  font-size: 0.62rem;
  line-height: 1.25;
  text-align: center;
}

.selection-tile-error {
  border-color: rgba(185, 122, 91, 0.72);
}

.selection-tile-more {
  color: var(--olive-dark);
  background: rgba(126, 132, 100, 0.1);
  font-size: 1.05rem;
}

.app-visibility {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  border: 0;
  padding: 0;
}

.app-visibility legend {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.app-visibility-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(251, 248, 242, 0.62);
  cursor: pointer;
}

.app-visibility-option:has(input:checked) {
  border-color: var(--olive);
  background: rgba(126, 132, 100, 0.1);
}

.app-visibility-option input {
  position: relative;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  appearance: none;
  border: 1px solid var(--olive);
  border-radius: 50%;
  background: var(--cream-soft);
}

.app-visibility-option input:checked::after {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--olive);
  content: "";
}

.app-visibility-option strong,
.app-visibility-option small {
  display: block;
}

.app-visibility-option strong {
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.25;
}

.app-visibility-option small,
.visibility-hint {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.38;
}

.visibility-hint {
  margin: 2px 0 0;
  font-size: 0.76rem;
}

.botanical-spinner {
  position: relative;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(126, 132, 100, 0.3);
  border-radius: 50%;
  animation: app-spin 1.8s linear infinite;
}

.botanical-spinner::before,
.botanical-spinner::after {
  position: absolute;
  width: 24px;
  height: 10px;
  border-radius: 100% 0;
  background: rgba(126, 132, 100, 0.28);
  content: "";
}

.botanical-spinner::before {
  top: 18px;
  left: 13px;
  transform: rotate(-24deg);
}

.botanical-spinner::after {
  right: 14px;
  bottom: 18px;
  transform: rotate(32deg);
}

.upload-percent {
  display: block;
  margin-top: 16px;
  color: var(--olive-dark);
  font-size: 4.25rem;
  line-height: 0.95;
}

.upload-count {
  color: var(--text);
  font-weight: 700;
}

.upload-note {
  color: var(--text-soft);
}

.app-progress-track {
  width: min(100%, 288px);
  height: 8px;
  margin-top: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(126, 132, 100, 0.16);
}

.app-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--olive);
  transition: width 160ms ease;
}

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

.app-gallery-photo {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 132, 100, 0.18);
  border-radius: 14px;
  background: rgba(251, 248, 242, 0.72);
  place-items: center;
}

.app-gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-gallery-photo-unavailable {
  padding: 12px;
}

.app-gallery-fallback,
.app-gallery-empty,
.app-gallery-status {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.38;
  text-align: center;
}

.app-gallery-empty {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(251, 248, 242, 0.64);
}

.app-gallery-empty h3,
.app-gallery-empty p {
  margin: 0;
}

.app-gallery-empty h3 {
  color: var(--olive-dark);
  font-size: 1.05rem;
}

.app-gallery-empty p {
  margin-top: 8px;
}

.app-gallery-status {
  margin: 12px auto 0;
  border: 1px solid rgba(217, 207, 191, 0.8);
  border-radius: 14px;
  padding: 12px;
  background: rgba(251, 248, 242, 0.72);
}

.app-toast {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 20;
  width: min(calc(100% - 32px), 384px);
  margin-inline: auto;
  border: 1px solid var(--border);
  border-left: 4px solid var(--terracotta);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(251, 248, 242, 0.96);
  box-shadow: 0 12px 24px rgba(63, 58, 52, 0.14);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.gallery-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(32px + env(safe-area-inset-bottom));
}

.gallery-header {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  margin: 0 auto 24px;
  text-align: center;
}

.gallery-header h1 {
  margin: 0;
  color: var(--olive);
  font-family: var(--font-serif);
  font-size: 2.75rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}

.gallery-header strong,
.gallery-header span {
  display: block;
  margin-top: 8px;
}

.gallery-header strong {
  color: var(--text);
  font-size: 1rem;
}

.gallery-header span {
  color: var(--text-soft);
  font-size: 0.94rem;
  line-height: 1.45;
}

.gallery-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, 1088px);
  margin: 0 auto;
}

.gallery-photo {
  display: grid;
  aspect-ratio: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(126, 132, 100, 0.18);
  border-radius: 14px;
  background: rgba(251, 248, 242, 0.72);
  place-items: center;
}

.gallery-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-photo-unavailable {
  padding: 12px;
}

.gallery-photo-fallback {
  color: var(--text-soft);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

.gallery-empty {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  margin: 16px auto 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  background: rgba(251, 248, 242, 0.72);
  text-align: center;
}

.gallery-empty h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 1.12rem;
  line-height: 1.25;
}

.gallery-empty p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.gallery-empty .secondary-button {
  margin-top: 12px;
}

.gallery-status {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  margin: 16px auto 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(251, 248, 242, 0.72);
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.gallery-more-row {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(100%, 1088px);
  margin: 16px auto 0;
}

.gallery-more-button {
  width: min(100%, 288px);
}

body.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding:
    calc(56px + env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  align-items: center;
  justify-items: center;
  background: rgba(20, 18, 16, 0.84);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox__image {
  max-width: 95vw;
  max-height: 90dvh;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.gallery-lightbox__close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display: grid;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(251, 248, 242, 0.28);
  border-radius: 999px;
  padding: 0;
  place-items: center;
  color: var(--cream-soft);
  background: rgba(63, 58, 52, 0.56);
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
}

.admin-body {
  min-height: 100vh;
  background: var(--cream);
  color: var(--text);
  font-family: var(--font-sans);
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border-bottom: 1px solid rgba(111, 123, 91, 0.18);
  padding: 14px 16px;
  background: rgba(251, 248, 242, 0.96);
}

.admin-brand {
  color: var(--olive-dark);
  font-weight: 800;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-nav a,
.admin-logout-form button,
.admin-filter-bar button,
.admin-pagination a,
.admin-pagination span,
.admin-back-link a {
  display: inline-grid;
  min-height: 36px;
  border: 1px solid rgba(85, 96, 70, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  align-items: center;
  color: var(--olive-dark);
  background: rgba(251, 248, 242, 0.72);
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.admin-logout-form {
  margin: 0;
}

.admin-logout-form button,
.admin-filter-bar button {
  cursor: pointer;
}

.admin-main {
  width: min(100%, 76rem);
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.admin-page-header {
  margin-bottom: 16px;
}

.admin-eyebrow {
  margin: 0 0 8px;
  color: var(--terracotta);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.admin-page-header h1,
.admin-login-form h1 {
  margin: 0;
  color: var(--olive-dark);
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.05;
}

.admin-page-header p {
  margin: 8px 0 0;
  max-width: 44rem;
  color: rgba(63, 58, 52, 0.72);
  line-height: 1.5;
}

.admin-login-shell {
  display: grid;
  min-height: calc(100vh - 5rem);
  align-items: center;
  justify-items: center;
  padding: 32px 0;
}

.admin-login-form {
  display: grid;
  gap: 12px;
  width: min(100%, 24rem);
  border: 1px solid rgba(111, 123, 91, 0.18);
  border-radius: 8px;
  padding: 20px;
  background: rgba(251, 248, 242, 0.78);
}

.admin-login-form label,
.admin-filter-bar label {
  color: var(--olive-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.admin-login-form input,
.admin-filter-bar select {
  min-height: 42px;
  width: 100%;
  border: 1px solid rgba(85, 96, 70, 0.22);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(251, 248, 242, 0.92);
}

.admin-login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--cream-soft);
  background: var(--olive-dark);
  cursor: pointer;
  font-weight: 800;
}

.admin-form-error {
  margin: 0;
  border-radius: 8px;
  padding: 12px;
  background: rgba(185, 122, 91, 0.14);
  color: var(--text);
  font-weight: 800;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-stat,
.admin-empty,
.admin-table-wrap,
.admin-detail-list,
.admin-detail-image {
  border: 1px solid rgba(111, 123, 91, 0.18);
  border-radius: 8px;
  background: rgba(251, 248, 242, 0.72);
}

.admin-stat {
  padding: 16px;
}

.admin-stat span {
  display: block;
  color: rgba(63, 58, 52, 0.68);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--olive-dark);
  font-size: 1.65rem;
  line-height: 1;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 0 0 16px;
  border: 1px solid rgba(111, 123, 91, 0.14);
  border-radius: 8px;
  padding: 14px;
  background: rgba(251, 248, 242, 0.56);
}

.admin-media-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.admin-media-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  min-width: 0;
  border: 1px solid rgba(111, 123, 91, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(251, 248, 242, 0.72);
}

.admin-media-preview,
.admin-detail-image {
  display: grid;
  overflow: hidden;
  place-items: center;
}

.admin-media-preview {
  aspect-ratio: 1;
  border-radius: 8px;
  background: rgba(232, 222, 207, 0.72);
  text-decoration: none;
}

.admin-media-preview img,
.admin-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-media-meta {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 4px;
}

.admin-media-meta strong,
.admin-media-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-media-meta strong {
  color: var(--olive-dark);
  font-size: 1rem;
}

.admin-media-meta span {
  color: rgba(63, 58, 52, 0.72);
  font-size: 0.82rem;
}

.admin-image-fallback {
  padding: 12px;
  color: rgba(63, 58, 52, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

.admin-detail-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.admin-detail-image {
  min-height: 18rem;
  margin: 0;
  background: rgba(232, 222, 207, 0.72);
}

.admin-detail-image img {
  object-fit: contain;
}

.admin-detail-list {
  display: grid;
  gap: 0;
  margin: 0;
  overflow: hidden;
}

.admin-detail-list div {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid rgba(111, 123, 91, 0.12);
  padding: 14px;
}

.admin-detail-list div:last-child {
  border-bottom: 0;
}

.admin-detail-list dt {
  color: rgba(63, 58, 52, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 800;
}

.admin-empty {
  padding: 16px;
  text-align: center;
}

.admin-empty h2 {
  margin: 0;
  color: var(--olive-dark);
  font-size: 1.15rem;
}

.admin-empty p {
  margin: 8px 0 0;
  color: rgba(63, 58, 52, 0.72);
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 38rem;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(111, 123, 91, 0.14);
  padding: 12px;
  text-align: left;
}

.admin-table th {
  color: var(--olive-dark);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.admin-table td {
  color: rgba(63, 58, 52, 0.78);
  font-size: 0.9rem;
}

.admin-table a {
  color: var(--olive-dark);
  font-weight: 800;
}

.admin-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
}

.admin-pagination span {
  opacity: 0.56;
}

.admin-pagination strong {
  color: rgba(63, 58, 52, 0.72);
  font-size: 0.9rem;
}

.admin-back-link {
  margin: 16px 0 0;
}

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

@media (max-width: 360px) {
  .app-screen {
    padding-inline: 12px;
  }

  .brand-title {
    width: min(100%, 300px);
    font-size: 2.85rem;
  }

  .compact-header h2 {
    font-size: 2rem;
  }

  .app-status-block h2 {
    font-size: 2.05rem;
  }

  .wedding-home .wedding-home__date {
    margin-bottom: 8px;
    font-size: 0.66rem;
  }

  .wedding-home .wedding-home__brand {
    font-size: 2.28rem;
  }

  .wedding-home__ornament {
    margin-block: 14px 16px;
  }

  .wedding-home .wedding-home__intro {
    font-size: 1.66rem;
  }

  .wedding-home .wedding-home__copy {
    margin-top: 12px;
    font-size: 1.04rem;
  }

  .wedding-home .wedding-home__privacy {
    font-size: 0.78rem;
  }

  .selection-grid {
    gap: 6px;
  }
}

@media (max-height: 640px) {
  .app-screen {
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .app-screen__header {
    gap: 4px;
  }

  .app-screen__content {
    padding-block: 16px;
  }

  .app-screen__actions {
    gap: 8px;
    padding-top: 8px;
  }

  .wedding-home__hero {
    padding-block: 12px 14px;
  }

  .wedding-home .wedding-home__date {
    margin-bottom: 6px;
    font-size: 0.64rem;
  }

  .wedding-home .wedding-home__brand {
    font-size: 2.24rem;
  }

  .wedding-home__ornament {
    height: 16px;
    margin-block: 12px 14px;
  }

  .wedding-home .wedding-home__intro {
    font-size: 1.58rem;
  }

  .wedding-home .wedding-home__copy {
    margin-top: 10px;
    font-size: 1rem;
    line-height: 1.3;
  }

  .wedding-home .wedding-home__privacy {
    margin-bottom: 2px;
    font-size: 0.76rem;
  }

  .brand-title {
    font-size: 2.7rem;
  }

  .compact-header h2 {
    font-size: 2rem;
  }

  .app-status-block {
    padding-block: 20px 16px;
  }

  .app-status-block h2 {
    font-size: 2.05rem;
  }

  .app-lead {
    font-size: 1.15rem;
  }

  .cta-button,
  .secondary-button {
    min-height: 52px;
  }

  .upload-percent {
    font-size: 3.35rem;
  }

  .botanical-spinner {
    width: 56px;
    height: 56px;
  }
}

@media (min-width: 48rem) {
  body:not(.admin-body) main {
    display: grid;
    padding: 24px;
    align-items: center;
    justify-items: center;
  }

  .wedding-app,
  .wedding-access-denied {
    width: min(100%, 460px);
    height: min(760px, calc(100dvh - 48px));
    min-height: 0;
    border: 1px solid rgba(217, 207, 191, 0.8);
    border-radius: 8px;
    box-shadow: 0 20px 44px rgba(63, 58, 52, 0.1);
  }

  .gallery-page {
    width: 100%;
    min-height: calc(100dvh - 48px);
    border-radius: 8px;
    padding: 40px 24px 48px;
  }

  .brand-title {
    width: min(100%, 380px);
    font-size: 3.65rem;
  }

  .wedding-home__hero {
    padding-block: 32px 24px;
  }

  .wedding-home .wedding-home__brand {
    max-width: 420px;
    font-size: 3rem;
  }

  .wedding-home__ornament {
    margin-block: 20px 22px;
  }

  .wedding-home .wedding-home__intro {
    font-size: 2.02rem;
  }

  .wedding-home .wedding-home__copy {
    font-size: 1.18rem;
  }

  .compact-header h2 {
    font-size: 2.6rem;
  }

  .app-status-block h2 {
    font-size: 2.6rem;
  }

  .gallery-header h1 {
    font-size: 3.4rem;
  }

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

  .admin-topbar {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  .admin-nav {
    justify-content: center;
  }

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

  .admin-stat-wide {
    grid-column: span 2;
  }

  .admin-filter-bar {
    grid-template-columns: auto minmax(14rem, 20rem) auto;
    align-items: end;
  }

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

  .admin-detail-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(18rem, 0.6fr);
    align-items: start;
  }
}

@media (min-width: 72rem) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-media-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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