@import url("https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:wght@500;700;800&family=Figtree:wght@400;500;600;700&display=swap");
:root {
  --bg: #f4f3fa;
  --ink: #1c1740;
  --muted: #5b5876;
  --violet: #5a3cf0;
  --peach: #ffd8c2;
  --line: #d8d3ee;
  --lilac: #e4ddff;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    17px/1.6 Figtree,
    system-ui,
    sans-serif;
}
h1,
h2,
h3,
.brand {
  font-family: "Bricolage Grotesque", system-ui, sans-serif;
  line-height: 1.15;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 10px 0 18px;
}
h2 {
  font-size: 1.55rem;
  margin: 0 0 20px;
}
h3 {
  margin: 0 0 12px;
}
p {
  margin: 0 0 16px;
}
a {
  color: var(--violet);
}
.wrap {
  width: min(1120px, calc(100% - 40px));
  margin: auto;
}
.app-nav {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.app-nav > .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}
.brand {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none;
}
.brand span {
  color: var(--violet);
}
main.wrap {
  padding-top: 44px;
  padding-bottom: 64px;
}
.page-head {
  margin-bottom: 32px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  color: var(--violet);
  font-weight: 700;
}
.lead,
.muted {
  color: var(--muted);
}
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
}
.grid {
  display: grid;
  gap: 24px;
}
.grid.two {
  grid-template-columns: 1fr 1fr;
}
.stack {
  display: grid;
  gap: 20px;
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.row.between {
  justify-content: space-between;
}
.field {
  display: grid;
  gap: 7px;
  font-size: 0.95rem;
  font-weight: 600;
}
.field small {
  font-weight: 400;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  border: 1.5px solid var(--line);
  background: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 0;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--violet);
}
button,
a.btn {
  font:
    600 1rem Figtree,
    system-ui,
    sans-serif;
}
.btn {
  border: 2px solid transparent;
  border-radius: 999px;
  background: var(--violet);
  color: white;
  padding: 12px 21px;
  min-height: 46px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover {
  filter: brightness(0.94);
}
.btn.secondary {
  background: var(--lilac);
  color: var(--ink);
}
.btn.danger {
  background: #fce5e5;
  color: #9e2424;
}
.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}
:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 4px;
}
.notice {
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--lilac);
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}
.notice:empty {
  display: none;
}
.notice.error {
  background: #fde5e5;
  color: #842828;
}
.notice.success {
  background: #ddf4e5;
  color: #175330;
}
.badge {
  display: inline-block;
  border-radius: 999px;
  background: var(--lilac);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge.off {
  background: #fde5e5;
  color: #842828;
}
.empty {
  padding: 30px;
  text-align: center;
  color: var(--muted);
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}
.photo-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  padding: 12px;
  background: white;
}
.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
}
.photo-card p {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  margin: 10px 0;
}
.progress {
  height: 9px;
  background: var(--lilac);
  border-radius: 8px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--violet);
}
.event-card {
  overflow-wrap: anywhere;
}
.event-card details {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.event-card summary {
  cursor: pointer;
  font-weight: 700;
}
.event-card form {
  margin-top: 18px;
}
.qr-panel {
  background: var(--peach);
}
#qr {
  width: min(300px, 100%);
  margin: 20px auto;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
}
#qr svg {
  display: block;
  width: 100%;
  height: auto;
}
#guest-link {
  overflow-wrap: anywhere;
  display: block;
  margin-bottom: 20px;
}
.login-card {
  max-width: 520px;
  margin: auto;
}
.footer {
  padding: 28px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.event-stats {
  font-size: 0.9rem;
  color: var(--muted);
}
.photo-card .btn {
  font-size: 0.85rem;
  padding: 8px 12px;
  min-height: 38px;
}
.toolbar {
  margin-bottom: 20px;
}
.upload-zone {
  border: 2px dashed var(--line);
  border-radius: 22px;
  padding: 30px;
  text-align: center;
}
.upload-zone.dragging {
  background: var(--lilac);
  border-color: var(--violet);
}
@media (max-width: 720px) {
  .grid.two {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 22px;
  }
  .wrap {
    width: calc(100% - 28px);
  }
  .app-nav > .wrap {
    flex-wrap: wrap;
    padding: 14px 0;
  }
  .row .btn {
    max-width: 100%;
  }
  main.wrap {
    padding-top: 28px;
  }
  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media print {
  body {
    background: white;
  }
  body > * {
    display: none !important;
  }
  main.wrap {
    display: block !important;
    padding: 0;
    width: 100%;
  }
  main.wrap > * {
    display: none !important;
  }
  #workspace {
    display: block !important;
  }
  #workspace > * {
    display: none !important;
  }
  #qr-panel {
    display: block !important;
    background: white;
    border: 0;
    text-align: center;
  }
  #qr-panel .no-print {
    display: none !important;
  }
  #qr {
    width: 360px;
  }
}

dialog {
  max-width: 90vw;
  max-height: 90vh;
  border: 0;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(28, 23, 64, 0.75);
}
dialog img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}
main.wrap > section + section {
  margin-top: 28px;
}

#content > section + section {
  margin-top: 36px;
}

/* Private administrator overview; guest gallery styles remain independent. */
.admin-page .admin-overview {
  scroll-margin-top: 20px;
}
.admin-page .admin-overview h2 {
  margin-bottom: 7px;
}
.admin-page .admin-overview .toolbar p {
  margin: 0;
  font-size: 0.9rem;
}
.admin-page .overview-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.admin-page .overview-stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-page .overview-stat strong {
  font-family: "Bricolage Grotesque", sans-serif;
  font-size: 1.9rem;
  line-height: 1.2;
}
.admin-page .overview-stat span {
  font-size: 0.85rem;
  color: var(--muted);
}
.admin-page .overview-filters {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.admin-page .overview-filters .field {
  font-size: 0.84rem;
}
.admin-page .overview-filters input,
.admin-page .overview-filters select {
  background: white;
  font-size: 0.9rem;
}
.admin-page #overview-count {
  font-size: 0.85rem;
  margin: 0 0 10px;
}
.admin-page .overview-table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.admin-page .overview-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 900px;
  text-align: left;
  font-size: 0.86rem;
}
.admin-page .overview-table th {
  padding: 15px 14px;
  background: #eee9ff;
  font-size: 0.8rem;
  font-weight: 700;
  vertical-align: bottom;
}
.admin-page .overview-table td {
  padding: 17px 14px;
  border-top: 1px solid #ece8f5;
  vertical-align: middle;
}
.admin-page .overview-table td:first-child {
  min-width: 190px;
  max-width: 260px;
  overflow-wrap: anywhere;
}
.admin-page .overview-table small {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}
.admin-page .overview-table time {
  white-space: nowrap;
  font-size: 0.8rem;
}
.admin-page .overview-table .btn {
  font-size: 0.78rem;
  min-height: 38px;
  padding: 8px 13px;
}
.admin-page .overview-table .badge {
  font-size: 0.7rem;
  line-height: 1.3;
  max-width: 140px;
}
.admin-page .status-active {
  background: #ddf4e5;
  color: #175330;
}
.admin-page .status-soon,
.admin-page .status-grace {
  background: #fff0ce;
  color: #795312;
}
.admin-page .status-due,
.admin-page .status-disabled {
  background: #fbe3e3;
  color: #842828;
}
.admin-page .overview-note {
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  max-width: 850px;
  margin: 13px 0 0;
}
.admin-page .event-card {
  scroll-margin-top: 24px;
}
.admin-page .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;
}
@media (max-width: 720px) {
  .admin-page .overview-stats {
    gap: 8px;
  }
  .admin-page .overview-stat {
    padding: 14px 11px;
  }
  .admin-page .overview-stat strong {
    font-size: 1.5rem;
  }
  .admin-page .overview-stat span {
    font-size: 0.73rem;
  }
  .admin-page .overview-filters {
    grid-template-columns: 1fr 1fr;
  }
  .admin-page .overview-filters label:first-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 420px) {
  .admin-page .overview-filters {
    grid-template-columns: 1fr;
  }
  .admin-page .overview-stat strong {
    font-size: 1.3rem;
  }
}

.admin-page .admin-photo-description {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.admin-page .overview-scroll-hint { display: none; font-size: .78rem; }
@media (max-width: 1000px) { .admin-page .overview-scroll-hint { display: block; } }
.admin-page #workspace > *,
.admin-page .admin-overview .toolbar > *,
.admin-page .overview-table-wrap {
  min-width: 0;
}
.admin-page .overview-table-wrap {
  max-width: 100%;
}
.admin-page .overview-table-wrap {
  position: relative;
}
