:root {
  color-scheme: light;

  --bg: #f8f3e8;
  --bg-raised: #efe6d3;
  --ink: #33301f;
  --muted: #7c7458;
  --line: #ddd0b0;
  --accent: #4b6b43;
  --accent-warm: #d97b3f;
  --display: system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: Hidden must override component display rules. */
  display: none !important;
}

body {
  margin: 0;
  font-family: var(--display);
  background: var(--bg);
  color: var(--ink);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.site-header .brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
}

.site-header-actions {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.privacy-page {
  margin-inline: auto;
  max-width: 760px;
}

.privacy-page p {
  line-height: 1.6;
}

.privacy-note {
  margin: 1rem 0 0;
}

.app-layout {
  display: flex;
  align-items: flex-start;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 200px;
  flex-shrink: 0;
  padding: 1.5rem 1rem;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  min-height: calc(100vh - 57px);
}

.side-nav a {
  background: none;
  border-left: 3px solid transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.5rem;
}

.privacy-link,
.privacy-note a {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.side-nav a.active {
  background: var(--bg);
  border-left-color: var(--accent);
  color: var(--accent);
}

.side-nav a:hover {
  color: var(--accent);
}

.privacy-link:hover,
.privacy-note a:hover {
  color: var(--accent-warm);
  text-decoration: underline;
}

.privacy-button {
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.side-nav a.active:hover {
  color: var(--accent);
}

.event-nav-context {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem;
}

.site-nav-context {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem;
}

.site-nav-toggle {
  width: 100%;
}

.event-nav-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.event-nav-name {
  font-size: 0.95rem;
  font-weight: 700;
  overflow-wrap: break-word;
}

.event-tab-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.event-tab {
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.4rem 0.5rem;
  text-align: left;
}

.event-tab:hover {
  color: var(--accent);
}

.event-tab.active {
  background: var(--bg);
  border-left-color: var(--accent);
  color: var(--accent);
}

.event-tab-submenu {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-left: 0.75rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--line);
}

.event-tab-subitem {
  background: none;
  border: 0;
  border-left: 3px solid transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  padding: 0.3rem 0.5rem;
  text-align: left;
  text-decoration: none;
}

.event-tab-subitem:hover {
  color: var(--accent);
}

.event-tab-subitem.active {
  background: var(--bg);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.event-tab-subitem.danger:hover {
  color: #a6342a;
}

.event-tab-subitem:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

#logout-button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

#logout-button:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
}

main {
  flex: 1;
  max-width: 960px;
  margin: 0;
  padding: 2rem 1.5rem;
}

.gateway-page {
  display: grid;
  margin: 0;
  max-width: none;
  min-height: 100vh;
  place-items: center;
  padding: 1.5rem;
  width: 100%;
}

.gateway-panel {
  width: min(100%, 560px);
  padding: 2rem;
}

.status-page {
  margin: 0;
  max-width: none;
  min-height: 100vh;
  padding: clamp(2rem, 8vh, 4.5rem) 1.5rem;
  width: 100%;
}

.status-panel {
  margin: 0 auto;
  max-width: 720px;
  padding: 0;
}

.status-nav {
  display: flex;
  gap: 1.25rem;
  margin: 0 0 1.5rem;
}

.status-nav-link {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}

.status-nav-link:hover,
.status-nav-link:focus-visible {
  color: var(--accent);
}

.status-eyebrow {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 0 0 0.75rem;
  text-transform: uppercase;
}

.status-eyebrow::before {
  background: var(--accent-warm);
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 6px;
  margin-right: 8px;
  width: 6px;
}

.gateway-panel form {
  display: grid;
  gap: 0.75rem;
}

.example-button {
  margin-top: 0.75rem;
  width: 100%;
}

.example-modal {
  border: 0;
  border-radius: 14px;
  max-width: min(560px, calc(100vw - 2rem));
  padding: 0;
  width: 100%;
}

.example-modal::backdrop {
  background: rgb(51 48 31 / 45%);
}

.example-modal-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}

.example-modal-panel p {
  line-height: 1.6;
}

.url-example {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: monospace;
  overflow-wrap: break-word;
  padding: 0.75rem;
}

.url-example strong {
  color: var(--accent);
}

.gateway-error {
  color: var(--accent-warm);
  font-weight: 700;
}

.status-value {
  color: var(--accent);
  font-family: var(--serif);
  font-size: 2.25rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.status-list {
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 1rem 0 0;
  padding-left: 1.5rem;
}

.status-empty {
  margin: 1rem 0 0;
}

.checkbox-field {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.checkbox-field input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
  width: auto;
}

.gallery-lightbox,
.gallery-page main {
  max-width: none;
}

.gallery-page main {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline: 2rem;
}

.gallery-page #gallery-photos {
  width: 100%;
}

.gallery-selection-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.gallery-selection-toolbar p {
  margin: 0;
}

.gallery-selection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gallery-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
}

.gallery-photo-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.5rem;
  position: relative;
}

.gallery-photo-button {
  aspect-ratio: 4 / 3;
  background: var(--bg-raised);
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  display: block;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

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

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

.gallery-photo-action {
  align-items: center;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 50%;
  bottom: 0.6rem;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.65rem;
  height: 23px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 0.6rem;
  width: 23px;
  z-index: 1;
}

/* Sit left of the favourite button when favourites are enabled. */
.gallery-photo-download-select:has(~ .gallery-photo-favorite) {
  right: calc(0.95rem + 23px);
}

.gallery-photo-action[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.gallery-photo-action:hover {
  border-color: var(--accent);
}

.gallery-photo-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.gallery-lightbox-toggle {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 40px;
  height: 40px;
  justify-content: center;
  padding: 0;
  width: 40px;
}

.gallery-photo-action:focus-visible,
.gallery-lightbox-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gallery-lightbox-toggle[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.gallery-lightbox-toggle:hover {
  border-color: var(--accent-warm);
}

.gallery-lightbox-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.gallery-lightbox {
  background: transparent;
  border: 0;
  margin: auto;
  max-height: calc(100dvh - 2rem);
  max-width: none;
  overflow: visible;
  padding: 0;
  width: min(94vw, 1200px);
}

.gallery-lightbox::backdrop {
  background: rgb(20 18 15 / 82%);
}

.gallery-lightbox-panel {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-rows: minmax(0, 1fr) auto;
  max-height: calc(100dvh - 2rem);
  overflow: hidden;
  padding: 1rem;
  position: relative;
}

#lightbox-image {
  display: block;
  height: min(78vh, 820px);
  justify-self: center;
  max-height: calc(100dvh - 8rem);
  max-width: 100%;
  object-fit: contain;
  width: auto;
}

.gallery-lightbox-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  min-width: 0;
}

.gallery-lightbox-actions p {
  color: var(--bg);
  margin: 0;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  align-items: center;
  background: var(--bg);
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  height: 40px;
  justify-content: center;
  padding: 0;
  position: absolute;
  width: 40px;
  z-index: 1;
}

.gallery-lightbox-close {
  right: 1rem;
  top: 1rem;
}

.gallery-lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
}

.gallery-lightbox-previous {
  left: 1rem;
}

.gallery-lightbox-next {
  right: 1rem;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-arrow:hover {
  background: var(--accent-warm);
  color: var(--bg);
}

.gallery-lightbox-close:focus-visible,
.gallery-lightbox-arrow:focus-visible {
  outline: 2px solid var(--bg);
  outline-offset: 2px;
}

@media (width <= 600px) {
  .gallery-lightbox {
    max-height: calc(100dvh - 1rem);
    width: calc(100vw - 1rem);
  }

  .gallery-lightbox-panel {
    gap: 0.75rem;
    max-height: calc(100dvh - 1rem);
    padding: 0.5rem;
  }

  #lightbox-image {
    height: min(68vh, 820px);
    max-height: calc(100dvh - 7rem);
  }

  .gallery-lightbox-actions {
    justify-content: center;
  }

  .gallery-lightbox-actions p {
    flex-basis: 100%;
    text-align: center;
  }

  .gallery-lightbox-close {
    right: 0.5rem;
    top: 0.5rem;
  }

  .gallery-lightbox-previous {
    left: 0.5rem;
  }

  .gallery-lightbox-next {
    right: 0.5rem;
  }
}

h1 {
  font-family: var(--serif);
  margin-top: 0;
}

.panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.5rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.gallery-page .toolbar {
  justify-content: flex-start;
  margin-inline: 0;
  max-width: none;
  text-align: left;
  width: 100%;
}

.gallery-meta-bar {
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.5rem;
  align-items: flex-start;
  min-height: calc(100vh - 57px);
  padding: 1.5rem 1rem;
  width: 280px;
}

.gallery-links-section {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  width: 100%;
}

.gallery-meta-bar p,
.gallery-meta-bar button {
  margin: 0;
}

.gallery-meta-bar .privacy-button {
  flex-shrink: 0;
}

.gallery-meta-bar .privacy-button,
.gallery-expiry,
.gallery-retention {
  font-weight: 700;
}

.gallery-meta-bar .expiry-warning {
  color: #a6342a;
}

@media (width <= 700px) {
  .gallery-page .app-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-meta-bar {
    align-items: baseline;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    flex-flow: row wrap;
    gap: 0.25rem 1rem;
    min-height: 0;
    padding: 0.6rem 1rem;
    width: auto;
  }

  .gallery-meta-bar p {
    font-size: 0.8rem;
  }

  .gallery-links-section {
    flex-flow: row wrap;
    gap: 0.25rem 1rem;
    margin-top: 0.25rem;
    padding-top: 0.4rem;
  }

  .gallery-meta-bar .privacy-button {
    font-size: 0.85rem;
  }

  .gallery-page main {
    padding-inline: 1rem;
  }
}

.gallery-expiry-banner {
  background: #f6dedb;
  border: 1px solid #a6342a;
  border-radius: 8px;
  color: #a6342a;
  font-weight: 700;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
}

.gallery-error-state {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  width: 100%;
}

.gallery-error-state p {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0;
}

.button {
  display: inline-block;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.gallery-lightbox-actions .button {
  background: var(--accent);
  color: var(--bg);
  flex: 0 0 auto;
}

.button:hover {
  background: var(--accent);
  color: var(--bg);
}

.button.secondary {
  background: none;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.button.secondary:hover {
  background: var(--accent);
  color: var(--bg);
}

.button.danger {
  background: #a6342a;
  color: #fff;
}

.button.danger:hover,
.button.danger:focus-visible {
  background: #7c211a;
}

.event-nav-remove {
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  color: #a6342a;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 0.75rem;
  padding: 0.75rem 0.5rem 0;
  text-align: left;
}

.event-nav-remove:hover,
.event-nav-remove:focus-visible {
  color: #7c211a;
  text-decoration: underline;
}

.build-status {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  margin: -0.75rem 0 1rem;
}

.button.small {
  font-size: 0.8rem;
  padding: 0.4rem 0.7rem;
}

.form-help {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: -0.25rem 0 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

tr.event-row {
  cursor: pointer;
}

tr.event-row:hover {
  background: var(--bg);
}

.magic-links-table {
  margin-top: 1rem;
}

.magic-links-table td:last-child {
  display: flex;
  gap: 0.5rem;
}

.magic-links-table input[type="text"] {
  width: 100%;
  min-width: 220px;
}

.gallery-magic-links-table td:last-child {
  display: table-cell;
}

.gallery-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.gallery-summary > div {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 0.75rem;
}

.gallery-summary dt {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.gallery-summary dd {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.3rem 0 0;
}

.status-pill {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--muted);
}

.event-nav-context .status-pill {
  align-self: flex-start;
}

.event-heading h1 {
  margin-bottom: 0.15rem;
}

.event-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.event-back-link {
  white-space: nowrap;
}

.event-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.event-status-label {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.event-lock-note {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (width <= 700px) {
  .event-header {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.empty-state {
  color: var(--muted);
  padding: 1.5rem 0;
  text-align: center;
}

#build-status:empty {
  display: none;
}

.loading-indicator {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.9rem;
  gap: 0.6rem;
  justify-content: center;
  padding: 1.5rem 0;
}

.loading-indicator::before {
  animation: loading-spin 0.8s linear infinite;
  border: 2px solid var(--line);
  border-right-color: var(--accent);
  border-radius: 50%;
  content: "";
  height: 1rem;
  width: 1rem;
}

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

@media (prefers-reduced-motion: reduce) {
  .loading-indicator::before {
    animation: none;
  }
}

form.stacked {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  margin-top: 0.3rem;
  font-family: var(--display);
  color: var(--ink);
  background: var(--bg);
}

.gateway-panel input {
  border-radius: 6px;
  font: inherit;
  padding: 0.7rem;
}

.field {
  display: flex;
  flex-direction: column;
}

.details-form-row {
  align-items: end;
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.details-form-row .field {
  flex: 1;
}

.details-form-row > .checkbox-field {
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 0 0 240px;
  margin: 0;
  min-width: 0;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.details-form-row > .checkbox-field input {
  flex-shrink: 0;
  margin: 0;
  width: auto;
}

.checkbox-field label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.photo-details-form .field {
  gap: 0.5rem;
}

.photo-modal-panel > .field + .field {
  margin-top: 0.75rem;
}

.photo-modal-panel .portfolio-consent-field {
  margin: 1rem 0 0;
}

.photo-modal-panel .portfolio-consent-field input {
  margin: 0;
  width: auto;
}

@media (width <= 700px) {
  .details-form-row > .checkbox-field {
    flex-basis: auto;
    width: 100%;
  }

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

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.progress-bar-track {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 10px;
  margin: 1rem 0 0.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  background: var(--accent);
  height: 100%;
  transition: width 0.2s ease;
  width: 0%;
}

.section {
  margin-bottom: 1.75rem;
}

.section h2 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.upload-box {
  border: 2px dashed var(--line);
  border-radius: 14px;
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}

.upload-box.dragover {
  border-color: var(--accent);
  background: var(--bg);
  color: var(--accent);
}

.upload-box ul {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  text-align: left;
  color: var(--ink);
}

.upload-modal {
  background: transparent;
  border: 0;
  max-width: none;
  padding: 0;
}

.upload-modal::backdrop {
  background: rgb(51 48 31 / 55%);
}

.upload-modal-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 600px;
  padding: 1.5rem;
  width: min(92vw, 600px);
}

.operation-modal {
  background: transparent;
  border: 0;
  max-width: none;
  padding: 0;
}

.operation-modal::backdrop {
  background: rgb(51 48 31 / 55%);
}

.operation-modal-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 420px;
  padding: 1.5rem;
  width: min(92vw, 420px);
}

.operation-modal-panel h2 {
  font-family: var(--serif);
  margin-top: 0;
}

.operation-modal-panel p {
  line-height: 1.5;
  margin: 0 0 1.25rem;
}

.privacy-modal {
  background: transparent;
  border: 0;
  border-radius: 14px;
  max-width: min(680px, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.privacy-modal::backdrop {
  background: rgb(51 48 31 / 45%);
}

/* Scroll inside the panel so the scrollbar sits within the rounded card. */
.privacy-modal-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: 1.5rem;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.privacy-modal-panel .toolbar {
  background: var(--bg-raised);
  justify-content: space-between;
  position: sticky;
  top: -1.5rem;
  z-index: 1;
}

.privacy-modal-panel p {
  line-height: 1.6;
}

.upload-modal-panel .toolbar {
  margin-bottom: 0.75rem;
}

.upload-modal-panel h2,
.upload-modal-panel p {
  margin-top: 0;
}

.upload-box #browse-upload-button {
  margin-top: 0.25rem;
}

.photo-modal {
  background: transparent;
  border: 0;
  max-width: none;
  padding: 0;
}

.photo-modal::backdrop {
  background: rgb(51 48 31 / 55%);
}

.photo-modal-panel {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 600px;
  padding: 1.5rem;
  width: min(92vw, 600px);
}

.favorites-modal-panel {
  max-height: 85vh;
  max-width: 900px;
  overflow-y: auto;
  width: min(92vw, 900px);
}

.favorites-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.favorites-grid figure {
  margin: 0;
}

.feedback-text {
  white-space: pre-wrap;
}

.favorites-grid img {
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  cursor: pointer;
  display: block;
  object-fit: cover;
  width: 100%;
}

.favorites-grid figcaption {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
  padding-top: 0.25rem;
}

.photo-modal-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.photo-modal-toolbar h2 {
  margin: 0;
}

.photo-modal-toolbar button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0;
}

.photo-details-form {
  display: grid;
  gap: 1rem;
}

.photo-details-form label {
  display: block;
}

.photo-details-form input[type="text"],
.photo-details-form textarea,
.photo-details-form select {
  width: 100%;
}

.photo-details-form textarea {
  min-height: 80px;
  font-family: var(--display);
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--bg);
}

.photo-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: flex-end;
}

.delete-photo-form {
  display: grid;
}

.delete-confirmation {
  margin-bottom: 1rem;
}

.slider {
  width: 100%;
  margin: 1rem 0 0;
}
