/* ==========================================================================
   Oriamur Photos — dark, quiet chrome so the photographs carry the page.
   ========================================================================== */

:root {
  --bg: #0e1013;
  --bg-alt: #14171c;
  --surface: #191d23;
  --surface-2: #1f242c;
  --border: #2a3038;
  --text: #eef1f5;
  --text-muted: #98a2b0;
  --accent: #4c9aff;
  --accent-strong: #6cb0ff;
  --danger: #e5484d;
  --ok: #3dd68c;
  --radius: 12px;
  --radius-sm: 8px;
  --pad: clamp(1rem, 3vw, 1.75rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Several containers below set an explicit `display`, which would otherwise
   beat the `hidden` attribute and leave them visible. Keep `hidden` winning. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.5rem; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 0.75rem; }
p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }

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

/* ------------------------------------------------------------------ banner */

/*
 * The brand artwork carries the wordmark, so it runs full-bleed above the nav.
 * Using a background image means a missing file shows the gradient rather than a
 * broken-image icon — see docs/photos.md → "Brand banner".
 */
.banner {
  display: block;
  width: 100%;
  height: clamp(130px, 18vw, 260px);
  background-color: #6b4a2f;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 60%, rgba(14, 16, 19, 0.6) 100%),
    url('/images/banner.jpg');
  background-size: cover, cover;
  /*
   * Anchored top-LEFT, which is where the wordmark sits.
   *
   * `cover` crops vertically on wide viewports (fine — the artwork's lower half
   * is already trimmed from the derivative). But on a narrow screen the banner
   * box becomes taller than the artwork's aspect, and cover then crops
   * HORIZONTALLY: centring here ate the first letters of the wordmark on a
   * phone. Anchoring left sacrifices the far right of the scene instead.
   */
  background-position: left top;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}

/*
 * Galleries landing page: the whole scene, nothing cropped.
 *
 * The artwork is 2:1 but the viewport is wider, so `contain` leaves space at the
 * sides. Rather than flat bars — which read as a mistake — the ::before layer
 * fills them with a heavily blurred, darkened copy of the same image, so the
 * artwork appears to sit in its own light. Height is capped so the front door
 * doesn't push the galleries below the fold.
 */
.banner.banner-full {
  position: relative;
  overflow: hidden;
  height: min(52vw, 46dvh, 430px);
  /* Both layers are pseudo-elements — see the note below. */
  background-image: none;
  background-color: var(--bg);
}

/*
 * Two stacked layers, both pseudo-elements. They can't live on the parent's own
 * background: a pseudo-element with a negative z-index still paints ABOVE its
 * parent's background, so a blurred ::before would simply hide a sharp parent
 * background. With no z-index at all, ::after paints over ::before by source
 * order, which is what we want.
 */
.banner.banner-full::before {
  content: '';
  position: absolute;
  /* Over-sized so the blur never reveals a soft edge at the frame. */
  inset: -10%;
  background: url('/images/banner-full.jpg') center / cover no-repeat;
  filter: blur(34px) brightness(0.45) saturate(0.8);
}

.banner.banner-full::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0) 80%, rgba(14, 16, 19, 0.55) 100%),
    url('/images/banner-full.jpg');
  background-size: cover, contain;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}

/* Screen-reader-only text: the wordmark is inside the artwork. */
.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;
}

/* ------------------------------------------------------------------ topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 var(--pad);
  height: 56px;
  background: rgba(14, 16, 19, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); }
.brand .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
}

.topbar nav { display: flex; gap: 0.25rem; }
.topbar nav a {
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 550;
  font-size: 0.94rem;
}
.topbar nav a:hover { color: var(--text); background: var(--surface-2); }
.topbar nav a.on { color: var(--text); background: var(--surface-2); }

.who {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 40vw;
}
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .warn { color: #f0b429; }

main { padding: var(--pad); max-width: 1600px; margin-inline: auto; }

/* --------------------------------------------------------------- page head */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.sub { color: var(--text-muted); font-size: 0.9rem; }
.actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- buttons */

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { background: #262c35; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: transparent; color: #04203f; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-sm { padding: 0.32rem 0.7rem; font-size: 0.85rem; }
.btn-ghost { background: transparent; }
.btn-danger { color: #ffd7d8; border-color: #5b2326; background: #3a1618; }
.btn-danger:hover { background: #4d1c1f; }

.input {
  font: inherit;
  font-size: 0.92rem;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  width: 100%;
}
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
select.input, #album-target {
  font: inherit; font-size: 0.85rem; padding: 0.3rem 0.5rem;
  background: var(--bg-alt); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* ---------------------------------------------------------------- dropzone */

.dropzone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-alt);
  transition: border-color 0.15s, background 0.15s;
  margin-bottom: 1rem;
}
.dropzone.hot {
  border-color: var(--accent);
  background: rgba(76, 154, 255, 0.08);
  color: var(--text);
}
.dropzone .hint { font-size: 0.85rem; margin-top: 0.35rem; }

/* ----------------------------------------------------------------- uploads */

.uploads {
  display: grid;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  max-height: 220px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.up-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
}
.up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.up-state { font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.up-state.done { color: var(--ok); }
.up-state.err { color: var(--danger); }

/* --------------------------------------------------------------- selectbar */

.selectbar {
  position: sticky;
  top: 56px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 0.88rem;
}

/* ---------------------------------------------------- library + sidebar */

.lib {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 820px) {
  .lib { grid-template-columns: 1fr; }
  .sidebar { position: static !important; }
}

.sidebar {
  position: sticky;
  top: 72px;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.side-head h2 { margin: 0; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); }

.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.side-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  border: 1px solid transparent;
  color: var(--text-muted);
}
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.on { background: var(--surface-2); color: var(--text); border-color: var(--border); }
/* Highlighted while photos are dragged over it. */
.side-item.drop { border-color: var(--accent); background: rgba(76, 154, 255, 0.12); color: var(--text); }

.side-item .cover {
  width: 30px; height: 30px; flex: none;
  border-radius: 6px; object-fit: cover;
  background: var(--surface-2);
}
.side-item .ico {
  width: 30px; height: 30px; flex: none;
  border-radius: 6px; display: grid; place-items: center;
  background: var(--surface-2); font-size: 14px;
}
.side-item .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .n { font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.side-hint {
  margin-top: 0.85rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* -------------------------------------------------------------------- grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.3s ease;
  opacity: 0;
}
.tile img.in { opacity: 1; }
.tile:hover img { transform: scale(1.04); }

.tile.sel { outline: 3px solid var(--accent); outline-offset: -3px; }

/* The checkbox is a real click target — clicking it selects, so selection is
   discoverable without knowing about ctrl-click. */
.tile .check {
  position: absolute; top: 6px; left: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(8, 10, 13, 0.55);
  border: 1.5px solid rgba(255, 255, 255, 0.75);
  display: grid; place-items: center;
  font-size: 13px; color: transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.tile:hover .check,
.tile:focus-within .check { opacity: 1; }
.tile .check:hover { background: rgba(76, 154, 255, 0.85); }
.tile.sel .check {
  opacity: 1;
  background: var(--accent);
  border-color: var(--accent);
  color: #04203f;
}
/* In select mode every checkbox is visible, so the whole grid reads as pickable. */
.grid.selecting .tile .check { opacity: 1; }
.grid.selecting .tile { cursor: pointer; }

.tile .rm {
  position: absolute; top: 6px; right: 6px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(8, 10, 13, 0.65);
  color: #fff; font-size: 13px; line-height: 1;
  opacity: 0; transition: opacity 0.15s;
}
.tile:hover .rm { opacity: 1; }
.tile .rm:hover { background: var(--danger); }

/* drag-to-reorder */
.sortable .tile { cursor: grab; }
.tile.dragging { opacity: 0.35; }
.tile.over { outline: 3px dashed var(--accent); outline-offset: -3px; }

.sentinel { height: 40px; }
.empty { color: var(--text-muted); padding: 2rem 0; text-align: center; }

/* ------------------------------------------------------------------- split */

.split {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } }

.albums-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.albums-list li {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
}
.albums-list li:hover { background: var(--surface-2); }
.albums-list li.on { border-color: var(--accent); background: var(--surface-2); }
.albums-list .cover {
  width: 34px; height: 34px; border-radius: 6px; object-fit: cover;
  background: var(--surface-2); flex: none;
}
.albums-list .meta { min-width: 0; }
.albums-list .t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.albums-list .n { color: var(--text-muted); font-size: 0.78rem; }

.album-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  display: grid;
  gap: 0.85rem;
}
.album-detail.placeholder { place-items: center; }
.detail-head { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.title-input { font-size: 1.1rem; font-weight: 600; flex: 1; min-width: 200px; }
.detail-actions { display: flex; gap: 0.4rem; }

/* ----------------------------------------------------------- cover gallery */

.covers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.1rem;
}

/* Used as a <button> in the console and as an <a> on the public index. */
.cover-card {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  color: inherit;
  text-decoration: none;
}

.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.cover-card:hover img { transform: scale(1.04); }
.cover-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* The name sits on a gradient so it stays legible over any photograph. */
.cover-cap {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1.1rem 1rem;
  background: linear-gradient(to top, rgba(6, 8, 10, 0.88) 12%, rgba(6, 8, 10, 0) 100%);
  color: #fff;
  pointer-events: none;
}
.cover-cap .t {
  display: block;
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}
.cover-cap .n {
  display: block;
  font-size: 0.82rem;
  opacity: 0.85;
  margin-top: 0.1rem;
}

/*
 * Publication state, on every cover in the console. Private is the calm default
 * (grey); public is the one that means something is out in the world, so it's
 * the one that catches the eye.
 */
.cover-card .flag {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(6, 8, 10, 0.75);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.cover-card .flag-public {
  color: #c9f5d6;
  border-color: #2c6b43;
  background: rgba(16, 60, 34, 0.85);
}

.cover-card.empty-cover {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
}
.cover-card.empty-cover .ph {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.arrange {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.arrange h2 { margin-bottom: 0.2rem; }
.arrange .display-list { margin-top: 1rem; }

@media (max-width: 560px) {
  .covers { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ display page */

.display-list { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; gap: 0.6rem; }
/* handle · cover · name · layout · public link · published toggle */
.display-row {
  display: grid;
  grid-template-columns: auto 56px 1fr auto auto auto;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.display-row.dragging { opacity: 0.4; }
.display-row.over { border-color: var(--accent); border-style: dashed; }
.handle { cursor: grab; color: var(--text-muted); font-size: 1.1rem; user-select: none; }
.display-row .cover { width: 56px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.display-row .t { font-weight: 600; font-size: 0.95rem; }
.display-row .n { color: var(--text-muted); font-size: 0.8rem; }
.toggle { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: var(--text-muted); }

/* The address to hand out. Empty until the gallery is actually published. */
.pub-link { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.pub-link code {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
  max-width: 22ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  /* Stack rather than squeeze: the link and toggle drop under the name. */
  .display-row { grid-template-columns: auto 56px 1fr; row-gap: 0.55rem; }
  .display-row > select,
  .display-row > .pub-link,
  .display-row > .toggle { grid-column: 2 / -1; }
}

/* --------------------------------------------------- gallery presentation */

/*
 * The three layouts the Arrange controls choose between. These must read as
 * genuinely different or the setting looks broken.
 */
.pv-grid { display: grid; gap: 8px; }
.pv-grid .pv-item {
  padding: 0;
  border: none;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: zoom-in;
  display: block;
}
.pv-grid .pv-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.pv-grid .pv-item:hover img { transform: scale(1.04); }
.pv-grid .pv-item:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Grid — even squares. */
.pv-grid.grid-l { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.pv-grid.grid-l .pv-item { aspect-ratio: 1; }

/* Masonry — columns of mixed heights, spans set per photo from its aspect. */
.pv-grid.masonry-l {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  grid-auto-rows: 10px;
  align-items: stretch;
}
.pv-grid.masonry-l .pv-item { aspect-ratio: auto; height: 100%; }

/* Feature — a large opening photo, the rest smaller beside and below it. */
.pv-grid.feature-l { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.pv-grid.feature-l .pv-item { aspect-ratio: 1; }
.pv-grid.feature-l .pv-item:first-child {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

@media (max-width: 560px) {
  .pv-grid.grid-l,
  .pv-grid.feature-l { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Read-only gallery page header */
.gal-page-head { margin-bottom: 1.5rem; }
.gal-page-head h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0.35rem 0 0.25rem; }
.gal-page-head .back {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
}
.gal-page-head .back:hover { color: var(--accent); }

/* ------------------------------------------------------------------ viewer */

.viewer {
  border: none;
  background: rgba(6, 8, 10, 0.94);
  max-width: 100vw;
  max-height: 100vh;
  width: 100vw;
  height: 100vh;
  padding: 0;
  color: var(--text);
}
.viewer::backdrop { background: rgba(0, 0, 0, 0.8); }
.viewer img {
  max-width: 96vw;
  max-height: 88vh;
  margin: 2vh auto 0;
  object-fit: contain;
}
.viewer .close {
  position: absolute; top: 14px; right: 18px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  font-size: 15px; cursor: pointer; z-index: 2;
}
.viewer footer {
  text-align: center;
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------- share panel */

.share-panel {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.share-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.25rem;
}
.share-head h2 { margin: 0; font-size: 1.05rem; }

.share-new {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.9rem 0;
}
.share-new .input { width: auto; flex: 1 1 180px; }
.share-new select.input { flex: 0 0 auto; }

.share-dl {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }

.share-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 0.85rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.share-row.dead { opacity: 0.55; }

.share-url {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;      /* keep the distinctive tail of the token visible */
  text-align: left;
}
.share-meta {
  grid-column: 1 / -1;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.share-acts { display: flex; gap: 0.35rem; }
.share-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  margin-left: 0.4rem;
}
.share-badge.off { background: #3a1618; color: #ffd7d8; }

/* ------------------------------------------------------------------ footer */

.page-footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 1.25rem var(--pad);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.page-footer p { margin: 0.15rem 0; }
.page-footer .rights { opacity: 0.75; }

/* ------------------------------------------------------------------- toast */

.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 60;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}
.toast.err { border-color: var(--danger); }

/* ---------------------------------------------------------- print enquiries */

.notice {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }

.order-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: start;
  gap: 0.9rem;
  padding: 0.8rem 0.95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
/* An unanswered enquiry should be the thing your eye lands on. */
.order-row.status-new { border-left: 3px solid var(--accent); }
.order-row.status-closed,
.order-row.status-declined { opacity: 0.6; }

.order-thumb {
  width: 72px; height: 72px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}
.order-what { font-weight: 600; }
.order-who { font-size: 0.9rem; margin-top: 0.15rem; }
.order-meta { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.15rem; }
.order-message {
  margin: 0.5rem 0 0;
  padding-left: 0.7rem;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .order-row { grid-template-columns: 56px 1fr; }
  .order-row > select { grid-column: 2; justify-self: start; }
  .order-thumb { width: 56px; height: 56px; }
}

/* ---------------------------------------------------------------- lightbox */

/*
 * Lives here, not in gallery.css, because THREE pages open a lightbox: the
 * public gallery, a share link, and the owner's own gallery view under
 * /manage. Only the first two load gallery.css, so keeping these rules there
 * left the console's lightbox completely unstyled — a white UA dialog with the
 * buttons stacked in a corner.
 */

.lb {
  position: fixed;
  inset: 0;
  border: none;
  padding: 0;
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  background: rgba(6, 8, 10, 0.97);
  color: var(--text);
}
.lb::backdrop { background: rgba(0, 0, 0, 0.9); }

/* `dialog` is display:none when closed, so the flex layout is scoped to [open]. */
.lb[open] {
  display: flex;
  flex-direction: column;
}

/*
 * The photograph fills the frame it's given, rather than rendering at whatever
 * size the file happens to be. Without this a photo is only as large as its
 * stored derivative, so anything that fell back to a thumbnail appeared as a
 * ~420px postage stamp in the middle of a large screen.
 *
 * `min-height: 0` is required: a flex item's default min-height is auto, which
 * would let a tall image push the footer off the bottom of the viewport.
 */
.lb img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  padding: 3dvh 3.5vw 0;
}

.lb-close,
.lb-nav {
  position: absolute;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.lb-close {
  top: 14px; right: 16px;
  width: 42px; height: 42px;
  font-size: 15px;
  z-index: 2;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 46px; height: 46px;
  font-size: 26px;
  line-height: 1;
  z-index: 2;
}
.lb-prev { left: 14px; }
.lb-next { right: 14px; }
.lb-nav:hover, .lb-close:hover { background: var(--surface-2); }

.lb footer {
  flex: none;
  text-align: center;
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
.lb footer a {
  color: var(--accent);
  margin-left: 0.5rem;
}

@media (max-width: 600px) {
  .lb-nav { width: 40px; height: 40px; }
  .lb img { padding: 2dvh 2vw 0; }
}
