:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #10100f;
  --surface-2: #191816;
  --ink: #fffaf2;
  --muted: rgba(255, 250, 242, 0.64);
  --faint: rgba(255, 250, 242, 0.38);
  --paper: #f6efe3;
  --gold: #d7b46a;
  --blush: #ef789d;
  --line: rgba(255, 255, 255, 0.12);
  --danger: #ff7d7d;
  --ok: #9be28d;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.5);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -8%, rgba(215, 180, 106, 0.16), transparent 32rem),
    linear-gradient(180deg, #050505, #090807);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  overflow-x: clip;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 100% 8px;
  mask-image: linear-gradient(180deg, black, transparent 80%);
}

button,
input,
textarea {
  font: inherit;
}

button,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 10px calc(86px + var(--safe-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.98) 78%, rgba(5, 5, 5, 0));
  backdrop-filter: blur(18px);
}

.event-chip,
.mini-profile,
.guest-card,
.list-item,
.photo-tile,
.bottom-nav button,
.bell-button,
.auth-button,
.primary-action,
.secondary-action,
.danger-action,
.close-button {
  border: 0;
  cursor: pointer;
}

.event-chip {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.event-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(215, 180, 106, 0.45);
}

.event-chip strong,
.event-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-chip strong {
  font-weight: 900;
  line-height: 1;
}

.event-chip small {
  margin-top: 2px;
  color: var(--gold);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.12rem;
  font-style: italic;
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.bell-button,
.top-share,
.auth-button,
.round-icon {
  min-height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.bell-button {
  width: 44px;
  min-height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.top-share {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
}

.top-share svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bell-button b {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blush);
  color: white;
  font-size: 0.68rem;
}

.auth-button {
  padding: 0 14px;
  color: var(--ink);
  font-weight: 900;
}

.auth-button.signed-in {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--paper);
  color: #070707;
}

.view {
  display: none;
  animation: rise 180ms ease-out;
}

.view.active {
  display: block;
}

.view-heading {
  margin: 18px 0 12px;
}

.view-heading p,
.kicker,
.qr-kicker {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.view-heading h1,
.sheet-card h2,
.qr-card h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 10vw, 3.6rem);
  line-height: 0.95;
}

.status-line,
.form-note,
.muted {
  color: var(--muted);
  line-height: 1.5;
}

.status-line {
  min-height: 24px;
  margin: 0 0 14px;
  font-size: 0.9rem;
}

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

.load-more-moments {
  display: block;
  width: min(100%, 240px);
  min-height: 44px;
  margin: 18px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #151515;
  color: var(--ink);
  font-size: .82rem;
  font-weight: 800;
}

.load-more-moments[hidden] { display: none; }

.photo-tile {
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #181818;
  position: relative;
}

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

.photo-tile span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 8px 8px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), transparent);
  color: white;
  font-size: clamp(0.68rem, 2.6vw, 0.76rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.photo-tile b {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.45);
  border: 2px solid rgba(255,255,255,0.8);
  background-size: cover;
  background-position: center;
}

.photo-tile b.anonymous-upload {
  display: grid;
  place-items: center;
  border-color: rgba(255,255,255,.2);
  background: rgba(16,16,16,.72);
  color: var(--ink);
}

.photo-tile b.anonymous-upload svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.guest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 10px;
}

.guest-card,
.you-card,
.settings-card,
.pending-card,
.upload-panel,
.list-item {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.guest-card {
  min-height: 190px;
  padding: 14px;
  color: var(--ink);
  text-align: left;
}

.avatar {
  width: 74px;
  height: 74px;
  border-radius: 26px;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
  border: 1px solid rgba(215, 180, 106, 0.32);
}

.avatar.small {
  width: 38px;
  height: 38px;
  border-radius: 14px;
}

.avatar.large {
  width: 106px;
  height: 106px;
  border-radius: 32px;
}

.guest-card strong,
.list-item strong,
.mini-profile strong {
  display: block;
  margin-top: 10px;
  font-weight: 900;
}

.guest-card p,
.list-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.wedding-role { display:inline-flex; align-items:center; width:max-content; margin:7px 0 0; padding:3px 7px; border:1px solid rgba(184,165,138,.42); border-radius:999px; color:#d8c7ae; font-size:.64rem; font-weight:800; letter-spacing:.02em; }
.profile-role { margin-top:8px; }

.search-field,
.form-field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.form-field span {
  color: var(--faint);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: 0;
  background: rgba(255, 255, 255, 0.11);
  color: var(--ink);
  padding: 13px;
}

textarea {
  min-height: 90px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(215, 180, 106, 0.75);
  box-shadow: 0 0 0 4px rgba(215, 180, 106, 0.12);
}

.upload-panel,
.you-card,
.settings-card,
.pending-card {
  padding: 14px;
}

.camera-mode {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  min-width: 0;
  max-width: 100%;
}

.camera-preview {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.56), rgba(0,0,0,0.16)),
    url("assets/profile_image.jpeg") center / cover;
  border: 1px solid var(--line);
  transition: filter 180ms ease, transform 180ms ease;
  max-height: 52dvh;
}

.camera-preview video {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  filter: var(--camera-filter, none);
  transition: filter 160ms ease;
}

.camera-preview.live video {
  display: block;
}

.camera-preview::before,
.camera-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--overlay-opacity, 0);
}

.camera-preview::before {
  background:
    radial-gradient(circle at 50% 45%, transparent 28%, rgba(0,0,0,var(--vignette, 0)) 100%),
    linear-gradient(90deg, var(--leak-a, transparent), transparent 36%, var(--leak-b, transparent));
}

.camera-preview::after {
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.18) 0 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 5px 5px, 100% 7px;
  mix-blend-mode: screen;
}

.camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
}

.camera-empty strong {
  font-size: 1.2rem;
  font-weight: 900;
}

.camera-empty span {
  color: var(--muted);
  font-weight: 800;
}

.camera-date {
  position: absolute;
  left: 16px;
  bottom: 14px;
  color: rgba(255, 140, 47, 0.92);
  font-size: 0.85rem;
  font-weight: 900;
  opacity: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.55);
}

.effect-disposable-camera .camera-date,
.camera-preview.effect-disposable-camera .camera-date {
  opacity: 1;
}

.preset-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  padding: 2px 0 4px;
  width: 100%;
  max-width: 100%;
}

.preset-group {
  align-self: center;
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.preset-pill {
  min-height: 44px;
  scroll-snap-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 13px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  transition: transform 150ms ease, background 150ms ease;
}

.preset-pill.active {
  background: var(--paper);
  color: #070707;
  transform: translateY(-1px);
}

.preset-copy {
  display: grid;
  gap: 3px;
}

.preset-copy strong {
  font-weight: 900;
}

.preset-copy span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.effect-classic {
  --camera-filter: none;
}

.effect-warm-film {
  --camera-filter: sepia(0.18) saturate(1.18) contrast(1.04) brightness(1.04);
  --overlay-opacity: 0.38;
}

.effect-disposable-camera {
  --camera-filter: sepia(0.24) saturate(1.25) contrast(1.14);
  --overlay-opacity: 0.68;
  --vignette: 0.42;
}

.effect-direct-flash {
  --camera-filter: brightness(1.16) contrast(1.24) saturate(0.92);
}

.effect-black-white {
  --camera-filter: grayscale(1) contrast(1.18);
}

.effect-golden-hour {
  --camera-filter: sepia(0.22) saturate(1.26) brightness(1.08);
  --overlay-opacity: 0.44;
  --leak-a: rgba(255, 188, 82, 0.22);
}

.effect-nightlife {
  --camera-filter: contrast(1.26) saturate(1.42) brightness(0.86);
  --overlay-opacity: 0.36;
  --vignette: 0.48;
}

.effect-vintage-digital {
  --camera-filter: contrast(1.18) saturate(1.38) hue-rotate(-8deg);
  --overlay-opacity: 0.3;
}

.effect-motion-trails,
.effect-dragged-shutter {
  --camera-filter: contrast(1.1) saturate(1.14);
  --overlay-opacity: 0.28;
}

.effect-light-leaks {
  --camera-filter: sepia(0.12) saturate(1.2) brightness(1.04);
  --overlay-opacity: 0.66;
  --leak-a: rgba(255, 72, 132, 0.42);
  --leak-b: rgba(255, 198, 88, 0.2);
}

.effect-double-exposure {
  --camera-filter: contrast(1.04) saturate(1.08);
}

img.effect-warm-film {
  filter: sepia(0.18) saturate(1.18) contrast(1.04) brightness(1.04);
}

img.effect-disposable-camera {
  filter: sepia(0.24) saturate(1.25) contrast(1.14);
}

img.effect-direct-flash {
  filter: brightness(1.16) contrast(1.24) saturate(0.92);
}

img.effect-black-white {
  filter: grayscale(1) contrast(1.18);
}

img.effect-golden-hour {
  filter: sepia(0.22) saturate(1.26) brightness(1.08);
}

img.effect-nightlife {
  filter: contrast(1.26) saturate(1.42) brightness(0.86);
}

img.effect-vintage-digital {
  filter: contrast(1.18) saturate(1.38) hue-rotate(-8deg);
}

img.effect-motion-trails,
img.effect-dragged-shutter {
  filter: contrast(1.1) saturate(1.14);
}

img.effect-light-leaks {
  filter: sepia(0.12) saturate(1.2) brightness(1.04);
}

.upload-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-card {
  min-height: 154px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  border-radius: 16px;
  background:
    linear-gradient(0deg, rgba(0,0,0,0.56), rgba(0,0,0,0.18)),
    url("assets/profile_image.jpeg") center / cover;
  color: white;
  cursor: pointer;
}

.upload-card:nth-child(2) {
  background:
    linear-gradient(0deg, rgba(0,0,0,0.62), rgba(0,0,0,0.22)),
    url("assets/profile_image.jpeg") center / cover;
}

.upload-card input {
  position: absolute;
  opacity: 0;
}

.upload-card:focus-within {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.upload-card span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper);
  color: #070707;
  font-weight: 900;
}

.upload-card strong,
.upload-card small {
  display: block;
}

.upload-card small {
  color: rgba(255,255,255,0.76);
}

.preview-strip {
  min-height: 96px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72px;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.preview-strip:empty::before {
  content: "Chosen photos appear here.";
  grid-column: 1;
  min-width: 230px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-strip img {
  width: 72px;
  height: 96px;
  object-fit: cover;
  border-radius: 14px;
}

.selected-preview {
  position: relative;
  width: 72px;
  height: 96px;
}

.selected-preview img { width: 100%; height: 100%; }

.remove-preview {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid #151515;
  border-radius: 50%;
  background: var(--paper);
  color: #171513;
  font-size: 1.1rem;
  line-height: 1;
}

.remove-preview:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

.primary-action,
.secondary-action,
.danger-action {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 900;
}

.primary-action {
  background: var(--paper);
  color: #070707;
}

.secondary-action {
  background: rgba(255,255,255,0.09);
  border: 1px solid var(--line);
  color: var(--ink);
}

.danger-action {
  background: rgba(255, 125, 125, 0.14);
  border: 1px solid rgba(255, 125, 125, 0.38);
  color: #ffdada;
}

.button-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  margin-bottom: 12px;
}

.segmented button {
  border: 0;
  min-height: 44px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segmented button.active {
  background: var(--paper);
  color: #070707;
}

.list-stack {
  display: grid;
  gap: 9px;
}

.list-item {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.list-item strong {
  margin: 0;
}

.list-item time {
  color: var(--faint);
  font-size: 0.76rem;
}

.settings-row {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.settings-row:first-child {
  border-top: 0;
}

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

.switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  position: relative;
}

.switch::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: white;
  transition: transform 160ms ease;
}

.switch.on {
  background: rgba(215, 180, 106, 0.72);
}

.switch.on::before {
  transform: translateX(20px);
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 520px);
  max-width: 100vw;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  padding: 7px 6px calc(7px + var(--safe-bottom));
  background: rgba(10, 10, 10, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.bottom-nav button {
  min-width: 0;
  width: 100%;
  min-height: 52px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.bottom-nav span {
  font-size: 1.02rem;
}

.bottom-nav button.active {
  background: rgba(246, 239, 227, 0.12);
  color: var(--ink);
}

dialog {
  border: 0;
  padding: 0;
}

dialog::backdrop {
  background: rgba(0,0,0,0.76);
  backdrop-filter: blur(10px);
}

.sheet {
  width: min(100% - 20px, 520px);
  max-height: calc(100dvh - 30px);
  background: transparent;
  color: var(--ink);
}

.sheet-card {
  position: relative;
  max-height: calc(100dvh - 30px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px;
  border-radius: 28px;
  background: rgba(17, 16, 15, 0.98);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.close-button {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  line-height: 1;
}

.sheet-card > .close-button + .kicker,
.qr-card > .close-button + .qr-kicker {
  min-height: 44px;
  margin-bottom: 7px;
  padding-inline: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.close-button.dark {
  color: #070707;
  background: rgba(0,0,0,0.08);
}

.selfie-stage {
  margin: 16px 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 28px;
  background: #050505;
  border: 1px solid var(--line);
}

.selfie-stage video,
.selfie-stage img,
.selfie-stage canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.crop-controls {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.crop-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.photo-viewer {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #090909;
}

.photo-detail > .close-button {
  top: 18px;
  right: 18px;
}

.photo-detail { padding-top: 74px; }

.photo-detail .photo-viewer img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
  transition: transform 160ms ease;
}

.photo-detail #detailPhoto {
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.photo-viewer.is-dragging #detailPhoto { transition: none; }

.photo-nav {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(10,10,10,.46);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
}

.photo-nav.previous { left: 10px; }
.photo-nav.next { right: 10px; }
.photo-nav[hidden] { display: none; }
.photo-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.photo-nav:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

.mini-profile {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  margin-top: 10px;
}

.mini-profile strong {
  margin: 0;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 900;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.reaction {
  min-height: 44px;
  min-width: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  font-weight: 900;
}

.reaction.selected {
  background: var(--paper);
  color: #070707;
}

.guest-profile { padding: 20px; text-align: left; }

.guest-profile-header {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 4px 48px 20px 0;
  border-bottom: 1px solid var(--line);
}

.guest-profile .avatar.large { width: 78px; height: 78px; border-radius: 24px; }
.guest-profile .kicker { margin: 0 0 5px; }
.guest-profile h2 { margin: 0; font-size: clamp(2rem, 9vw, 2.7rem); }
.guest-profile-caption { margin: 6px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.guest-profile-section { margin-top: 20px; }

.guest-profile-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.guest-profile-section-heading h3 { margin: 0; color: var(--ink); font-size: .92rem; font-weight: 800; }
.guest-profile-section-heading span { min-width: 24px; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--muted); font-size: .72rem; font-weight: 800; text-align: center; }
.guest-moment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.guest-moment { display: block; min-width: 0; padding: 0; overflow: hidden; border-radius: 14px; background: #0e0e0e; }
.guest-moment img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .2s ease; }
.guest-moment:hover img,.guest-moment:focus-visible img { transform: scale(1.04); }
.guest-moment:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.guest-profile-empty { margin: 0; padding: 18px; border-radius: 14px; background: rgba(255,255,255,.04); color: var(--muted); font-size: .84rem; text-align: center; }

.messages {
  min-height: 280px;
  max-height: 54vh;
  overflow: auto;
  display: grid;
  align-content: end;
  gap: 8px;
  padding: 8px 0;
}

.message {
  width: fit-content;
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.1);
}

.message.mine {
  justify-self: end;
  background: var(--paper);
  color: #070707;
}

.message-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.qr-modal {
  width: min(100% - 28px, 420px);
  background: transparent;
}

.qr-card {
  position: relative;
  max-height: calc(100dvh - 30px);
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  background: var(--paper);
  color: #080808;
  text-align: center;
}

.qr-card img {
  width: 220px;
  height: 220px;
  display: block;
  margin: 14px auto;
  padding: 10px;
  border-radius: 18px;
  background: white;
}

.qr-card input {
  background: white;
  color: #080808;
}

.qr-card .primary-action {
  width: 100%;
  margin-top: 12px;
  background: #080808;
  color: white;
}

.empty-state {
  min-height: 160px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state p {
  margin: 0;
}

.app-toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(94px + var(--safe-bottom));
  width: min(calc(100% - 32px), 460px);
  transform: translateX(-50%);
  padding: 12px 14px;
  border: 1px solid rgba(215, 180, 106, 0.5);
  border-radius: 14px;
  background: rgba(25, 24, 22, 0.98);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

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

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 800px) {
  body {
    background:
      linear-gradient(90deg, #121212 0 calc(50% - 280px), #050505 calc(50% - 280px) calc(50% + 280px), #121212 calc(50% + 280px)),
      #050505;
  }

  .app-shell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

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

  .guest-grid,
  .upload-options {
    grid-template-columns: 1fr;
  }

  .bottom-nav {
    gap: 1px;
    padding-inline: 4px;
  }

  .bottom-nav button {
    font-size: 0.62rem;
    border-radius: 12px;
  }

  .bottom-nav span {
    font-size: 0.95rem;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #qrCard,
  #qrCard * {
    visibility: visible;
  }

  #qrCard {
    position: fixed;
    inset: 24px auto auto 24px;
    width: 360px;
  }
}

/* Minimal redesign */
:root { --bg:#080808; --surface:#111; --surface-2:#181818; --ink:#f7f7f4; --muted:#a5a5a2; --faint:#70706d; --paper:#f7f7f4; --gold:#b8ff70; --blush:#bb9cff; --line:rgba(255,255,255,.11); --shadow:0 22px 60px rgba(0,0,0,.42); }
body { background:#080808; font-family:Manrope,system-ui,sans-serif; letter-spacing:-.02em; }
body::before { display:none; }
.app-shell { width:min(100%,580px); padding:14px 16px calc(104px + var(--safe-bottom)); }
.topbar { padding:6px 0 20px; background:linear-gradient(#080808 70%,transparent); }
.event-chip { gap:9px; }.event-chip img { width:42px;height:42px;border-radius:14px;border-color:var(--line); }.event-chip strong { font-size:.92rem;font-weight:800; }.event-chip small { margin-top:3px;color:var(--muted);font-family:Manrope,system-ui,sans-serif;font-size:.7rem;font-style:normal;font-weight:600; }
.bell-button,.top-share,.auth-button { min-height:40px;background:#151515;border-color:transparent; }.bell-button,.top-share { width:40px;min-height:40px; }.auth-button { padding:0 13px;font-size:.78rem;font-weight:800; }
.auth-button.signed-in { width:40px; min-height:40px; max-width:none; padding:0; display:grid; place-items:center; border-radius:50%; background:var(--paper); color:#111; font-size:.9rem; font-weight:900; text-overflow:clip; }
.view-heading { margin:10px 0 9px; }.view-heading p,.kicker,.qr-kicker { color:var(--gold);font-size:.67rem;letter-spacing:.13em; }.view-heading h1,.sheet-card h2,.qr-card h2 { font-family:"Noto Serif",Georgia,serif;font-size:clamp(2.25rem,11vw,4rem);line-height:1;letter-spacing:-.065em; }.status-line { margin-bottom:18px;color:var(--muted);font-size:.89rem; }
.status-line:empty { display:none; }
.gallery { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }.photo-tile { aspect-ratio:.84;border-radius:18px;background:#151515; }.photo-tile::after { content:"";position:absolute;inset:auto 0 0;height:46%;background:linear-gradient(transparent,rgba(0,0,0,.78));pointer-events:none; }.photo-tile span { z-index:1;padding:38px 11px 11px;font-size:.77rem;font-weight:700;letter-spacing:-.03em; }.photo-tile b { z-index:2;left:10px;top:10px;width:26px;height:26px;border:2px solid rgba(255,255,255,.9); }
.moments-empty { grid-column:1 / -1; min-height:220px; }
.guest-grid { grid-template-columns:repeat(2,minmax(0,1fr));gap:10px; }.guest-card { min-height:164px;padding:13px;border-radius:18px;background:#131313; }.avatar { width:58px;height:58px;border-radius:18px;border-color:transparent; }.guest-card strong { margin-top:12px;font-size:.88rem; }.guest-card p { display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:2;font-size:.76rem; }.search-field { margin-bottom:18px; } input,textarea { border-radius:14px;background:#151515;border-color:transparent; }
.upload-panel { padding:0;background:transparent;border:0; }.upload-drop { min-height:min(47dvh,370px);display:grid;place-content:center;justify-items:center;gap:10px;padding:28px;border:1px dashed rgba(184,255,112,.55);border-radius:28px;background:radial-gradient(circle at 50% 35%,rgba(184,255,112,.1),transparent 44%),#111;color:var(--ink);cursor:pointer;text-align:center; }.upload-drop input { position:absolute;width:1px;height:1px;opacity:0; }.upload-drop:focus-within { outline:3px solid var(--gold);outline-offset:3px; }.upload-plus { width:78px;height:78px;display:grid;place-items:center;border-radius:50%;background:var(--gold);color:#0b0b0b;font-size:3rem;font-weight:400;line-height:1;box-shadow:0 0 0 9px rgba(184,255,112,.1);animation:soft-pop 2.8s ease-in-out infinite; }.upload-drop strong { font-size:1.08rem;font-weight:800; }.upload-drop small { color:var(--muted);font-size:.8rem; }.preview-strip { min-height:0;margin:12px 0;grid-auto-columns:64px; }.preview-strip:empty { display:none; }.preview-strip img { width:64px;height:78px;border-radius:12px; }.form-field { margin:14px 0 10px;font-size:.78rem; }.form-field textarea { min-height:78px; }.primary-action { min-height:52px;width:100%;background:var(--paper);font-size:.88rem; }.secondary-action { min-height:44px;border-color:transparent;background:#1a1a1a; }
.bottom-nav { left:50%;right:auto;bottom:max(10px,var(--safe-bottom));width:min(calc(100% - 24px),430px);transform:translateX(-50%);grid-template-columns:1fr 1fr 1fr;align-items:end;gap:6px;padding:7px 8px;border:1px solid var(--line);border-radius:24px;background:rgba(22,22,22,.94);box-shadow:var(--shadow); }.bottom-nav button { min-height:56px;border-radius:17px;color:#a7a7a4;font-size:.65rem;font-weight:800; }.bottom-nav button span { display:grid;place-items:center;height:22px; }.bottom-nav svg { width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round; }.bottom-nav button.active { background:#2a2a2a;color:var(--ink); }.bottom-nav .upload-nav { position:relative;align-self:stretch;overflow:visible;padding-top:17px; }.bottom-nav .upload-nav span { position:absolute;top:-27px;left:50%;width:58px;height:58px;transform:translateX(-50%) rotate(0);border:5px solid #171717;border-radius:50%;background:var(--blush);color:#170d23;font-size:2.2rem;font-weight:500;line-height:1;box-shadow:0 8px 20px rgba(187,156,255,.25);transition:transform .2s ease; }.bottom-nav .upload-nav:hover span,.bottom-nav .upload-nav:focus-visible span { transform:translateX(-50%) rotate(90deg) scale(1.06); }.bottom-nav .upload-nav.active { background:transparent;color:var(--ink); }.bottom-nav .upload-nav em { font-style:normal; }
.sheet-card { border-radius:26px 26px 20px 20px;background:#151515; }.app-toast { border-radius:999px;background:var(--paper);color:#101010;font-weight:800; }
@keyframes soft-pop { 0%,100% { transform:scale(1);box-shadow:0 0 0 9px rgba(184,255,112,.1); } 50% { transform:scale(1.045);box-shadow:0 0 0 15px rgba(184,255,112,0); } }
@media (min-width:560px) { .gallery { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (prefers-reduced-motion:reduce) { .upload-plus { animation:none; }.bottom-nav .upload-nav span { transition:none; } }
@media (hover:none) {
  button:focus-visible,
  a:focus-visible,
  .upload-drop:focus-within {
    outline:none;
  }
}

/* Refined, low-saturation palette after design review */
:root { --ink:#f2f0ea; --muted:#aaa8a2; --faint:#777570; --paper:#f2f0ea; --gold:#b8a58a; --blush:#c8b8ab; --line:rgba(255,255,255,.10); }
.view-heading p,.kicker,.qr-kicker { color:var(--gold); }
.view-heading h1,.sheet-card h2,.qr-card h2 { font-size:clamp(2.55rem,10vw,3.2rem);line-height:1.05;letter-spacing:-.045em; }
.upload-drop { min-height:min(34dvh,260px);border:1px solid rgba(184,165,138,.38);background:#121212; }
.upload-plus { width:66px;height:66px;background:#d3c4b3;color:#171513;font-size:2.5rem;box-shadow:none;animation:soft-pop 3.4s ease-in-out infinite; }
.bottom-nav .upload-nav span { background:#d3c4b3;color:#171513;box-shadow:0 6px 15px rgba(0,0,0,.28); }
.bottom-nav { overflow:visible; }
@keyframes soft-pop { 0%,100% { transform:scale(1); } 50% { transform:scale(1.045); } }

.preview-strip .selected-preview { width:64px; height:78px; }
.preview-strip .selected-preview img { width:100%; height:100%; border-radius:12px; }
.preview-strip .remove-preview { width:23px; height:23px; }

/* A one-action, mobile-first selfie flow */
.profile-onboarding .sheet-card { padding:22px 18px 18px; text-align:center; }
.profile-onboarding .sheet-card h2 { max-width:310px; margin:0 auto 8px; font-size:clamp(2.15rem,9vw,2.8rem); }
.profile-onboarding .muted { max-width:315px; margin-inline:auto; font-size:.88rem; line-height:1.5; }
.profile-onboarding .selfie-stage { position:relative; aspect-ratio:1; max-width:252px; max-height:none; margin:18px auto 12px; border:0; border-radius:50%; background:#211f1c; box-shadow:inset 0 0 0 7px #151515, 0 0 0 1px rgba(184,165,138,.35); }
.profile-onboarding .selfie-stage::before { content:""; position:absolute; inset:-8px; border:1px dashed rgba(184,165,138,.55); border-radius:50%; animation:gentle-orbit 18s linear infinite; }
.profile-onboarding .selfie-stage img { position:relative; z-index:1; border-radius:50%; }
.profile-onboarding .selfie-stage canvas { position:relative; z-index:1; width:100%; height:100%; border-radius:50%; cursor:grab; touch-action:none; }
.profile-onboarding .selfie-stage canvas.is-dragging { cursor:grabbing; }
.profile-onboarding .selfie-stage img.is-draggable { cursor:ns-resize; touch-action:none; user-select:none; transform-origin:center; will-change:transform; }
.profile-onboarding .selfie-stage img.is-dragging { cursor:grabbing; }
.profile-onboarding .selfie-stage.is-cropping::after { content:"Σύρε πάνω ή κάτω"; position:absolute; z-index:2; bottom:13px; left:50%; transform:translateX(-50%); padding:5px 9px; border-radius:999px; background:rgba(0,0,0,.48); color:#f2f0ea; font-size:.66rem; font-weight:800; pointer-events:none; }
.profile-onboarding .selfie-stage video { width:100%; height:100%; object-fit:cover; }
.profile-onboarding .selfie-stage.is-live { max-width:330px; aspect-ratio:3 / 4; border-radius:24px; background:#090909; box-shadow:0 0 0 1px rgba(184,165,138,.35); }
.profile-onboarding .selfie-stage.is-live::before { display:none; }
.profile-onboarding .selfie-stage.is-live video { border-radius:24px; }
.selfie-guide { position:absolute; z-index:2; inset:0; display:grid; place-items:end center; padding-bottom:18px; overflow:hidden; border-radius:24px; pointer-events:none; color:#f2f0ea; font-size:.76rem; font-weight:800; text-shadow:0 1px 3px rgba(0,0,0,.7); background:radial-gradient(circle 36% at 50% 50%, transparent 0 98%, rgba(0,0,0,.58) 100%); }
.selfie-guide::after { content:""; position:absolute; width:72%; aspect-ratio:1; top:50%; left:50%; transform:translate(-50%,-50%); border:2px solid rgba(242,240,234,.9); border-radius:50%; box-shadow:0 0 0 1px rgba(0,0,0,.28); }
.selfie-guide span { position:relative; z-index:1; padding:7px 11px; border-radius:999px; background:rgba(0,0,0,.42); }
.selfie-empty { display:grid; place-items:center; gap:7px; color:var(--muted); }
.selfie-empty[hidden],.selfie-guide[hidden] { display:none; }
.selfie-empty svg,.selfie-capture svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.selfie-empty svg { width:42px; height:42px; color:var(--gold); }
.selfie-empty strong { color:var(--ink); font-size:.92rem; }
.selfie-spark { position:absolute; top:28px; right:35px; color:var(--gold); font-size:1.35rem; transform:rotate(16deg); }
.selfie-capture { min-height:50px; display:flex; align-items:center; justify-content:center; gap:9px; width:100%; margin:0 auto; padding:0 18px; border-radius:999px; background:var(--paper); color:#171513; font-weight:800; cursor:pointer; }
.selfie-edit { display:inline-flex; align-items:center; justify-content:center; min-height:36px; margin:-3px auto 8px; padding:0 13px; border:0; border-radius:999px; background:#1b1b1b; color:var(--ink); font-size:.76rem; font-weight:800; cursor:pointer; }
.selfie-edit[hidden] { display:none; }
.selfie-zoom-controls { display:flex; align-items:center; justify-content:center; gap:8px; margin:-3px auto 10px; }
.selfie-zoom-controls[hidden] { display:none; }
.selfie-zoom-controls button { width:32px; height:32px; padding:0; border:0; border-radius:50%; background:#1d1d1d; color:var(--ink); font-size:1.1rem; cursor:pointer; }
.selfie-zoom-controls span { min-width:42px; color:var(--muted); font-size:.72rem; font-weight:800; }
.admin-entry { width:100%; margin-top:10px; }
.admin-sheet .search-field { margin:18px 0 12px; }
.admin-row { display:grid; grid-template-columns:36px minmax(0,1fr) auto; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.admin-row:last-child { border-bottom:0; }
.admin-row .avatar { width:36px; height:36px; border-radius:12px; }
.admin-row strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.84rem; }
.admin-row .secondary-action { min-height:36px; padding:0 10px; font-size:.7rem; }
.admin-person { min-width:0; }
.admin-person span { display:block; min-height:12px; margin-top:2px; color:var(--muted); font-size:.64rem; }
.role-select { grid-column:2 / 4; width:100%; min-height:36px; padding:0 9px; border:1px solid var(--line); border-radius:10px; background:#171717; color:var(--ink); font:inherit; font-size:.76rem; }
.admin-toggle { grid-column:3; grid-row:1; }
.selfie-capture:focus-visible { outline:3px solid var(--gold); outline-offset:3px; }
.selfie-library { display:inline-flex; margin:10px auto 0; color:var(--muted); font-size:.76rem; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.selfie-library input { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }
.selfie-flip { position:absolute; z-index:3; top:12px; right:12px; display:grid; place-items:center; width:38px; height:38px; padding:0; border:1px solid rgba(255,255,255,.22); border-radius:50%; color:var(--ink); background:rgba(10,10,10,.38); backdrop-filter:blur(8px); }
.selfie-flip[hidden] { display:none; }
.selfie-flip svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.selfie-flip:focus-visible { outline:2px solid var(--paper); outline-offset:2px; }
.profile-step { min-height:20px; margin:10px 0 14px; color:var(--muted); font-size:.76rem; font-weight:700; }
.profile-onboarding .form-field { margin:0 0 11px; text-align:left; }
.profile-onboarding .form-field input { min-height:48px; }
.profile-onboarding .profile-phrase textarea { min-height:66px; background:#1a1816; border:1px dashed rgba(184,165,138,.45); }
.profile-onboarding .primary-action { min-height:50px; }
.profile-onboarding .primary-action:disabled { opacity:.42; }
@keyframes gentle-orbit { to { transform:rotate(360deg); } }

/* Clear hierarchy: short instructions, one action at a time */
.section-help { margin:-5px 0 18px; color:var(--muted); font-size:.84rem; line-height:1.45; }
.upload-drop strong::first-letter { color:var(--gold); }
.upload-drop small { max-width:250px; line-height:1.45; }
.status-line { max-width:440px; }
