/* Fotomixx
   Two surfaces: the light table (library, folders, admin), cool and quiet so
   the photos carry the colour; and the album page, black card stock with
   white-bordered prints and handwritten captions. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900; font-display: swap;
}
@font-face {
  font-family: "Young Serif";
  src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: "Patrick Hand";
  src: url("fonts/patrick-hand-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}

:root {
  --table: #e8ebed;
  --surface: #ffffff;
  --ink: #182026;
  --ink-2: #56626c;
  --line: #cbd2d7;
  --cloth: #1f5a4a;
  --cloth-deep: #174538;
  --foil: #e2c987;
  --page: #1f1e1c;
  --page-ink: #efeadf;
  --page-ink-2: #a9a498;
  --print: #fbfaf5;
  --danger: #a8322d;
  --row-h: 190px;
  --side-w: 216px;
  --tabs-h: 0px;
  --ui: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --hand: "Patrick Hand", "Segoe Print", "Bradley Hand", cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--table); color: var(--ink);
  font: 400 15px/1.45 var(--ui);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cloth); outline-offset: 2px; }
.on-dark :focus-visible, .lb :focus-visible { outline-color: var(--foil); }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 600; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--cloth); border-color: var(--cloth); color: #fff; }
.btn.primary:hover { background: var(--cloth-deep); border-color: var(--cloth-deep); }
.btn.danger { color: var(--danger); }
.btn.quiet { background: transparent; border-color: transparent; }
.btn.quiet:hover { background: rgba(24, 32, 38, .07); }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.on-dark .btn { background: transparent; border-color: #55524c; color: var(--page-ink); }
.on-dark .btn:hover { border-color: var(--page-ink-2); }
.on-dark .btn.primary { background: var(--page-ink); border-color: var(--page-ink); color: var(--page); }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; color: inherit; flex: none;
}
.icon-btn:hover { background: rgba(127, 127, 127, .2); }

.field { display: grid; gap: 6px; margin-bottom: 14px; align-content: start; }
.field > span, .label { font-weight: 600; font-size: 14px; }
.field small, .hint { color: var(--ink-2); font-size: 13px; font-weight: 400; }
.input, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--surface); font-size: 16px;
}
textarea.input { min-height: 84px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--cloth); flex: none; }

/* --------------------------------------------------------------- shell */
.shell { min-height: 100vh; min-height: 100dvh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); padding: 22px 12px 14px;
  display: flex; flex-direction: column; gap: 2px; background: var(--surface);
  border-right: 1px solid var(--line); z-index: 20;
}
.brand { font: 400 24px/1 var(--display); padding: 0 12px 20px; color: var(--cloth); text-decoration: none; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; font-weight: 550; color: var(--ink-2); border: 0; background: none;
  cursor: pointer; text-align: left; width: 100%;
}
.nav-link:hover { background: var(--table); color: var(--ink); }
.nav-link.active { background: var(--cloth); color: #fff; }
.side .spacer { flex: 1; }
.side .who { font-size: 14px; }
.main { margin-left: var(--side-w); min-height: 100vh; min-height: 100dvh; padding-bottom: 96px; }
.main.on-dark {
  background-color: var(--page); color: var(--page-ink);
  background-image: radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1.2px);
  background-size: 5px 5px;
}

.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; padding: 14px 28px; background: rgba(232, 235, 237, .93);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bar h1 { font: 400 26px/1.15 var(--display); margin-right: auto; }
.bar .count { color: var(--ink-2); font: 400 14px var(--ui); margin-left: 10px; white-space: nowrap; }
.bar .tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { position: relative; }
.search .icon { position: absolute; left: 11px; top: 10px; color: var(--ink-2); pointer-events: none; }
.search input { padding-left: 38px; width: 240px; }
.bar select.input { width: auto; }
.view { padding: 4px 28px 0; }

.notice {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 28px 12px;
  padding: 10px 14px; border-radius: 8px; background: var(--cloth); color: #fff; font-weight: 550;
}
.notice .btn { background: transparent; border-color: rgba(255, 255, 255, .5); color: #fff; margin-left: auto; }

.empty { max-width: 46ch; margin: 12vh auto; text-align: center; color: var(--ink-2); }
.empty h2 { font: 400 22px/1.2 var(--display); color: var(--ink); margin-bottom: 8px; }
.on-dark .empty { color: var(--page-ink-2); }
.on-dark .empty h2 { color: var(--page-ink); }
.empty .actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ---------------------------------------------------------- photo grid */
.month { font: 400 19px/1.2 var(--display); margin: 26px 0 10px; }
.month:first-child { margin-top: 8px; }
.grid { display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-start; }
.grid::after { content: ""; flex-grow: 1000000; }
.cell-wrap { flex-grow: calc(var(--ar) * 100); flex-basis: calc(var(--ar) * var(--row-h)); min-width: 0; }
.cell {
  position: relative; display: block; width: 100%; aspect-ratio: var(--ar); overflow: hidden;
  background: #d3d9dd; cursor: pointer; border: 0; padding: 0;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .12s; }
.cell .unreadable { position: absolute; inset: 0; display: grid; place-content: center; gap: 2px; padding: 8px;
  text-align: center; font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.cell .unreadable small { display: block; }
.tick {
  position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(0, 0, 0, .28); color: transparent; display: grid;
  place-items: center; opacity: 0; cursor: pointer; padding: 0;
}
.tick .icon { width: 16px; height: 16px; stroke-width: 2.6; }
@media (hover: hover) { .cell:hover .tick { opacity: 1; } }
.selecting .tick { opacity: 1; }
.cell.selected { background: var(--cloth); }
.cell.selected img { transform: scale(.86); }
.cell.selected .tick { opacity: 1; background: var(--cloth); color: #fff; }
.badge-fav { position: absolute; top: 7px; right: 7px; color: #fff; display: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
.badge-fav .icon { width: 18px; height: 18px; fill: #e4526a; stroke: #fff; stroke-width: 1.4; }
.cell.fav .badge-fav { display: block; }
.badge-video {
  position: absolute; left: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px; padding: 2px 8px 2px 5px;
  border-radius: 99px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 12px; font-weight: 600;
}
.badge-video .icon { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.badge-lock {
  position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 24px;
  height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff;
}
.badge-lock .icon { width: 13px; height: 13px; }
.sentinel { height: 1px; }
.loading-line { text-align: center; color: var(--ink-2); padding: 24px; }

/* Album page: prints mounted on black card */
.prints { gap: 30px 26px; padding: 6px 4px 0; --row-h: 220px; }
.prints .cell-wrap { transform: rotate(calc(var(--tilt) * 1deg)); }
.prints .cell {
  border: 7px solid var(--print); background: var(--print);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .6), 0 10px 22px rgba(0, 0, 0, .35);
}
.prints .cell.selected { border-color: var(--foil); background: var(--foil); }
.prints .cell.selected img { transform: none; }
.print-caption {
  font: 400 19px/1.25 var(--hand); color: var(--page-ink); text-align: center;
  padding: 9px 4px 0; overflow-wrap: anywhere;
}

/* ------------------------------------------------------------- explore */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; margin-bottom: 8px; }
.tiles.clipped > .tile:nth-child(n + 13) { display: none; }
.tile { text-decoration: none; min-width: 0; }
.tile-img { aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #d3d9dd; display: grid; place-items: center; color: var(--ink-2); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-img .icon { width: 30px; height: 30px; }
.tile:hover .tile-img { outline: 2px solid var(--cloth); outline-offset: 2px; }
.tile-name { font-weight: 600; margin-top: 8px; line-height: 1.25; overflow-wrap: anywhere; }
.tile-n { color: var(--ink-2); font-size: 13px; }
.section { font: 400 21px/1.2 var(--display); margin: 34px 0 14px; }
.section.first { margin-top: 6px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 20px 12px; }
.people.clipped > .person:nth-child(n + 13) { display: none; }
.people + .btn { margin-top: 12px; }
.person { text-decoration: none; text-align: center; min-width: 0; }
.person img { width: 100%; max-width: 124px; aspect-ratio: 1; border-radius: 50%; object-fit: cover; background: #d3d9dd; display: block; margin: 0 auto; }
.person:hover img { outline: 2px solid var(--cloth); outline-offset: 3px; }
.person.unnamed .tile-name { color: var(--ink-2); font-weight: 500; }
.person-head .person-face { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.lb-info .face-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px 3px 3px; }
.lb-info .face-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.tiles + .btn { margin-top: 12px; }

/* ------------------------------------------------------------- folders */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-right: auto; min-width: 0; }
.crumbs a { text-decoration: none; padding: 4px 6px; border-radius: 6px; color: var(--ink-2); font-weight: 550; }
.crumbs a:hover { background: rgba(24, 32, 38, .07); color: var(--ink); }
.crumbs .here { font: 400 24px/1.15 var(--display); padding: 0 6px; overflow-wrap: anywhere; }
.crumbs .sep { color: var(--line); }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 26px; }
.folder {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; min-width: 0;
}
.folder:hover { border-color: var(--ink-2); }
.folder .thumb { width: 54px; height: 54px; border-radius: 6px; background: var(--table); flex: none;
  object-fit: cover; display: grid; place-items: center; color: var(--ink-2); }
.folder .name { font-weight: 600; line-height: 1.25; overflow: hidden; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.folder .n { color: var(--ink-2); font-size: 13px; }
.folder > div { min-width: 0; }

/* -------------------------------------------------------- album shelf */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 30px 26px; padding-top: 10px; }
.book {
  --cloth-c: #1f5a4a;
  position: relative; display: flex; flex-direction: column; aspect-ratio: 4 / 5;
  padding: 11% 11% 8% calc(11% + 14px); border-radius: 3px 9px 9px 3px; text-decoration: none;
  color: var(--foil); background-color: var(--cloth-c);
  /* woven bookcloth */
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .07) 0 1px, transparent 1px 3px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .25), 0 12px 22px -8px rgba(24, 32, 38, .5),
    inset -1px 0 0 rgba(255, 255, 255, .12);
  border: 0; cursor: pointer; text-align: left; transition: transform .15s;
}
.book::before { /* spine and hinge */
  content: ""; position: absolute; inset: 0 auto 0 0; width: 15px; border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .12) 60%, rgba(0, 0, 0, .3) 61%,
    rgba(255, 255, 255, .1) 78%, transparent);
}
@media (hover: hover) { .book:hover { transform: translateY(-4px); } }
.book .window {
  aspect-ratio: 4 / 3; width: 100%; background: rgba(0, 0, 0, .26); overflow: hidden; border-radius: 1px;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .13);
  border: 5px solid var(--print); display: grid; place-items: center;
}
.book .window img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book .window.blank { border-style: dashed; border-width: 2px; border-color: rgba(226, 201, 135, .5); background: transparent; box-shadow: none; }
.book .title {
  font: 400 clamp(17px, 1.5vw + 10px, 21px)/1.15 var(--display); margin-top: auto; padding-top: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35); overflow-wrap: anywhere;
}
.book .sub { font-size: 13px; opacity: .78; margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.book .sub .icon { width: 13px; height: 13px; }
.book.c1 { --cloth-c: #6b2130; } .book.c2 { --cloth-c: #22324f; }
.book.c3 { --cloth-c: #4a2b4f; } .book.c4 { --cloth-c: #3c4850; }
.book.new {
  background: transparent; box-shadow: none; border: 2px dashed var(--line); color: var(--ink-2);
  align-items: center; justify-content: center; gap: 10px; font-weight: 600; padding: 12px;
}
.book.new::before { display: none; }
.book.new:hover { border-color: var(--cloth); color: var(--cloth); }

.album-head { padding: 26px 28px 20px; max-width: 980px; }
.album-head .back { display: inline-flex; gap: 6px; align-items: center; color: var(--page-ink-2); text-decoration: none; font-weight: 550; margin-bottom: 18px; }
.album-head .back:hover { color: var(--page-ink); }
.album-head h1 { font: 400 clamp(30px, 4.5vw, 50px)/1.05 var(--display); overflow-wrap: anywhere; }
.album-head .desc { font: 400 21px/1.35 var(--hand); color: var(--page-ink); max-width: 62ch; margin-top: 12px; white-space: pre-wrap; }
.album-head .facts { color: var(--page-ink-2); margin-top: 10px; font-size: 14px; }
.album-head .tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }

/* -------------------------------------------------------------- upload */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 18px; max-width: 760px; }
.panel h2 { font: 400 20px/1.2 var(--display); margin-bottom: 12px; }
.drop {
  display: grid; place-items: center; gap: 12px; text-align: center; padding: 40px 18px;
  border: 2px dashed var(--line); border-radius: 12px; color: var(--ink-2); margin-bottom: 18px;
}
.drop.over { border-color: var(--cloth); background: rgba(31, 90, 74, .07); color: var(--cloth); }
.drop .big { font: 400 22px/1.2 var(--display); color: var(--ink); }
.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.queue li { display: flex; align-items: center; gap: 12px; }
.queue img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; background: var(--table); flex: none; }
.queue .qname { flex: 1; min-width: 0; }
.queue .qname b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue .state { font-size: 13px; color: var(--ink-2); }
.queue .state.err { color: var(--danger); }
.queue .state.ok { color: var(--cloth); }
.meter { height: 4px; border-radius: 2px; background: var(--table); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; width: 0; background: var(--cloth); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* --------------------------------------------------------------- admin */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; color: var(--ink-2); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--table); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 99px; background: var(--table); font-size: 13px; font-weight: 600; }
.pill.admin { background: var(--cloth); color: #fff; }
.pill.off { background: #f1dedd; color: var(--danger); }
.facts-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin-bottom: 14px; }
.facts-grid dt { color: var(--ink-2); } .facts-grid dd { margin: 0; overflow-wrap: anywhere; }
.folder-pick { max-height: 210px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 14px; }
.folder-pick label { display: flex; gap: 8px; align-items: center; padding: 3px 0; cursor: pointer; }
.folder-pick input { accent-color: var(--cloth); width: 16px; height: 16px; flex: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------- dialogs */
dialog {
  border: 0; border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); color: var(--ink); background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
dialog::backdrop { background: rgba(15, 20, 24, .55); }
dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.dlg-head { display: flex; align-items: center; padding: 16px 12px 6px 22px; }
.dlg-head h2 { font: 400 21px/1.2 var(--display); margin-right: auto; }
.dlg-body { padding: 10px 22px 6px; overflow: auto; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 22px 18px; flex-wrap: wrap; }
.dlg-foot .left { margin-right: auto; }
.album-choice { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; }
.album-choice:hover { background: var(--table); }
.album-choice .sw { width: 34px; height: 42px; border-radius: 2px 5px 5px 2px; background: var(--cloth); flex: none; box-shadow: inset 4px 0 0 rgba(0, 0, 0, .25); }
.album-choice .sw.c1 { background: #6b2130; } .album-choice .sw.c2 { background: #22324f; }
.album-choice .sw.c3 { background: #4a2b4f; } .album-choice .sw.c4 { background: #3c4850; }
.album-choice b { display: block; font-weight: 600; }
.album-choice small { color: var(--ink-2); }
.form-error { color: var(--danger); font-weight: 550; margin: 0 0 10px; }

/* --------------------------------------------------------- selection bar */
.selbar {
  position: fixed; left: calc(50% + var(--side-w) / 2); bottom: calc(18px + var(--tabs-h) + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 8px 18px; border-radius: 14px; background: var(--ink); color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35); max-width: calc(100vw - 16px);
}
.selbar .n { font-weight: 600; margin-right: 8px; white-space: nowrap; }
.selbar .btn { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.selbar .btn.primary { background: #fff; border-color: #fff; color: var(--ink); }
.selbar .icon-btn { color: #fff; }

#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 24px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 550; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.toast.err { background: var(--danger); }

/* --------------------------------------------------------------- login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--page);
  background-image: radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1.2px); background-size: 5px 5px; }
.login form { width: min(360px, 100%); background: var(--print); padding: 30px 28px 26px; border-radius: 4px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transform: rotate(-.6deg); }
.login h1 { font: 400 34px/1 var(--display); color: var(--cloth); margin-bottom: 6px; }
.login p.sub { color: var(--ink-2); margin-bottom: 22px; }
.login .btn { width: 100%; }

/* ------------------------------------------------------------ lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: #000; color: #f2f2f2; display: flex; }
.lb-main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-top { display: flex; align-items: center; gap: 2px; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top)); z-index: 2; }
.lb-title { margin: 0 auto 0 8px; min-width: 0; }
.lb-title b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-title small { color: #a9adb0; }
.lb-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.lb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lb-stage img.low { filter: blur(6px); }
.lb-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.lb .heart.on .icon { fill: #e4526a; stroke: #e4526a; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; background: rgba(0, 0, 0, .45); z-index: 2; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }
.lb-caption { text-align: center; font: 400 22px/1.3 var(--hand); padding: 10px 16px calc(14px + env(safe-area-inset-bottom)); min-height: 30px; }
.lb-caption button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 2px 8px; border-radius: 6px; }
.lb-caption button.blank { color: #8d9194; font: 400 15px var(--ui); }
.lb-caption button:hover { background: rgba(255, 255, 255, .12); }
.lb-info { width: 360px; flex: none; background: #15181b; overflow: auto; padding: 14px 20px 30px; border-left: 1px solid #2a2f33; }
.lb-info h2 { font: 400 20px/1.2 var(--display); margin: 4px 0 14px; display: flex; align-items: center; }
.lb-info h2 span { margin-right: auto; }
.lb-info h3 { font-size: 13px; font-weight: 600; color: #9aa0a4; margin: 18px 0 6px; }
.lb-info .line { display: flex; gap: 12px; padding: 5px 0; align-items: flex-start; }
.lb-info .line .icon { color: #9aa0a4; margin-top: 1px; }
.lb-info .line small { display: block; color: #9aa0a4; }
.lb-info .line div { min-width: 0; overflow-wrap: anywhere; }
.lb-info a { color: var(--foil); }
.lb-info .chip { display: inline-block; padding: 2px 10px; border-radius: 99px; background: #2a2f33; margin: 0 6px 6px 0; text-decoration: none; color: #f2f2f2; font-size: 14px; }
.lb-info details { margin-top: 18px; border-top: 1px solid #2a2f33; padding-top: 12px; }
.lb-info summary { cursor: pointer; font-weight: 600; }
.lb-info table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb-info td { padding: 3px 0; vertical-align: top; overflow-wrap: anywhere; }
.lb-info td:first-child { color: #9aa0a4; padding-right: 12px; width: 44%; }
.lb-info .check { margin-top: 16px; }

/* -------------------------------------------------------------- mobile */
.tabs { display: none; }
@media (max-width: 820px) {
  :root { --row-h: 112px; --side-w: 0px; --tabs-h: 58px; }
  .side { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabs-h) + 90px + env(safe-area-inset-bottom)); }
  .tabs {
    position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; background: var(--surface);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
  }
  .tabs .nav-link { flex: 1; flex-direction: column; gap: 2px; padding: 8px 2px; font-size: 11.5px; border-radius: 0; align-items: center; min-height: var(--tabs-h); justify-content: center; }
  .tabs .nav-link.active { background: none; color: var(--cloth); }
  .bar { padding: 10px 14px; gap: 8px; }
  .bar h1 { font-size: 22px; }
  .bar .tools { width: 100%; }
  .search { flex: 1 0 100%; } .search input { width: 100%; }
  .bar .tools select.input { flex: 1; min-width: 0; }
  .view { padding: 2px 3px 0; }
  .view.pad { padding: 2px 14px 0; }
  .month { margin-left: 11px; }
  .notice { margin: 0 14px 10px; }
  .shelf { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; padding: 8px 11px 0; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  /* On a phone the People row is one strip you swipe sideways. */
  .people { display: flex; overflow-x: auto; gap: 14px; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
  .people .person { flex: 0 0 92px; scroll-snap-align: start; }
  .people.clipped > .person:nth-child(n + 13) { display: block; }
  .people + .btn { display: none; }
  .tabs .nav-link { min-width: 0; }
  .crumbs .here { font-size: 21px; }
  .album-head { padding: 18px 16px 14px; }
  .prints { gap: 22px 14px; padding: 4px 10px 0; --row-h: 118px; }
  .prints .cell { border-width: 5px; }
  .print-caption { font-size: 17px; }
  .two { grid-template-columns: 1fr; }
  .lb { flex-direction: column; }
  .lb-info { position: absolute; inset: auto 0 0 0; width: auto; max-height: 72dvh; border-left: 0; border-radius: 16px 16px 0 0; z-index: 5; padding-bottom: calc(30px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .6); }
  .lb-nav { display: none; }
  .hide-sm { display: none !important; }
  .table .hide-sm { display: none; }
  .selbar { padding-left: 14px; }
  .selbar .btn { padding: 0 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
