:root {
  --bg: #f7f6f3; --panel: #fff; --ink: #1f2328; --muted: #6b6f76; --line: #e3e1dc;
  --accent: #2f5d8a; --accent-ink: #fff; --ok: #2e7d4f; --ok-bg: #e7f4ec;
  --warn: #9a5b00; --warn-bg: #fdf1dc; --sugg: #5b4a9e; --sugg-bg: #efebfa;
  --none-bg: #eeeeec; --undated-bg: #f6e7e7; --undated: #8a3434;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17191c; --panel: #202327; --ink: #e8e6e3; --muted: #9aa0a6; --line: #33373c;
    --accent: #7fb0e0; --accent-ink: #10202f; --ok: #7fd1a1; --ok-bg: #1d3327;
    --warn: #f0b660; --warn-bg: #3a2c14; --sugg: #b9a8f0; --sugg-bg: #2b2540;
    --none-bg: #2a2d31; --undated-bg: #3a2222; --undated: #f0a0a0;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; padding: .7rem 1.25rem; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .lib { font-weight: 650; }
/* The logo. The name is an image used as a mask, so it takes the page's text colour. */
.brand { display: inline-flex; align-items: center; gap: .5em; color: var(--ink); font-size: 1rem; }
.brand:hover { text-decoration: none; }
.brand-mark { height: 1.75em; width: auto; }
.brand-word { display: inline-flex; height: 1em; margin-bottom: .12em; }
.brand-name, .brand-ai { height: 100%; background: currentColor; -webkit-mask: center / 100% 100% no-repeat; mask: center / 100% 100% no-repeat; }
.brand-name { aspect-ratio: 608 / 139; -webkit-mask-image: url("brand/wordmark.aa7f03a3818c.png"); mask-image: url("brand/wordmark.aa7f03a3818c.png"); }
.brand-ai { aspect-ratio: 184 / 139; color: #7d88b0; -webkit-mask-image: url("brand/wordmark-ai.2e3d5a1d5a44.png"); mask-image: url("brand/wordmark-ai.2e3d5a1d5a44.png"); }
.brand.big { font-size: 2.6rem; }
.topbar .brand { font-size: 1.15rem; }
.topbar.plain { position: static; }
.signin { max-width: 22rem; margin: 9vh auto 0; text-align: center; }
.signin .tagline { margin: .9rem 0 2.2rem; color: var(--muted); font-size: .72rem; letter-spacing: .28em; text-transform: uppercase; }
.signin h1 { font-size: 1.15rem; margin-bottom: .8rem; }
.signin form { text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.2rem 1.2rem; }
.signin form p { margin: 0 0 .8rem; }
.signin form label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: .2rem; }
.signin form input { width: 100%; padding: .45rem .55rem; }
.signin form button { width: 100%; padding: .5rem; margin-top: .2rem; }
.signin .errorlist { list-style: none; margin: 0 0 .8rem; padding: 0; color: var(--danger); font-size: .88rem; }
.topbar .spacer { flex: 1; }
.topbar form { margin: 0; }
main { max-width: 78rem; margin: 0 auto; padding: 1.25rem; }
h1 { font-size: 1.45rem; margin: .2rem 0 .3rem; }
.lede { color: var(--muted); margin: 0 0 1rem; max-width: 52rem; }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 6px; padding: .3rem .7rem; cursor: pointer; }
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input[type=text] { font: inherit; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); width: 11rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 1rem; }
.chip { padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
.chip.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.chip .n { color: var(--muted); margin-left: .3rem; font-variant-numeric: tabular-nums; }
.chip.on .n { color: inherit; opacity: .7; }
.bulkbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; padding: .6rem .8rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem; position: sticky; top: 3.1rem; z-index: 4; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.frow { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .7rem .8rem; display: grid; grid-template-columns: minmax(16rem, 1.2fr) minmax(12rem, 1fr); gap: .5rem 1rem; align-items: start; }
.tree .frow { margin-left: calc(var(--depth) * 1.1rem); }
.fhead { display: flex; gap: .6rem; align-items: flex-start; min-width: 0; }
.fhead input[type=checkbox] { margin-top: .35rem; }
.fname { min-width: 0; }
.fname a.name { font-weight: 600; word-break: break-word; }
.fparent { font-size: .82rem; color: var(--muted); word-break: break-word; }
.counts { display: block; font-size: .85rem; color: var(--muted); }
.warn { color: var(--warn); }
.fdate { display: flex; flex-direction: column; gap: .15rem; }
.fdate .date { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fdate .inh { color: var(--muted); font-size: .9rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; letter-spacing: .02em; padding: .05rem .5rem; border-radius: 999px; width: fit-content; }
.b-suggested { background: var(--sugg-bg); color: var(--sugg); }
.b-confirmed { background: var(--ok-bg); color: var(--ok); }
.b-undated { background: var(--undated-bg); color: var(--undated); }
.b-none { background: var(--none-bg); color: var(--muted); }
.thumbs { grid-column: 1 / -1; display: flex; gap: .35rem; overflow: hidden; }
.thumbs img { height: 64px; width: auto; max-width: 96px; object-fit: cover; border-radius: 4px; background: var(--none-bg); }
.factions { grid-column: 1 / -1; display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.factions form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: 0; }
.preview { font-size: .85rem; color: var(--muted); }
.preview .bad { color: var(--undated); }
.preview .good { color: var(--ok); }
.msg { grid-column: 1 / -1; font-size: .88rem; color: var(--ok); }
.toast { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: .55rem 1rem; border-radius: 8px; max-width: min(36rem, calc(100vw - 2rem)); z-index: 10; }
.toast:empty { display: none; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: .3rem; word-break: break-word; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .8rem; margin-bottom: 1rem; }
h2 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .75rem; }
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; }
.tile.conflict { border-color: var(--warn); }
.tile label { display: block; cursor: pointer; }
.tile input[type=checkbox] { position: absolute; top: .4rem; left: .4rem; width: 1.1rem; height: 1.1rem; }
.tile img, .tile .noimg { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--none-bg); }
.tile .noimg { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.tile .meta { padding: .35rem .45rem; font-size: .8rem; }
.tile .meta .d { font-weight: 600; font-size: .88rem; font-variant-numeric: tabular-nums; }
.tile .meta .src { color: var(--muted); }
.tile .note { color: var(--warn); font-size: .75rem; margin-top: .2rem; }
.tile .fname-small { color: var(--muted); font-size: .72rem; word-break: break-all; }
.empty { color: var(--muted); padding: 2rem; text-align: center; }
@media (max-width: 640px) {
  .frow { grid-template-columns: 1fr; }
  .tree .frow { margin-left: calc(var(--depth) * .5rem); }
  input[type=text] { width: 9rem; }
}

.searchbar { display: flex; gap: .5rem; margin: .5rem 0 1rem; }
.searchbar input[type=search] { flex: 1; font: inherit; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .75rem; }
.person { text-align: center; }
.person img, .person .noface { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; background: var(--none-bg); display: block; }
.person .noface { display: grid; place-items: center; color: var(--muted); font-size: .8rem; }
.person .pname { display: block; margin-top: .35rem; font-weight: 600; font-size: .9rem; word-break: break-word; }
.person .pcount { color: var(--muted); font-size: .8rem; }
.person input[type=text] { width: 100%; margin-top: .35rem; font-size: .85rem; }
.hero { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.hero img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }

/* --- Browsing: timeline, viewer, albums, sharing --- */
:root { --danger: #a33a3a; }
@media (prefers-color-scheme: dark) { :root { --danger: #f09090; } }
.muted { color: var(--muted); }
.flash { padding: .4rem .7rem; background: var(--ok-bg); border-radius: 6px; width: fit-content; }
button.danger, .danger { color: var(--danger); }
input[type=email], input[type=password], input[type=number], select { font: inherit; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); }
input.num { width: 5.5rem; }
input.wide { width: min(40rem, 100%); }
.narrow { max-width: 28rem; margin: 3rem auto; }

/* Timeline: years newest first, each a calendar of month tiles. */
.timeline { max-width: 72rem; margin: 0 auto; }
.tyear { scroll-margin-top: 4rem; margin: .6rem 0 2.8rem; }
.months { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 45%), 1fr)); gap: 1rem; }
.months a { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--none-bg); color: #fff;
  box-shadow: 0 1px 2px rgb(20 20 30 / .05), 0 8px 24px rgb(20 20 30 / .06); }
.months a:hover { text-decoration: none; }
.months img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.months a:hover img { transform: scale(1.04); }
.months a::after { content: ""; position: absolute; inset: 0; background: linear-gradient(200deg, rgb(0 0 0 / .45), transparent 45%); pointer-events: none; }
.months .m { position: absolute; top: .55rem; right: .85rem; z-index: 1; font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 600; letter-spacing: -.02em; text-shadow: 0 1px 8px rgb(0 0 0 / .35); }
.months .n { position: absolute; left: .7rem; bottom: .6rem; z-index: 1; font-size: .75rem; font-weight: 600; font-variant-numeric: tabular-nums; background: rgb(0 0 0 / .45); padding: .15rem .5rem; border-radius: 999px; }
.months a:not(:has(img)) { color: var(--muted); }
.months a:not(:has(img))::after { display: none; }
.months a:not(:has(img)) .m { text-shadow: none; }
.monthnav { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill.quiet { background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-weight: 500; }
.grid.photos { gap: .8rem; }
.grid.photos .tile { border: 0; border-radius: 12px; box-shadow: 0 1px 2px rgb(20 20 30 / .05), 0 8px 24px rgb(20 20 30 / .06); }
@media (prefers-reduced-motion: reduce) { .months img { transition: none; } }
.grid.lazy:empty { min-height: calc(var(--n) / 6 * 158px); background: repeating-linear-gradient(90deg, var(--none-bg) 0 150px, transparent 150px 160px); border-radius: 8px; opacity: .5; }
.grid .more { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.tile > input.sel { position: absolute; top: .4rem; left: .4rem; width: 1.15rem; height: 1.15rem; z-index: 1; opacity: 0; transition: opacity .1s; }
.tile:hover > input.sel, .tile > input.sel:checked, body.selecting .tile > input.sel { opacity: 1; }
.tile:has(> input.sel:checked) { outline: 3px solid var(--accent); outline-offset: -3px; }
/* The selection bar: a strip that names what can be done with the ticked photos. Anything
   that needs a choice (album, date, folder) asks in its own dialog. */
.selectbar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; justify-content: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .7rem; box-shadow: 0 6px 24px rgb(0 0 0 / .28); z-index: 8; max-width: calc(100vw - 2rem); }
.selectbar[hidden] { display: none; }
.selectbar strong { margin: 0 .5rem 0 .2rem; white-space: nowrap; }
.selectbar .sep { align-self: stretch; width: 1px; background: var(--line); margin: .15rem .3rem; }
.selectbar button { border: 0; background: none; border-radius: 999px; padding: .4rem .8rem; white-space: nowrap; }
.selectbar button:hover { background: var(--bg); }
.selectbar .sel-clear { padding: .4rem .6rem; color: var(--muted); }
@media (max-width: 40rem) { .selectbar { border-radius: 14px; } }
.sel-dialog { width: min(30rem, calc(100vw - 2rem)); }
.sel-dialog .row { display: flex; gap: .5rem; align-items: center; margin: 0 0 .8rem; }
.sel-dialog .row select, .sel-dialog .row input[type="text"] { flex: 1; min-width: 0; font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
.sel-dialog .dialog-actions .link { margin-right: auto; }
.sel-dialog .date-preview { font-size: .85rem; color: var(--muted); flex: 0 1 45%; }
.sel-dialog .date-preview .bad { color: var(--undated); }
.sel-dialog .date-preview .good { color: var(--ok); }

.frame { position: relative; margin: 0; line-height: 0; }
.frame:has(video) { width: 100%; }
.frame video { width: 100%; aspect-ratio: 4 / 3; background: #000; }
.vidnote { position: absolute; left: 0; right: 0; bottom: 0; padding: .5rem .8rem; background: rgb(0 0 0 / .65); color: #fff; font-size: .85rem; line-height: 1.4; }
.noimg.big { color: #bbb; padding: 4rem 2rem; line-height: 1.4; max-width: 30rem; }
.boxes .box { position: absolute; border: 2px solid rgb(255 255 255 / .85); border-radius: 4px; box-shadow: 0 0 0 1px rgb(0 0 0 / .4); }
.boxes .box span { position: absolute; top: 100%; left: -2px; margin-top: 2px; background: rgb(0 0 0 / .7); color: #fff; font-size: .75rem; line-height: 1.3; padding: .05rem .35rem; border-radius: 3px; white-space: nowrap; }
.info .date { font-weight: 650; font-variant-numeric: tabular-nums; }
.info .src { color: var(--muted); }
.info .note { color: var(--warn); font-size: .82rem; margin-top: .15rem; }
.info .datefix summary { cursor: pointer; color: var(--accent); font-size: .82rem; margin-top: .2rem; width: max-content; }
.info .dateform { margin: .4rem 0 0; }
.info .dateform input[type=text] { width: 100%; }
.info .addto { margin: .5rem 0 0; }
.faces { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); gap: .5rem; }
.faces li { text-align: center; font-size: .78rem; word-break: break-word; }
.faces a { color: inherit; }
.faces img, .faces .noface { width: 3.6rem; height: 3.6rem; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto .2rem; background: var(--none-bg); }
.faces .noface { display: grid; place-items: center; color: var(--muted); }
.faces .fix { font-size: .75rem; }
.face-editor { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.face-editor p { margin: 0 0 .4rem; font-size: .85rem; display: flex; gap: .6rem; align-items: center; }
.face-editor p img { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; flex: none; }
.face-editor input[type=text] { width: 100%; }
.face-editor .toolbar { margin: .4rem 0 0; }
.boxes .box.on { border: 3px solid #ffd400; box-shadow: 0 0 0 2px rgb(0 0 0 / .5); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.chip { display: inline-block; margin: 0 .2rem .25rem 0; font-size: .8rem; }

.albums { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.albums a { display: block; color: inherit; }
.albums img, .albums .noimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--none-bg); }
.albums .noimg { display: grid; place-items: center; color: var(--muted); }
.albums .t { display: block; font-weight: 600; margin-top: .4rem; }
.albums .n { color: var(--muted); font-size: .85rem; }
.titleform { display: flex; gap: .5rem; align-items: baseline; margin: .2rem 0 .3rem; }
.titleform .h1input { font-size: 1.45rem; font-weight: 650; border-color: transparent; background: transparent; width: min(34rem, 100%); padding: .1rem .3rem; margin-left: -.3rem; }
.titleform .h1input:hover, .titleform .h1input:focus { border-color: var(--line); background: var(--panel); }
.shares summary { cursor: pointer; }
.newshare { background: var(--ok-bg); border-radius: 8px; padding: .6rem .8rem; margin: .6rem 0; }
.newshare p { margin: 0 0 .4rem; }
.sharelist { width: 100%; border-collapse: collapse; font-size: .88rem; margin: .6rem 0; }
.sharelist th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: .3rem .4rem; }
.sharelist td { border-bottom: 1px solid var(--line); padding: .35rem .4rem; vertical-align: top; }
.sharelist tr.inactive td { color: var(--muted); }
.sharelist .acts { display: flex; gap: .6rem; }
.sharelist .acts form { margin: 0; }
.sharelist .ua { font-size: .75rem; }
.shareform fieldset { border: 0; padding: 0; margin: .8rem 0 .5rem; display: flex; gap: 1rem; flex-wrap: wrap; }
.shareform legend { font-weight: 600; margin-bottom: .3rem; }
.shareform [hidden] { display: none; }

.lightbox { padding: 0; border: 0; background: #000; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: #000; }
.lightbox img, .lightbox video { width: 100%; height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: rgb(0 0 0 / .4); color: #fff; border: 0; font-size: 2.2rem; padding: .2rem .9rem; }
.lightbox .lb-prev { left: .5rem; top: 50%; } .lightbox .lb-next { right: .5rem; top: 50%; }
.lightbox .lb-close { right: .5rem; top: .5rem; }

@media (max-width: 860px) {
  .viewer { grid-template-columns: 1fr; }
  .stage { position: relative; top: auto; }
}

.tile > a { position: relative; display: block; }
.tile .dur { position: absolute; right: .3rem; bottom: .3rem; background: rgb(0 0 0 / .65); color: #fff; font-size: .72rem; line-height: 1; padding: .2rem .35rem; border-radius: 3px; font-variant-numeric: tabular-nums; pointer-events: none; }
/* Marks on a tile for work it needs (no location, …): one chip each, top right, beside nothing else. */
.tile .flags { position: absolute; top: .4rem; right: .4rem; display: flex; gap: .25rem; }
.tile .flag { display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 999px; background: rgb(0 0 0 / .62); color: #ffc65c; box-shadow: 0 0 0 1px rgb(255 255 255 / .25); }
.tile .flag svg { width: .9rem; height: .9rem; }
svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }  /* icons drawn once for <use> */
body.noflags .tile .flags { display: none; }
.flags-toggle .off, body.noflags .flags-toggle .on { display: none; }
body.noflags .flags-toggle .off { display: inline; }
.msg.todo > span + span::before { content: " · "; color: var(--muted); }
.msg.filtering { color: var(--ink); }

/* Map. isolation keeps Leaflet's high z-indexes below the sticky top bar. */
main:has(.mapwrap) { max-width: none; }
.maphead { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.25rem; }
.maphead .lede { margin: 0; }
.yearfilter { display: flex; gap: .8rem; align-items: center; color: var(--muted); }
.yearfilter[hidden] { display: none; }
.yearfilter select { font: inherit; }
.mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 24rem; gap: 1rem; height: calc(100vh - 9.5rem); min-height: 26rem; margin-top: .75rem; }
.map, .minimap { isolation: isolate; border-radius: 10px; border: 1px solid var(--line); background: var(--none-bg); }
.mapside { overflow-y: auto; }
.mapside .count { color: var(--muted); margin: 0 0 .6rem; }
.mapside .grid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); }
.pin { background: none; border: 0; }
/* Leaflet sets marker images to width: auto with more weight than a bare .pin img. */
.leaflet-container .leaflet-marker-pane .pin img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; border: 3px solid #fff; box-shadow: 0 1px 5px rgb(0 0 0 / .45); background: #ccc; display: block; }
.pin span { position: absolute; top: -8px; right: -10px; min-width: 1.5rem; padding: .05rem .35rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .75rem; font-weight: 650; text-align: center; box-shadow: 0 1px 3px rgb(0 0 0 / .4); }
@media (max-width: 860px) {
  .mapwrap { grid-template-columns: 1fr; height: auto; }
  .map { height: 65vh; }
  .mapside { overflow: visible; }
}

/* Upload */
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 2rem 1rem; text-align: center; background: var(--panel); }
.dropzone.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.dropzone p { margin: .4rem 0; }
.dropzone .btn { display: inline-block; margin: 0 .25rem; }
.dropzone .hint { color: var(--muted); font-size: .85rem; }
.upload-plan, .upload-run { margin-top: 1.25rem; }
.upload-options { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.upload-options [hidden] { display: none; }
.upload-run progress { width: 100%; height: .8rem; }
.upload-now { list-style: none; padding: 0; margin: .3rem 0; color: var(--muted); font-size: .85rem; }
.upload-now li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-problems { font-size: .85rem; }
.upload-status { color: var(--undated); }
.upload-run .hint, .upload-plan .hint { color: var(--muted); font-size: .85rem; }
.upload-plan .hint.bad { color: var(--undated); }
.upload-unfinished { margin: 1rem 0; padding: .1rem .9rem; border-left: 3px solid var(--undated); }
.upload-problems .why { color: var(--undated); }
.sh { font-size: 1.2rem; margin: 1.4rem 0 .2rem; }
.sh .n { color: var(--muted); font-weight: 400; font-size: .8em; margin-left: .3rem; }

/* Folders: the tree on the left, the open folder on the right ("Paper"). */
main:has(.folders) { max-width: none; padding: 1.25rem 2rem 2.5rem; }
.folders { --soft: color-mix(in srgb, var(--accent) 13%, var(--panel)); --lift: 0 1px 2px rgb(20 20 30 / .05), 0 8px 24px rgb(20 20 30 / .06);
  display: grid; grid-template-columns: minmax(14rem, 17rem) 1fr; gap: 1.75rem; }
.folder-main { min-width: 0; }
.ftree { position: sticky; top: 4.2rem; align-self: start; max-height: calc(100vh - 5.5rem); overflow-y: auto; font-size: .88rem;
  background: var(--panel); border-radius: 18px; padding: 1rem .6rem; box-shadow: var(--lift); }
.ftree-h { margin: 0 .7rem .5rem; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ftree ul { list-style: none; margin: 0; padding: 0; }
.ftree ul ul { margin-left: 1.05rem; padding-left: .45rem; border-left: 1px solid var(--line); }
.ftree summary { list-style: none; cursor: pointer; display: flex; align-items: center; border-radius: 10px; }
.ftree summary::-webkit-details-marker { display: none; }
.ftree summary::before { content: ""; width: 1rem; height: 1rem; flex: none; background: var(--muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / .8rem no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / .8rem no-repeat;
  transition: transform .15s; }
.ftree details[open] > summary::before { transform: rotate(90deg); }
.ftree .leaf { padding-left: 1rem; display: flex; }
.ftree a { flex: 1; min-width: 0; display: flex; gap: .5rem; align-items: baseline; color: var(--ink); padding: .32rem .6rem; border-radius: 9px; }
.ftree a:hover { background: var(--bg); text-decoration: none; }
.ftree a[aria-current] { background: var(--soft); color: var(--accent); font-weight: 600; }
.ftree a[aria-current] .n { color: inherit; }
.ftree .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftree .n { color: var(--muted); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
/* An empty folder's row and card are greyed, not laid out like the page-wide "nothing here" notice (.empty). */
.ftree li.empty, .fcards li.empty { padding: 0; text-align: inherit; }
.ftree .empty > * > a, .ftree .empty > details > summary > a { color: var(--muted); }

.folder-main .crumbs { margin: .4rem .2rem .3rem; }
/* A page's big heading (Folders, Timeline): title and summary, actions on the right. */
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem; margin: 0 .2rem 1.8rem; }
.pagehead > div { flex: 1; min-width: 16rem; }
.pagehead h1, .pagehead h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.05; margin: 0; }
.pagehead .lede { margin: .55rem 0 0; font-size: .95rem; }
.pill { display: inline-flex; align-items: center; min-height: 2.6rem; padding: 0 1.1rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: .88rem; font-weight: 600; }
.pill:hover { text-decoration: none; filter: brightness(1.08); }

.fcards { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2.2rem 1.6rem; }
.fcards a { display: flex; flex-direction: column; gap: .3rem; color: inherit; }
.fcards a:hover { text-decoration: none; }
.fcards .stack { position: relative; display: block; aspect-ratio: 5 / 4; margin: .5rem .7rem 1rem; }
.fcards .sheet { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; background: var(--none-bg); box-shadow: 0 2px 8px rgb(20 20 30 / .10); transition: transform .2s ease; }
.fcards .sheet img { display: block; width: 100%; height: 100%; object-fit: cover; }
.fcards .back { transform: rotate(-5deg) translate(-6px, 2px); }
.fcards .mid { transform: rotate(4deg) translate(6px, 0); }
.fcards .front { border: 5px solid var(--panel); box-shadow: 0 6px 18px rgb(20 20 30 / .16); }
.fcards a:hover .back { transform: rotate(-8deg) translate(-12px, 0); }
.fcards a:hover .mid { transform: rotate(7deg) translate(12px, -2px); }
.fcards a:hover .front { transform: translateY(-3px); }
.fcards .noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }
.fcards .t { font-size: 1.3rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 .25rem; }
.fcards a:hover .t { color: var(--accent); }
.fcards .d { color: var(--muted); font-size: .82rem; padding: 0 .25rem; }
.fcards .empty { opacity: .6; }
.folder-main .grid { gap: .8rem; }
.folder-main .tile { border: 0; border-radius: 12px; box-shadow: var(--lift); }
@media (prefers-reduced-motion: reduce) { .fcards .sheet, .ftree summary::before { transition: none; } }
@media (max-width: 860px) {
  main:has(.folders) { padding: 1rem; }
  .folders { grid-template-columns: 1fr; }
  .ftree { position: static; max-height: 40vh; }
  .fcards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
.unnamed { margin-top: .5rem; font-size: .85rem; }
.unnamed > summary { cursor: pointer; color: var(--accent); width: max-content; }
.unnamed .faces { margin-top: .5rem; }
.unnamed .when-open, .unnamed[open] .when-closed { display: none; }
.unnamed[open] .when-open { display: inline; }
.leftout { margin-top: .6rem; font-size: .85rem; color: var(--muted); }
.leftout summary { cursor: pointer; }
.leftout .faces { margin-top: .5rem; opacity: .75; }
.addperson { margin-top: .8rem; margin-bottom: 0; }
.addperson input { flex: 1; min-width: 8rem; }

/* Search filters */
.filters summary { cursor: pointer; }
.filters fieldset { border: 0; padding: 0; margin: .8rem 0 0; min-width: 0; }
.filters legend { font-weight: 600; padding: 0; margin-bottom: .35rem; }
.filters legend .muted { font-weight: 400; }
.filters label { margin-right: .9rem; white-space: nowrap; }
.filters input[type=text] { font: inherit; padding: .25rem .45rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.filters .toolbar { margin: 1rem 0 0; }
.people-filter { width: 100%; max-width: 22rem; font: inherit; padding: .35rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); margin-bottom: .6rem; }
.pick { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(5.2rem, 1fr)); gap: .6rem; max-height: 19rem; overflow-y: auto; }
.pick li[hidden] { display: none; }
.pick label { display: block; text-align: center; font-size: .78rem; white-space: normal; margin: 0; cursor: pointer; word-break: break-word; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img, .pick .noface { width: 4rem; height: 4rem; border-radius: 50%; object-fit: cover; display: grid; place-items: center; margin: 0 auto .25rem; background: var(--none-bg); color: var(--muted); border: 3px solid transparent; }
.pick input:checked ~ img, .pick input:checked ~ .noface { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.pick input:checked ~ span { font-weight: 650; color: var(--accent); }
.pick input:focus-visible ~ img, .pick input:focus-visible ~ .noface { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips { list-style: none; padding: 0; margin: 0 0 .5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: .2rem .4rem .2rem .25rem; font-size: .9rem; }
.chips .k { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: .1rem .55rem; margin-right: .25rem; font-size: .8rem; }
.chips a { margin-left: .3rem; text-decoration: none; color: var(--muted); }

/* Person page tools and their dialogs */
.person-tools .spacer { flex: 1; }
.dialog { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 1.2rem 1.4rem; width: min(40rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); }
.dialog::backdrop { background: rgb(0 0 0 / .45); }
.dialog h2 { margin-top: 0; }
.dialog p { max-width: 36rem; }
.dialog .pick { max-height: 16rem; margin-bottom: .8rem; }
.dialog-actions { justify-content: flex-end; margin: .5rem 0 0; }
.dialog input.wide { width: 100%; font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); margin-bottom: .6rem; }
/* Naming patterns */
.dialog .choices { list-style: none; margin: 0 0 .8rem; padding: 0; }
.dialog .choices label { display: flex; gap: .6rem; align-items: baseline; margin: 0; padding: .35rem .2rem; cursor: pointer; }
.dialog .choices .eg { display: block; color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; }
/* "LrC": this folder is Lightroom's (managed, or holding its photos). Our own mark, not Adobe's logo. */
.lrc { display: inline-block; vertical-align: middle; margin-left: .5rem; padding: .18em .42em; border-radius: .32em; font-size: .9rem; font-weight: 700; letter-spacing: 0; line-height: 1; background: #0b2a4a; color: #6ab7ff; border: 1.5px solid #6ab7ff; cursor: help; }
.lrc.quiet { background: none; color: var(--muted); border-color: var(--muted); }
table.names { border-collapse: collapse; width: 100%; max-width: 70rem; font-size: .9rem; }
table.names th, table.names td { text-align: left; padding: .35rem .8rem .35rem 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
table.names .where { color: var(--muted); }
table.names .warn { color: var(--undated); display: block; font-size: .85rem; }
/* The trash */
.trash-folders { list-style: none; padding: 0; margin: 0 0 2rem; max-width: 52rem; }
.trash-folders li { display: flex; gap: 1rem; align-items: center; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.trash-folders li > div { flex: 1; min-width: 0; display: grid; }
.trash-folders .where, .trash-folders .what { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-grid label { display: block; margin: 0; cursor: pointer; }
.trash-grid .meta .d { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Managing a folder: its tools, and the tree of destinations in "Move into…" */
.folder-tools { margin: -1rem .2rem 1.4rem; }
.folder-main .msg { margin: -.8rem .2rem 1.4rem; }
.msg.busy { color: var(--muted); }
.ftree-h button.link { float: right; font-size: .72rem; letter-spacing: 0; text-transform: none; }
.pickfolder, .pickfolder ul { list-style: none; margin: 0; padding: 0; }
.pickfolder { max-height: 19rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; margin-bottom: .8rem; }
.pickfolder ul { margin-left: 1.05rem; padding-left: .45rem; border-left: 1px solid var(--line); }
.pickfolder summary { cursor: pointer; }
.pickfolder .leaf { padding-left: 1rem; }
.pickfolder label { display: inline-flex; gap: .45rem; align-items: baseline; margin: 0; padding: .2rem .3rem; cursor: pointer; }
.pickfolder input:checked ~ .t { font-weight: 650; color: var(--accent); }
.pickfolder input:disabled ~ .t { color: var(--muted); }
.pickfolder .n, .pickfolder .none { color: var(--muted); font-size: .8rem; }
.tile .tile-folder { display: block; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .fname-small.short { word-break: normal; overflow-wrap: anywhere; }

/* Album covers */
.album-head { display: flex; gap: 1.2rem; align-items: center; margin-bottom: .5rem; }
.album-cover { width: 9rem; height: 9rem; object-fit: cover; border-radius: 10px; flex: none; }
@media (max-width: 40rem) { .album-cover { width: 5.5rem; height: 5.5rem; } }
.inalbums { list-style: none; margin: 0 0 .6rem; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.inalbums li { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inalbums form { display: inline; margin: 0; }
.inalbums .muted { font-size: .85rem; }

/* Shared album: a gallery, introduced by its cover photo (SmugMug-like). Always dark, so
   the photos carry the colour. */
body:has(.gallery) { background: #111; color: #eee; }
body:has(.gallery) main { max-width: none; padding: 0; }
.gallery { padding: 0 0 2rem; }
.g-hero { position: relative; height: min(62vh, 40rem); overflow: hidden; background: #222; }
.g-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-hero-plain { height: auto; padding: 4rem 1.5rem 1rem; }
.g-title { position: absolute; left: 0; right: 0; bottom: 0; padding: 4rem 2rem 1.6rem; background: linear-gradient(transparent, rgb(0 0 0 / .65)); color: #fff; }
.g-hero-plain .g-title { position: static; padding: 0; background: none; }
.g-title h1 { font-size: clamp(2rem, 6vw, 4rem); font-weight: 300; margin: 0; line-height: 1.1; text-shadow: 0 1px 12px rgb(0 0 0 / .4); }
.g-title p { margin: .4rem 0 0; opacity: .85; }
.g-tools { display: flex; align-items: center; gap: 1rem; padding: .9rem 1rem; }
.g-tools button { background: #2a2a2a; color: #eee; border: 1px solid #444; border-radius: 6px; padding: .45rem .9rem; font: inherit; cursor: pointer; }
.g-tools button:hover { background: #333; }
.g-note { color: #999; font-size: .85rem; }
/* Justified rows: each photo grows in proportion to its shape; the filler keeps the last
   row from stretching. */
.jgrid { list-style: none; margin: 0; padding: 0 1rem; display: flex; flex-wrap: wrap; gap: 6px; }
.jgrid::after { content: ""; flex: 10 1 0; }
.jgrid li { position: relative; flex: var(--r) 1 calc(var(--r) * 220px); height: 220px; overflow: hidden; background: #222; }
.jgrid li a.lb { display: block; width: 100%; height: 100%; }
.jgrid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.jgrid li:hover img { transform: scale(1.03); }
.jgrid .dur { position: absolute; left: .4rem; bottom: .4rem; }
.jgrid .noimg { display: grid; place-items: center; height: 100%; color: #888; }
.jgrid .empty { flex: 1; height: auto; background: none; color: #999; padding: 2rem 0; }
.g-dl { position: absolute; right: .4rem; top: .4rem; background: rgb(0 0 0 / .55); color: #fff; border-radius: 6px; padding: .1rem .45rem; text-decoration: none; opacity: 0; transition: opacity .2s; }
.jgrid li:hover .g-dl, .g-dl:focus-visible { opacity: 1; }
@media (max-width: 40rem) {
  .jgrid { padding: 0 .4rem; gap: 4px; }
  .jgrid li { flex-basis: calc(var(--r) * 130px); height: 130px; }
  .g-title { padding: 3rem 1rem 1rem; }
  .g-dl { opacity: 1; }
}

/* --- The photo page: the photo as large as the window allows, cards beside it in the
   Folders style (rounded, lifted, small uppercase headings), tools under the photo. --- */
main:has(.viewer) { max-width: none; padding: .9rem 2rem 2.5rem; }
.viewer { --soft: color-mix(in srgb, var(--accent) 13%, var(--panel)); --lift: 0 1px 2px rgb(20 20 30 / .05), 0 8px 24px rgb(20 20 30 / .06);
  display: grid; grid-template-columns: minmax(0, 1fr) clamp(19rem, 24vw, 23rem); gap: 1.75rem; align-items: start; }
.stagecol { position: sticky; top: 4.2rem; min-width: 0; }
.stage { position: relative; display: flex; align-items: center; justify-content: center; height: calc(100vh - 10.5rem); min-height: 22rem; }
.stage:has(.noimg) { background: #16181b; border-radius: 18px; }
.frame img, .frame video { max-width: 100%; max-height: calc(100vh - 10.5rem); display: block; border-radius: 14px; box-shadow: 0 2px 6px rgb(20 20 30 / .10), 0 18px 48px rgb(20 20 30 / .16); }
.frame video { background: #000; }
.stage .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.8rem; height: 2.8rem; border-radius: 50%; display: grid; place-items: center; z-index: 2;
  font-size: 1.9rem; line-height: 1; padding-bottom: .2rem; color: #fff; background: rgb(15 17 20 / .45); backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s, background .15s; text-decoration: none; }
.stage:hover .nav, .stage .nav:focus-visible { opacity: 1; }
.stage .nav:hover { background: rgb(15 17 20 / .7); }
.stage .prev { left: .8rem; } .stage .next { right: .8rem; }
@media (hover: none) { .stage .nav { opacity: .8; } }

.phototools { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; margin-top: .9rem; }
.tool { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .95rem; border-radius: 999px; border: 0; background: var(--panel); color: var(--ink);
  font: inherit; font-size: .86rem; font-weight: 550; box-shadow: var(--lift); cursor: pointer; }
.tool:hover { background: var(--soft); color: var(--accent); text-decoration: none; }
.tool .i, .iconbtn .i, .sharesheet h3 .i { flex: none; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { background: var(--soft); color: var(--accent); }
.menu-pop { position: absolute; bottom: calc(100% + .45rem); left: 50%; transform: translateX(-50%); z-index: 6; min-width: 13rem; padding: .35rem;
  background: var(--panel); border-radius: 14px; box-shadow: 0 10px 34px rgb(20 20 30 / .22); display: grid; }
.menu-pop a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem .7rem; border-radius: 9px; color: var(--ink); font-weight: 550; font-size: .9rem; }
.menu-pop a:hover { background: var(--soft); color: var(--accent); text-decoration: none; }
.menu-pop small { color: var(--muted); font-weight: 400; font-size: .78rem; }

.info .card { background: var(--panel); border-radius: 18px; padding: 1rem 1.1rem 1.05rem; margin-bottom: 1rem; box-shadow: var(--lift); }
.info h2 { margin: 0 0 .6rem; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: baseline; }
.info h2 .link { text-transform: none; letter-spacing: 0; font-size: .8rem; font-weight: 500; }
/* The photo's card: its name first, then its date with icons for changing it and for its history. */
.info .filename { margin: 0 0 .45rem; font-size: 1.3rem; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; overflow-wrap: anywhere; }
.info .when { display: flex; flex-wrap: wrap; align-items: center; gap: .15rem .5rem; margin: 0 0 .5rem; }
.info .when .date { display: inline-flex; align-items: center; gap: .4rem; font-size: 1rem; font-weight: 600; }
.info .when .date .i { color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--accent); cursor: pointer; }
.icon-btn:hover, .icon-btn[aria-expanded=true] { border-color: var(--line); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.info .datefix { margin: 0 0 .6rem; }
.info .datefix[hidden] { display: none; }
.facts { display: grid; grid-template-columns: minmax(5.5rem, auto) 1fr; gap: .35rem .9rem; margin: .7rem 0 0; font-size: .86rem; }
.facts dd .badge { background: var(--soft); color: var(--accent); margin-left: .25rem; font-size: .7rem; }

/* Keyword and place pills: crisp, compact, several to a line; each one a link. */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.tag { display: inline-flex; align-items: baseline; gap: .3rem; max-width: 100%; padding: .2rem .6rem; border-radius: 7px; font-size: .82rem; line-height: 1.35;
  background: var(--soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); }
.tag:hover { text-decoration: none; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.tag .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag .up { font-weight: 450; opacity: .7; white-space: nowrap; }
.inalbums .tag { font-size: .85rem; }
.tags li { display: inline-flex; align-items: center; gap: .1rem; max-width: 100%; }
.tags li form { display: inline; margin: 0; }
.untag { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 .25rem; font-size: 1rem; line-height: 1; }
.untag:hover { color: var(--undated); }
.about .title { margin: 0 0 .3rem; font-weight: 600; overflow-wrap: anywhere; }
.about .caption { margin: 0 0 .3rem; font-size: .9rem; overflow-wrap: anywhere; }
.about .stars { margin: 0; color: var(--accent); letter-spacing: .1em; }
.aboutform { display: grid; gap: .5rem; margin-top: .6rem; }
.aboutform label { display: grid; gap: .2rem; font-size: .82rem; color: var(--muted); }
.aboutform input[type=text], .aboutform textarea { width: 100%; font: inherit; }
.aboutform textarea { padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); resize: vertical; }
.aboutform button { justify-self: start; }
.addkeyword { margin-top: .5rem; }
.info .syncnote { margin: -.3rem 0 .8rem; font-size: .8rem; color: var(--muted); }

.location .minimap { height: 11rem; margin-top: .75rem; border-radius: 12px; overflow: hidden; }
.location .coords { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: .5rem 0 0; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Share: a sheet over the page. */
.sharesheet { border: 0; border-radius: 20px; padding: 0; width: min(46rem, calc(100vw - 2rem)); max-height: calc(100vh - 3rem); background: var(--panel); color: var(--ink);
  box-shadow: 0 24px 80px rgb(0 0 0 / .35); }
.sharesheet::backdrop { background: rgb(15 17 20 / .45); backdrop-filter: blur(3px); }
.sharesheet > header { display: flex; justify-content: space-between; align-items: center; padding: 1.1rem 1.3rem .2rem; }
.sharesheet > header h2 { margin: 0; font-size: 1.3rem; letter-spacing: -.02em; }
.sharesheet > section { padding: 1rem 1.3rem 1.2rem; }
.sharesheet > section + section { border-top: 1px solid var(--line); }
.sharesheet h3 { display: flex; gap: .45rem; align-items: center; margin: 0 0 .35rem; font-size: 1rem; }
.sharesheet .share-copy { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sharesheet .share-copy > div { flex: 1; min-width: 16rem; }
.sharesheet .share-copy p { margin: 0; font-size: .88rem; }
.sharesheet .shareform fieldset { border: 0; padding: 0; margin: .4rem 0 .6rem; display: flex; gap: .9rem; flex-wrap: wrap; }
.sharesheet .shareform legend { font-weight: 600; font-size: .85rem; margin-bottom: .3rem; }
.iconbtn { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; padding: 0; border-radius: 50%; border: 0; background: transparent; color: inherit; cursor: pointer; }
.iconbtn:hover { background: var(--bg); }

/* Full screen, and Compare (the original beside the edit, or under a divider). */
body.fs-open { overflow: hidden; }
.fs { position: fixed; inset: 0; z-index: 50; background: #0b0c0e; color: #eee; display: grid; grid-template-rows: 1fr auto; }
.fs[hidden] { display: none; }
.fs-stage { position: relative; min-height: 0; display: grid; place-items: center; padding: 1.2rem 4.5rem .4rem; }
.fs-one, .fs-pair figure { margin: 0; min-width: 0; min-height: 0; display: grid; place-items: center; height: 100%; width: 100%; }
.fs-one img, .fs-one video { max-width: 100%; max-height: calc(100vh - 5.5rem); object-fit: contain; display: block; }
.fs-one video { width: 100%; height: 100%; }
.fs-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%; height: 100%; }
.fs-pair[hidden], .fs-slide[hidden], .fs-one[hidden] { display: none; }
.fs-pair figure { grid-template-rows: 1fr auto; gap: .4rem; }
.fs-pair img { max-width: 100%; max-height: calc(100vh - 7.5rem); object-fit: contain; }
.fs-pair figcaption, .fs-tag { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #aaa; }
.fs-slide { --split: 50%; position: relative; max-height: calc(100vh - 5.5rem); cursor: ew-resize; touch-action: none; user-select: none; }
.fs-slide img { display: block; max-width: calc(100vw - 9rem); max-height: calc(100vh - 5.5rem); object-fit: contain; pointer-events: none; }
.fs-slide .over { position: absolute; inset: 0; width: 100%; height: 100%; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.fs-handle { position: absolute; top: 0; bottom: 0; left: var(--split); width: 0; outline: none; }
.fs-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 8px rgb(0 0 0 / .6); }
.fs-handle span { position: absolute; top: 50%; left: 0; width: 2.4rem; height: 2.4rem; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgb(0 0 0 / .5); }
.fs-handle span::before { content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center; color: #222; font-weight: 700; letter-spacing: .1em; }
.fs-handle:focus-visible span { outline: 3px solid var(--accent); }
.fs-tag { position: absolute; top: .6rem; padding: .2rem .55rem; border-radius: 6px; background: rgb(0 0 0 / .55); color: #fff; }
.fs-tag.left { left: .6rem; } .fs-tag.right { right: .6rem; }
.fs-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgb(255 255 255 / .08); color: #fff; font-size: 2rem; line-height: 1; padding-bottom: .2rem; cursor: pointer; }
.fs-nav:hover { background: rgb(255 255 255 / .18); }
.fs-nav[hidden] { display: none; }
.fs-prev { left: 1rem; } .fs-next { right: 1rem; }
.fs-bar { display: flex; align-items: center; gap: 1rem; padding: .5rem 1rem .7rem; }
.fs-name { flex: 1; min-width: 0; font-size: .85rem; color: #aaa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-modes { display: inline-flex; padding: .2rem; border-radius: 999px; background: rgb(255 255 255 / .08); }
.fs-modes[hidden] { display: none; }
.fs-modes button { display: inline-flex; align-items: center; gap: .3rem; border: 0; border-radius: 999px; padding: .3rem .8rem; background: transparent; color: #ccc; font-size: .82rem; font-weight: 550; }
.fs-modes button[aria-pressed="true"] { background: #fff; color: #111; }
.fs .iconbtn { color: #ddd; } .fs .iconbtn:hover { background: rgb(255 255 255 / .12); }

@media (max-width: 960px) {
  main:has(.viewer) { padding: .8rem 1rem 2rem; }
  .viewer { grid-template-columns: 1fr; }
  .stagecol { position: static; }
  .stage { height: auto; min-height: 0; }
  .frame img, .frame video { max-height: 75vh; }
  .fs-stage { padding: .6rem .6rem .2rem; }
  .fs-nav { width: 2.4rem; height: 2.4rem; background: rgb(0 0 0 / .4); }
  .fs-prev { left: .4rem; } .fs-next { right: .4rem; }
  .fs-pair { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .stage .nav { transition: none; } }
/* A shared photo (a photo's own share link): just the photo. */
.gallery.single { display: grid; justify-items: center; gap: .8rem; padding-top: .5rem; }
.gallery.single img, .gallery.single video { max-width: 100%; max-height: calc(100vh - 8rem); border-radius: 14px; box-shadow: 0 18px 48px rgb(20 20 30 / .18); }
.gallery.single .single-meta { display: flex; gap: 1.2rem; color: var(--muted); margin: 0; }

/* --- Setting a location: clues beside a search box and a map, the pick in a bar below --- */
main:has(.locate) { max-width: 96rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.locate { display: grid; grid-template-columns: minmax(17rem, 24rem) minmax(0, 1fr); gap: 1rem; align-items: start; }
.locate .panel { margin-bottom: 1rem; }
.locate .hint { font-size: .85rem; margin: .45rem 0; }
.locate-photo { padding: 0; overflow: hidden; }
.locate-photo img { display: block; width: 100%; max-height: 15rem; object-fit: cover; background: var(--none-bg); }
.locate-photo p { margin: 0; padding: .6rem .8rem; }
/* Who gets the location: three choices in a row, and the photos themselves in a strip to pick from. */
.locate-who { margin-bottom: 1rem; }
.who { display: flex; flex-wrap: wrap; gap: .5rem .6rem; align-items: center; }
.scope-h { margin: 0 .3rem 0 0; font-weight: 600; }
.seg { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg > span { display: inline-block; padding: .4rem .95rem; border: 1px solid var(--muted); border-radius: 999px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:disabled + span { opacity: .55; cursor: default; border-color: var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.who .sub { margin-left: .4rem; }
.who .hint { margin: 0 0 0 auto; font-size: .85rem; }
.strip { display: flex; gap: .5rem; overflow-x: auto; margin-top: .7rem; padding: .15rem .1rem .5rem; scroll-padding-inline: 4rem; }
.strip button { position: relative; flex: none; width: 5.4rem; height: 5.4rem; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--none-bg); cursor: pointer; }
.strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.strip .flag { position: absolute; top: .25rem; right: .25rem; display: grid; place-items: center; width: 1.35rem; height: 1.35rem; border-radius: 999px; background: rgb(0 0 0 / .62); color: #ffc65c; }
.strip .placed .flag { color: #a6e0b0; }
.strip .flag svg { width: .85rem; height: .85rem; }
.strip[data-scope=missing] .placed, .strip[data-scope=selected] button:not([aria-pressed=true]) { opacity: .45; }
.strip button[aria-pressed=true] { outline: 3px solid var(--accent); outline-offset: -3px; }
.strip button:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.locate-who ~ .locate .locate-map { height: calc(100vh - 29rem); }
.locate-bar .done { color: var(--ok); font-size: .9rem; }
.locate-bar .done.warn { color: var(--warn); }
.clues h2 { margin: 0 0 .2rem; }
.clues h3 { margin: .9rem 0 .35rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.clues .chips { margin: 0; }
.clues .chip { min-height: 2.4rem; }
.clues .chip:hover, .spot:hover { border-color: var(--accent); }
.spot { display: flex; gap: .65rem; align-items: center; width: 100%; text-align: left; padding: .45rem; border-radius: 8px; margin-bottom: .35rem; }
.spot img { flex: none; width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 6px; background: var(--none-bg); }
.locate-search { position: relative; z-index: 1001; }  /* above Leaflet's controls */
.locate-search input[type=search] { width: 100%; font: inherit; padding: .7rem .9rem; border: 1px solid var(--muted); border-radius: 8px; background: var(--panel); color: var(--ink); }
.locate-results:empty { display: none; }
.locate-results { position: absolute; left: 0; right: 0; top: calc(100% + .3rem); background: var(--panel); border: 1px solid var(--muted); border-radius: 8px; box-shadow: 0 8px 24px rgb(20 20 30 / .16); overflow: hidden; }
.locate-results .hits { list-style: none; margin: 0; padding: 0; }
.locate-results .hit { display: flex; gap: .75rem; align-items: baseline; width: 100%; min-height: 2.9rem; text-align: left; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); padding: .5rem .8rem; }
.locate-results li:last-child .hit { border-bottom: 0; }
.locate-results .hit:hover { background: color-mix(in srgb, var(--accent) 9%, var(--panel)); }
.locate-results .kind { flex: none; width: 7.5rem; font-size: .78rem; font-weight: 600; color: var(--sugg); }
.locate-results .note { margin: 0; padding: .7rem .8rem; color: var(--muted); }
.locate-map { height: calc(100vh - 21rem); min-height: 24rem; cursor: crosshair; }
.droppin { background: none; border: 0; }
.droppin::before { content: ""; position: absolute; left: 1px; top: 0; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #c2410c; border: 2px solid #fff; box-shadow: 0 2px 5px rgb(0 0 0 / .45); box-sizing: border-box; }
.droppin::after { content: ""; position: absolute; left: 10px; top: 9px; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.peek { position: fixed; z-index: 1100; pointer-events: none; padding: .4rem; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 10px 34px rgb(20 20 30 / .32); }
.peek img { display: block; width: min(30rem, 44vw, 70vh); aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #16181c center / contain no-repeat; }
.peek.pile { pointer-events: auto; }
.peek .grid { display: grid; grid-template-columns: repeat(3, min(10rem, 14vw)); gap: .3rem; max-height: min(26rem, 60vh); overflow-y: auto; overscroll-behavior: contain; }
.peek .grid button { padding: 0; border: 0; border-radius: 6px; background: none; cursor: pointer; }
.peek .grid button:hover, .peek .grid button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.peek .grid img { width: 100%; object-fit: cover; }
.peek p { grid-column: 1 / -1; margin: .4rem .3rem .15rem; font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; max-width: min(30rem, 44vw, 70vh); }
.locate-bar { display: flex; flex-wrap: wrap; gap: .8rem 2rem; align-items: center; position: sticky; bottom: .75rem; z-index: 1002; box-shadow: 0 4px 18px rgb(20 20 30 / .14); }
.locate-bar .was, .locate-bar .now { display: flex; flex-direction: column; min-width: 10rem; }
.locate-bar .now { flex: 1; font-variant-numeric: tabular-nums; }
.locate-bar .k { font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.locate-bar .muted { font-size: .85rem; }
.locate-bar .go { display: flex; gap: .6rem 1rem; align-items: center; flex-wrap: wrap; }
.locate-bar .go .btn, .locate-bar .go button.primary { padding: .55rem 1.1rem; font-weight: 600; }
.locate-bar .go .btn { font-weight: 500; }
.locate-bar .go .btn:hover { text-decoration: none; border-color: var(--muted); }
.locate-bar button:disabled { opacity: .5; cursor: default; }
.location .placename { margin: .6rem 0 0; font-weight: 600; }
.location .placename + .coords { margin-top: .1rem; }
.location .setnote { margin: .5rem 0 .2rem; font-size: .8rem; color: var(--muted); }
.location form { margin: 0; font-size: .85rem; }
.pagehead .pill + .pill { margin-left: -.4rem; }
@media (max-width: 860px) {
  .locate { grid-template-columns: 1fr; }
  .locate-map { height: 60vh; }
}

/* The top bar's Curation menu. */
details.menu { position: relative; }
details.menu > summary { cursor: pointer; list-style: none; color: var(--accent); }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu > summary::after { content: " ▾"; font-size: .8em; }
.menu-items { position: absolute; top: calc(100% + .5rem); left: -.75rem; min-width: 19rem; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .35rem; box-shadow: 0 8px 24px rgb(0 0 0 / .14); display: grid; z-index: 6; }
.menu-items a { padding: .45rem .6rem; border-radius: 6px; font-weight: 600; }
.menu-items a:hover { background: var(--none-bg); text-decoration: none; }
.menu-items a span { display: block; font-weight: 400; font-size: .82rem; color: var(--muted); }
/* The account menu sits at the right edge, so it opens leftwards. */
details.menu.account .menu-items { left: auto; right: -.5rem; min-width: 17rem; }
.menu-items form { margin: 0; }
.menu-items form button.link { width: 100%; text-align: left; padding: .45rem .6rem; border-radius: 6px; font-weight: 600; }
.menu-items form button.link:hover { background: var(--none-bg); text-decoration: none; }
/* The Lightroom plugin page. */
a.button { display: inline-block; padding: .55rem 1rem; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 600; }
a.button:hover { text-decoration: none; filter: brightness(1.08); }
ol.steps { max-width: 52rem; padding-left: 1.3rem; display: grid; gap: .35rem; }
p.notice { max-width: 52rem; padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
p.hint { color: var(--muted); font-size: .88rem; max-width: 52rem; }
/* Date issues. */
.issues .parts { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.issues .parts .quiet { color: var(--muted); }
table.redate img { height: 48px; width: auto; max-width: 72px; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-left: .4rem; }
table.redate .tick { white-space: nowrap; }
table.redate .tick input { width: 1.05rem; height: 1.05rem; vertical-align: middle; }
table.redate .where { display: block; font-size: .82rem; }
table.redate .warn-mark { color: var(--warn); }
.history { list-style: none; margin: .4rem 0 0; padding: 0; font-size: .85rem; color: var(--muted); }
/* The face editor's "looks like someone you've already named". */
.lookalikes { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .35rem; }
.lookalikes li { display: flex; align-items: center; gap: .6rem; }
.lookalikes img, .lookalikes .noface { width: 2.6rem; height: 2.6rem; border-radius: 50%; object-fit: cover; flex: none; }
.lookalikes .who { flex: 1; min-width: 0; font-size: .9rem; }
.lookalikes .how { display: block; font-size: .8rem; color: var(--muted); }

/* An "Info" tag beside a term, and the explanation it pops up (_smart_info.html). */
.info-tag { display: inline-block; vertical-align: baseline; padding: .05rem .5rem; border: 1px solid var(--accent); border-radius: 999px; background: none; color: var(--accent); font: inherit; font-size: .75rem; font-weight: 600; line-height: 1.4; cursor: pointer; }
.info-tag::before { content: "i"; display: inline-grid; place-items: center; width: 1em; height: 1em; margin-right: .3em; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: .85em; font-style: italic; font-family: Georgia, serif; }
.info-tag:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.info-pop { width: min(32rem, calc(100vw - 2rem)); max-height: calc(100vh - 4rem); overflow-y: auto; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); font-size: .92rem; font-weight: 400; box-shadow: 0 12px 40px rgb(20 20 30 / .3); }
.info-pop::backdrop { background: rgb(0 0 0 / .25); }
.info-pop h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.info-pop ul { margin: .5rem 0; padding-left: 1.1rem; }
.info-pop li { margin-bottom: .35rem; }
.info-pop p { margin: .5rem 0 0; }
