:root {
  --delivery-ink: #20221e;
  --delivery-sage: #4f5d48;
  --delivery-sage-light: #697862;
  --delivery-paper: #f7f4ee;
  --delivery-wash: #ece8e1;
  --delivery-rose: #d9aaa6;
  --delivery-line: rgba(32,34,30,0.16);
  --delivery-serif: "Italiana", Georgia, serif;
  --delivery-sans: "DM Sans", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--delivery-paper);
  color: var(--delivery-ink);
  font-family: var(--delivery-sans);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--delivery-rose);
  outline-offset: 3px;
}
[hidden] { display: none !important; }

.delivery-prototype-badge {
  position: fixed;
  z-index: 80;
  right: 15px;
  bottom: 15px;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 8px 11px;
  background: rgba(32,34,30,0.88);
  color: white;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.delivery-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--delivery-ink);
  padding: 13px 20px;
  background: var(--delivery-ink);
  color: white;
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-decoration: none;
  text-transform: uppercase;
}
.delivery-button.secondary { background: transparent; color: var(--delivery-ink); }
.delivery-button.danger { border-color: #8f4f4b; background: transparent; color: #8f4f4b; }
.delivery-button:disabled { cursor: not-allowed; opacity: 0.45; }

/* Access */
.access-body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  background: var(--delivery-sage);
}
.access-visual {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}
.access-visual img { width: 100%; height: 100%; object-fit: cover; }
.access-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,31,24,0.58), transparent 60%);
}
.access-brand {
  position: absolute;
  z-index: 2;
  top: 38px;
  left: 42px;
  color: white;
  font-family: var(--delivery-serif);
  font-size: 24px;
  text-decoration: none;
}
.access-caption {
  position: absolute;
  z-index: 2;
  right: 45px;
  bottom: 45px;
  left: 45px;
  color: white;
}
.access-caption span, .delivery-kicker {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.access-caption h2 {
  max-width: 600px;
  margin: 12px 0 0;
  font-family: var(--delivery-serif);
  font-size: clamp(38px, 5vw, 70px);
  font-weight: 400;
}
.access-panel {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 9vw;
  background: var(--delivery-paper);
}
.access-panel h1 {
  margin: 18px 0 12px;
  font-family: var(--delivery-serif);
  font-size: clamp(45px, 5vw, 72px);
  font-weight: 400;
}
.access-panel > p { max-width: 480px; color: #696b64; font-size: 14px; }
.pin-form { max-width: 430px; margin-top: 32px; }
.pin-form label {
  display: block;
  margin-bottom: 9px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.pin-row { display: grid; grid-template-columns: 1fr auto; gap: 9px; }
.pin-row input {
  min-width: 0;
  border: 1px solid var(--delivery-line);
  padding: 14px 16px;
  background: white;
  font-size: 19px;
  letter-spacing: 0.35em;
}
.pin-help { margin-top: 10px; color: #777970; font-size: 11px; }
.pin-error { min-height: 20px; margin: 12px 0 0; color: #995a54; font-size: 12px; }
.access-demo {
  max-width: 430px;
  margin-top: 35px;
  border-top: 1px solid var(--delivery-line);
  padding-top: 20px;
  color: #777970;
  font-size: 11px;
}
.access-demo strong { color: var(--delivery-ink); letter-spacing: 0.2em; }
.access-actions { display: flex; gap: 16px; margin-top: 25px; }
.access-link {
  border: 0;
  border-bottom: 1px solid currentColor;
  padding: 0 0 2px;
  background: transparent;
  color: var(--delivery-ink);
  cursor: pointer;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.admin-sidebar-foot .access-link { color: inherit; }

/* Couple gallery */
.gallery-body { min-height: 100vh; overflow-x: hidden; }
.gallery-shell { min-height: 100vh; display: grid; grid-template-columns: 285px 1fr; }
.gallery-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 285px;
  display: flex;
  flex-direction: column;
  background: var(--delivery-sage);
  color: white;
}
.gallery-identity { padding: 45px 28px 34px; }
.gallery-identity > span { color: rgba(255,255,255,0.5); font-size: 7px; letter-spacing: 0.16em; }
.gallery-identity h1 { margin: 17px 0 8px; font-family: var(--delivery-serif); font-size: 31px; font-weight: 400; }
.gallery-identity p { margin: 0; color: rgba(255,255,255,0.62); font-size: 10px; }
.gallery-identity small { display: block; margin-top: 25px; border-top: 1px solid rgba(255,255,255,0.13); padding-top: 14px; color: rgba(255,255,255,0.38); font-size: 7px; letter-spacing: 0.1em; text-transform: uppercase; }
.gallery-tabs { display: grid; }
.gallery-tabs button {
  display: flex;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 22px 28px;
  background: transparent;
  color: rgba(255,255,255,0.62);
  cursor: pointer;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}
.gallery-tabs button.active { background: rgba(255,255,255,0.12); color: white; }
.gallery-tabs strong { font-size: 8px; }
.gallery-retention { margin-top: auto; padding: 28px; }
.gallery-retention span { color: rgba(255,255,255,0.44); font-size: 7px; letter-spacing: 0.13em; text-transform: uppercase; }
.gallery-retention strong { display: block; margin: 9px 0 12px; font-family: var(--delivery-serif); font-size: 28px; font-weight: 400; }
.gallery-retention p { margin: 0; color: rgba(255,255,255,0.55); font-size: 10px; line-height: 1.6; }
.gallery-main { grid-column: 2; min-width: 0; padding: 40px 3vw 90px; }
.gallery-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--delivery-line);
  padding-bottom: 22px;
}
.gallery-top p { margin: 0 0 5px; font-size: 9px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.gallery-top small { color: #777970; font-size: 11px; }
.gallery-panel { display: none; }
.gallery-panel.active { display: block; animation: delivery-in 0.35s ease both; }
@keyframes delivery-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.film-grid { display: grid; grid-template-columns: 1.45fr 0.65fr; grid-template-rows: repeat(2, 280px); gap: 9px; }
.media-card { position: relative; min-width: 0; overflow: hidden; background: #d9d5cd; cursor: pointer; }
.media-card.featured { grid-row: 1 / 3; }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; }
.media-card::after { content: ""; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, rgba(20,20,16,0.72)); pointer-events: none; }
.media-card-copy { position: absolute; z-index: 2; right: 18px; bottom: 17px; left: 18px; color: white; }
.media-card-copy strong { display: block; font-family: var(--delivery-serif); font-size: 20px; font-weight: 400; }
.media-card-copy span { font-size: 7px; letter-spacing: 0.09em; text-transform: uppercase; }
.media-play { position: absolute; z-index: 3; top: 50%; left: 50%; width: 54px; height: 54px; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,0.7); border-radius: 50%; background: rgba(30,30,25,0.18); color: white; cursor: pointer; font-size: 8px; text-transform: uppercase; }
.media-select { position: absolute; z-index: 4; top: 12px; right: 12px; width: 27px; height: 27px; border: 1px solid rgba(255,255,255,0.7); border-radius: 50%; background: rgba(30,30,25,0.25); color: transparent; cursor: pointer; }
.media-select.selected { background: var(--delivery-rose); color: var(--delivery-ink); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-card { position: relative; height: 340px; overflow: hidden; }
.photo-card:nth-child(2), .photo-card:nth-child(5) { height: 430px; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; }
.clip-groups { border-top: 1px solid var(--delivery-line); }
.clip-row { display: grid; grid-template-columns: 45px 1fr auto auto; gap: 20px; align-items: center; border-bottom: 1px solid var(--delivery-line); padding: 25px 5px; }
.clip-row > span { color: var(--delivery-rose); font-size: 10px; }
.clip-row strong { font-family: var(--delivery-serif); font-size: 20px; font-weight: 400; }
.clip-row small { color: #777970; font-size: 10px; }
.gallery-toast {
  position: fixed;
  z-index: 90;
  right: 25px;
  bottom: 25px;
  max-width: 360px;
  padding: 16px 20px;
  background: var(--delivery-ink);
  color: white;
  font-size: 11px;
  transform: translateY(150%);
  transition: transform 0.25s ease;
}
.gallery-toast.show { transform: none; }
.gallery-mobile-brand { display: none; }

/* Staff delivery dashboard */
.delivery-admin-body { min-height: 100vh; background: var(--delivery-wash); }
.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 250px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 24px;
  background: var(--delivery-sage);
  color: white;
}
.admin-brand { color: white; font-family: var(--delivery-serif); font-size: 20px; text-decoration: none; }
.admin-label { margin: 8px 0 35px; color: rgba(255,255,255,0.48); font-size: 7px; letter-spacing: 0.15em; text-transform: uppercase; }
.admin-nav { display: grid; gap: 5px; }
.admin-nav button, .admin-nav a {
  border: 0;
  padding: 13px;
  background: transparent;
  color: rgba(255,255,255,0.62);
  cursor: pointer;
  font-size: 9px;
  letter-spacing: 0.11em;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
}
.admin-nav .active { background: rgba(255,255,255,0.11); color: white; }
.admin-sidebar-foot { margin-top: auto; color: rgba(255,255,255,0.4); font-size: 8px; line-height: 1.6; }
.admin-main { grid-column: 2; min-width: 0; padding: 45px 5vw 90px; }
.admin-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 28px; }
.admin-header h1 { margin: 8px 0 0; font-family: var(--delivery-serif); font-size: clamp(42px, 5vw, 70px); font-weight: 400; }
.admin-notice { margin-bottom: 28px; border: 1px solid var(--delivery-line); padding: 12px 15px; background: rgba(255,255,255,0.4); color: #696b64; font-size: 10px; }
.admin-notice strong { color: var(--delivery-ink); text-transform: uppercase; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 22px; }
.admin-stat { border: 1px solid var(--delivery-line); border-right: 0; padding: 22px; background: var(--delivery-paper); }
.admin-stat:last-child { border-right: 1px solid var(--delivery-line); }
.admin-stat span { color: #777970; font-size: 8px; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-stat strong { display: block; margin: 12px 0 5px; font-family: var(--delivery-serif); font-size: 29px; font-weight: 400; }
.admin-layout { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(330px,0.65fr); gap: 20px; }
.admin-panel { border: 1px solid var(--delivery-line); padding: 27px; background: var(--delivery-paper); }
.admin-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 23px; }
.admin-panel h2 { margin: 5px 0 0; font-family: var(--delivery-serif); font-size: 27px; font-weight: 400; }
.queue-list { display: grid; }
.queue-item {
  display: grid;
  grid-template-columns: minmax(140px,1fr) 85px 110px;
  gap: 15px;
  align-items: center;
  border-top: 1px solid var(--delivery-line);
  padding: 18px 5px;
  cursor: pointer;
}
.queue-item.selected { background: #efebe4; }
.queue-item strong { display: block; font-family: var(--delivery-serif); font-size: 19px; font-weight: 400; }
.queue-item small { color: #777970; font-size: 9px; }
.status-chip { width: fit-content; border: 1px solid var(--delivery-line); padding: 6px 8px; font-size: 7px; letter-spacing: 0.1em; text-transform: uppercase; }
.status-chip.published { background: #dfe7dc; }
.status-chip.processing { background: #eee1cf; }
.progress-track { height: 4px; margin-top: 7px; background: #ddd8d0; }
.progress-track span { display: block; height: 100%; background: var(--delivery-sage); }
.admin-form { display: grid; gap: 16px; }
.admin-form label > span { display: block; margin-bottom: 7px; font-size: 8px; font-weight: 600; letter-spacing: 0.11em; text-transform: uppercase; }
.admin-form input, .admin-form select {
  width: 100%;
  border: 1px solid var(--delivery-line);
  padding: 11px 12px;
  background: white;
  color: var(--delivery-ink);
}
.admin-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.mock-dropzone { border: 1px dashed #999b93; padding: 25px 15px; text-align: center; }
.mock-dropzone strong { display: block; font-family: var(--delivery-serif); font-size: 18px; font-weight: 400; }
.mock-dropzone small { color: #777970; font-size: 9px; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.admin-actions .delivery-button { width: 100%; padding-right: 9px; padding-left: 9px; }
.admin-status { min-height: 18px; margin: 5px 0 0; color: #5d6d56; font-size: 10px; }
.publish-checklist { display: grid; gap: 8px; margin: 5px 0 0; padding: 0; list-style: none; }
.publish-checklist li { display: flex; justify-content: space-between; border-bottom: 1px solid var(--delivery-line); padding: 9px 0; font-size: 10px; }
.publish-checklist span { color: #66755f; }

@media (max-width: 980px) {
  .access-body { grid-template-columns: 0.8fr 1.2fr; }
  .gallery-shell { display: block; }
  .gallery-sidebar {
    position: static;
    width: 100%;
    display: block;
  }
  .gallery-identity { padding: 28px 28px 20px; }
  .gallery-identity small, .gallery-retention { display: none; }
  .gallery-tabs { grid-template-columns: repeat(3, 1fr); overflow-x: auto; }
  .gallery-tabs button { min-width: 180px; border-right: 1px solid rgba(255,255,255,0.13); }
  .gallery-main { padding: 30px 24px 75px; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stat:nth-child(2) { border-right: 1px solid var(--delivery-line); }
  .admin-stat:nth-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 700px) {
  .delivery-prototype-badge { right: 10px; bottom: 10px; }
  .access-body { display: block; }
  .access-visual { min-height: 42vh; }
  .access-brand { top: 25px; left: 24px; }
  .access-caption { right: 24px; bottom: 25px; left: 24px; }
  .access-caption h2 { font-size: 39px; }
  .access-panel { min-height: 58vh; padding: 60px 24px 85px; }
  .pin-row { grid-template-columns: 1fr; }
  .pin-row .delivery-button { width: 100%; }
  .gallery-top { align-items: stretch; flex-direction: column; }
  .gallery-top .delivery-button { width: 100%; }
  .film-grid { display: block; }
  .media-card { height: 65vw; min-height: 310px; margin-bottom: 8px; }
  .media-card.featured { height: 110vw; max-height: 620px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .photo-card, .photo-card:nth-child(2), .photo-card:nth-child(5) { height: 63vw; }
  .clip-row { grid-template-columns: 30px 1fr auto; gap: 10px; }
  .clip-row small:last-child { grid-column: 2 / 4; }
  .admin-shell { display: block; }
  .admin-sidebar { position: static; width: 100%; height: auto; padding: 24px; }
  .admin-label { margin-bottom: 20px; }
  .admin-nav { grid-template-columns: 1fr 1fr; }
  .admin-sidebar-foot { margin-top: 18px; }
  .admin-main { padding: 35px 20px 85px; }
  .admin-header { align-items: stretch; flex-direction: column; }
  .admin-header .delivery-button { width: 100%; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-stat { padding: 17px; }
  .queue-item { grid-template-columns: 1fr auto; }
  .queue-item > div:last-child { grid-column: 1 / 3; }
  .admin-form-row, .admin-actions { grid-template-columns: 1fr; }
}
