/* The colors: light, and dark when the computer or phone is set to dark (prefers-color-scheme) unless light is
   chosen in this browser, or when dark is chosen (the round button → Colors puts data-theme on <html>; theme.js does
   it again before each page is drawn). The dark ones are written twice, once for each way in: a color added here goes in all
   three blocks. */
:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a64;
  --line: #e2e0da;     /* separators and panels' edges: decoration */
  --edge: #8a8984;     /* what can be clicked or typed in: buttons, boxes, the tree's lines (3:1 on the page) */
  --accent: #2f62c9;
  --on-accent: #fff;   /* words on the accent color */
  --tile: #e8e6e0;
  --stage: #111110;
  --danger: #b42318;
  --keep: #1f7a3f;
  --ours: #c26a1b;     /* storage: LineageBox's own files (photos and videos are --accent) */
  --other: #a3a29b;    /* storage: other files on the disk */
  --removed: #c4477a;  /* storage: files in the Removed folders */
  --header-h: 46px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;
    --surface: #1c1c1a;
    --text: #ecebe5;
    --muted: #9b9a93;
    --line: #2e2d2a;
    --edge: #6e6d69;
    --accent: #82a8f5;
    --on-accent: #10131a;  /* white on this light blue is 2.4:1; near-black is 7.8:1 */
    --tile: #262523;
    --stage: #0b0b0a;
    --danger: #e5534b;
    --keep: #4ac26b;
    --ours: #e8a05c;
    --other: #5d5c57;
    --removed: #e27ba6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141413;
  --surface: #1c1c1a;
  --text: #ecebe5;
  --muted: #9b9a93;
  --line: #2e2d2a;
  --edge: #6e6d69;
  --accent: #82a8f5;
  --on-accent: #10131a;
  --tile: #262523;
  --stage: #0b0b0a;
  --danger: #e5534b;
  --keep: #4ac26b;
  --ours: #e8a05c;
  --other: #5d5c57;
  --removed: #e27ba6;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* 1rem: the browser's own text size, so making text bigger there (or on the phone) makes it bigger here */
body { margin: 0; background: var(--bg); color: var(--text); font: 1rem/1.5 system-ui, "Segoe UI", sans-serif; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 8px;
        background: var(--accent); color: var(--on-accent); }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
main:focus { outline: none; }  /* reached by the skip link: the page itself needs no ring */
/* a message at the foot of the page (app.js notice()): what went wrong, or what was done, with Undo. It slides up
   as it comes, so that a change made at the foot of a long list is noticed. */
#notice { position: fixed; left: 50%; bottom: 16px; z-index: 60; transform: translateX(-50%); display: flex;
          align-items: center; gap: 10px; width: max-content; max-width: min(680px, calc(100vw - 32px));
          padding: 12px 14px 12px 16px; border-radius: 10px; background: var(--text); color: var(--bg);
          font-size: 1.05rem; box-shadow: 0 10px 28px rgb(0 0 0 / .35); animation: notice-in .22s ease-out; }
#notice[hidden] { display: none; }
#notice.error { background: var(--danger); color: #fff; }
#notice span { overflow-wrap: anywhere; }
/* the round mark: a tick for what was done, ! for what went wrong */
#notice .mark { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
                background: var(--keep); color: var(--bg); font-weight: 700; }
#notice.error .mark { background: #fff; color: var(--danger); }
#notice button { flex: none; background: none; color: inherit; border-color: currentColor; }
#notice button.close { border: 0; font-size: 1.2rem; padding: 0 6px; }
@keyframes notice-in { from { opacity: 0; transform: translate(-50%, 14px); } }
@media (prefers-reduced-motion: reduce) { #notice { animation: none; } }
@media (max-width: 760px) { .viewer-page #notice { bottom: 80px; } }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: .9em; }

.top { position: sticky; top: 0; z-index: 10; height: var(--header-h); display: flex; align-items: center; gap: 28px;
       padding: 0 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); letter-spacing: .02em; }
/* ☰: on a phone, opens the menu at the side over the page (.side.open) */
.menu-button { flex: none; display: none; place-items: center; width: 34px; height: 34px; padding: 0; }
/* who is signed in: the round button with their initials, Sign out under it, and how the site looks; without
   accounts a plain button with the latter alone */
.profile { position: relative; flex: none; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%;
          border-color: var(--accent); background: var(--accent); color: var(--on-accent); font-size: .8rem; font-weight: 600; }
.looks-button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; }

/* The menu at the side (_side_menu.html): every page, in sections, beside the page and in sight as it scrolls. The
   button at its foot shows its icons only (data-side="icons" on <html>, theme.js); on a phone it is hidden, and ☰
   opens it over the page. */
.shell { display: flex; align-items: flex-start; }
.shell > main { flex: 1 1 auto; min-width: 0; }
.side { position: sticky; top: var(--header-h); flex: none; width: 216px; height: calc(100dvh - var(--header-h));
        box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; padding: 10px; overflow-y: auto;
        overscroll-behavior: contain; background: var(--surface); border-right: 1px solid var(--line); }
/* a laptop's screen holds the whole of it (fourteen pages, five headings, Add photos and the switch at its foot) */
.side a, .side-toggle { display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 0 10px;
                        border-radius: 8px; color: var(--text); white-space: nowrap; }
.side a:hover, .side-toggle:hover { background: var(--bg); text-decoration: none; }
.side a[aria-current] { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); font-weight: 600; }
.side svg { flex: none; }
.side svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.side-group { display: grid; gap: 1px; padding-bottom: 6px; }
.side-heading { padding: 4px 10px 1px; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .04em;
                text-transform: uppercase; }
.side a.side-add { justify-content: center; gap: 8px; min-height: 38px; margin-bottom: 8px; border-radius: 999px;
                   background: var(--accent); color: var(--on-accent); font-weight: 600; }
.side a.side-add:hover, .side a.side-add[aria-current] { background: var(--accent); filter: brightness(1.1); }
.side a.side-add svg path { stroke-width: 2; }
.side-toggle { margin-top: auto; border: 0; background: none; color: var(--muted); font: inherit; font-size: .9rem; }
@media (min-width: 761px) {
  :root[data-side="icons"] .side { width: 64px; }
  :root[data-side="icons"] .side-heading { display: none; }
  :root[data-side="icons"] .side .label { position: absolute; width: 1px; height: 1px; overflow: hidden;
                                          clip-path: inset(50%); white-space: nowrap; }
  :root[data-side="icons"] .side a.side-add { padding: 0; }
  :root[data-side="icons"] .side-toggle svg { transform: scaleX(-1); }
}
body.immersive .side { display: none; }
.profile-menu { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 20; width: max-content;
                min-width: 220px; max-width: calc(100vw - 32px); padding: 12px 14px; gap: 8px; justify-items: start;
                background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
                box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.profile-menu.open { display: grid; }
.profile-menu .who { display: grid; gap: 2px; margin: 0 0 4px; overflow-wrap: anywhere; }

main { padding: 16px 24px 48px; max-width: 1800px; margin: 0 auto; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 28px 0 10px; }
h2 small, .months small { color: var(--muted); font-weight: 400; }
.meta { color: var(--muted); margin: 4px 0 16px; font-size: .9rem; }
.note { background: var(--surface); border: 1px solid var(--line); padding: 10px 14px; border-radius: 8px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 4px 0; }
.crumbs .sep { color: var(--muted); }
.pager { margin-left: auto; display: flex; gap: 18px; }

/* folders */
.folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.folder-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
               overflow: hidden; color: var(--text); }
.folder-card:hover { text-decoration: none; border-color: var(--accent); }
.folder-card img, .folder-card .ph { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--tile); }
.folder-card .label { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; font-size: .9rem; }
.folder-card .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.folder-card .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.folder-card.ignored { opacity: .5; }

/* photo grid */
/* Photo tiles, as chosen in this browser (the round button → Photo tiles; theme.js puts them on <html> before the
   page is drawn): Small, Medium or Large (data-tile-size; Medium is none), squares, or Whole photos
   (data-tiles="whole"): rows of photos in their own shapes (--r, from tiles.tile_shapes), each row filled out. A square's crop is
   aimed at the faces in it (object-position, set on each tile). Two fingers pinched over the photos on a touch screen
   make them larger or smaller (app.js), so the page itself doesn't zoom there. Home's photos by the day follow the
   same choices (.day-tiles, --day-row: their rows of whole photos, a little higher than a list's). */
:root { --tile-min: 150px; --tile-row: 170px; --day-row: 190px; }
:root[data-tile-size="s"] { --tile-min: 104px; --tile-row: 120px; --day-row: 130px; }
:root[data-tile-size="l"] { --tile-min: 230px; --tile-row: 260px; --day-row: 270px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile-min), 1fr)); gap: 4px;
        touch-action: pan-x pan-y; }
.tile { position: relative; display: block; aspect-ratio: 1; background: var(--tile); overflow: hidden; border-radius: 3px; }
.tile img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .15s; }
.tile:hover img { transform: scale(1.03); }
:root[data-tiles="whole"] .grid { display: flex; flex-wrap: wrap; }
:root[data-tiles="whole"] .grid > .tile { flex: var(--r, 1) 0 auto; width: calc(var(--tile-row) * var(--r, 1));
  max-width: 100%; height: var(--tile-row); aspect-ratio: auto; }
:root[data-tiles="whole"] .grid::after { content: ""; flex-grow: 1000; margin-left: -4px; }  /* the last row isn't stretched */
.badge { position: absolute; right: 4px; bottom: 4px; padding: 2px 5px; border-radius: 4px; font-size: .72rem; line-height: 1.2;
         background: rgba(0, 0, 0, .55); color: #fff; }
.badge.video { left: 4px; right: auto; font-variant-numeric: tabular-nums; }

/* timeline */
.years { display: grid; gap: 6px; max-width: 760px; }
.year { display: grid; grid-template-columns: 56px 1fr 72px; align-items: end; gap: 14px; padding: 8px 12px;
        background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.year:hover { text-decoration: none; border-color: var(--accent); }
.year .y { font-weight: 600; font-variant-numeric: tabular-nums; }
.year .n { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; height: 28px; align-items: end; }
.bars i { display: block; height: max(var(--h), 2px); background: var(--accent); border-radius: 2px 2px 0 0; }
.bars i.z { background: var(--line); }
/* each year's events (data-glance): the two latest unfolded, the others floating while the year is pointed at */
.year-glance { position: relative; min-width: 0; }  /* a grid item: its events' row scrolls, not the page */
.year-glance > summary { display: flex; align-items: stretch; gap: 6px; list-style: none; }
.year-glance > summary > .year { flex: 1; min-width: 0; }
/* a tap on Events folds the year's events out or in (the year itself opens its page): no pointing needed */
.events-toggle { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--edge); border-radius: 8px;
                 background: var(--surface); color: var(--muted); font-size: .85rem; cursor: pointer; min-width: 44px; }
.year-glance[open] > summary .events-toggle { color: var(--text); border-color: var(--accent); }
.year-glance > summary::-webkit-details-marker { display: none; }
.year-glance[open]:not(.glancing) > .year-events { padding: 10px 0 8px; }
.year-glance[open] > .year-events:has(> .loading) { min-height: 140px; }  /* the row's room, kept while it loads */
.year-glance.glancing > .year-events { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0;
  width: min(960px, calc(100vw - 48px)); max-height: min(60vh, 520px); overflow: auto; padding: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgb(0 0 0 / .18); }
.year-glance .year-events .hint { margin: 0; }
.events-wrap { position: relative; }
.year-events-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
  padding-bottom: 6px; }
.event-card { position: relative; flex: 0 0 176px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 10px;
  background: var(--tile); color: #fff; scroll-snap-align: start; }
.event-card img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.event-card:hover { text-decoration: none; }
.event-card:hover img { transform: scale(1.04); }
.event-text { position: absolute; inset: auto 0 0; display: grid; gap: 1px; padding: 24px 10px 8px;
  background: linear-gradient(transparent, rgb(0 0 0 / .75)); }
.event-text b { font-size: .92rem; font-weight: 600; line-height: 1.2; }
.event-text span { font-size: .74rem; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.year-events-here { margin: 8px 0 4px; }
@media (max-width: 760px) { .event-card { flex-basis: 44vw; } .events-wrap .scroll { display: none; } }
.months { position: sticky; top: var(--header-h); z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 16px;
          padding: 8px 0; margin: 8px 0; background: var(--bg); }
h2[id] { scroll-margin-top: calc(var(--header-h) + 56px); }

/* photo view */
.viewer-page main { max-width: none; padding: 0; }
.viewer { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: calc(100dvh - var(--header-h)); }
.stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden;
         background: var(--stage); }
/* what is zoomed and moved (app.js): the picture with the faces over it, the size of the stage */
.zoom { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform-origin: 0 0; }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.viewer.zoomed .stage { cursor: grab; }
.stage-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
             padding: 8px 10px; background: linear-gradient(rgb(0 0 0 / .55), transparent); color: #fff; }
.stage-bar .spacer { flex: 1; }
.stage-bar .count { font-size: .88rem; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.stage-button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px;
                padding: 4px 12px; border: 0; border-radius: 8px; background: rgb(0 0 0 / .45); color: #fff;
                font-size: 1rem; }
.stage-button:hover { text-decoration: none; background: rgb(0 0 0 / .7); }
.stage-button[aria-pressed="false"] { opacity: .65; }
/* the faces found on the photo: one clicked or tapped is named in the details */
.stage video.live { position: absolute; z-index: 1; object-fit: contain; background: none; }
.face-boxes { position: absolute; pointer-events: none; }
.face-boxes.off { display: none; }
.face-box { position: absolute; min-height: 0; padding: 0; border: 2px solid rgb(255 255 255 / .9); border-radius: 6px;
            background: none; box-shadow: 0 0 0 1px rgb(0 0 0 / .45); pointer-events: auto; cursor: pointer; }
.face-box.unnamed { border-style: dashed; border-color: #ffd34d; }
.face-box:hover, .face-box:focus-visible { border-color: #fff; background: rgb(255 255 255 / .12); }
.face-box span { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 3px); padding: 1px 6px;
                 border-radius: 4px; background: rgb(0 0 0 / .7); color: #fff; font-size: .75rem; white-space: nowrap; }
.face-row.lit { background: color-mix(in srgb, var(--accent) 16%, transparent); border-radius: 8px; transition: background .3s; }
/* only the photo: a tap on it on a phone, ⛶, or v; Esc or another tap brings the rest back */
body.immersive .top, body.immersive .stage-bar, body.immersive .step, body.immersive .face-boxes,
body.immersive .info, body.immersive .see-as, body.immersive .demo-note { display: none; }
body.immersive .viewer { height: 100dvh; grid-template-columns: minmax(0, 1fr); }
.sheet-handle { display: none; }
.wide-only { display: inline; }
.stage .note { margin: 24px; }
.stage video { max-width: 100%; max-height: 100%; background: #000; }
.stage .note.overlay { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; }
.step { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center;
        width: 48px; height: 72px; border-radius: 6px; font-size: 42px; color: #fff; background: rgba(0, 0, 0, .55); opacity: .75; }
.step:hover { opacity: 1; text-decoration: none; }
.step.prev { left: 10px; }
.step.next { right: 10px; }
.info { overflow: auto; padding: 14px 18px; background: var(--surface); border-left: 1px solid var(--line); }
.info-head { display: flex; justify-content: space-between; align-items: baseline; }
.info-head .meta { margin: 0; }
.info dl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 18px 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.hint { display: block; color: var(--muted); font-size: .82rem; }
.files { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.files li { font-size: .88rem; }
.files .path { word-break: break-all; }
.files .actions { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.files button { font-size: .85rem; color: var(--accent); background: none; padding: 2px 8px; }
.files .missing .path { color: var(--muted); text-decoration: line-through; }
.keys { margin-top: 24px; }
.ai { margin: 14px 0 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.ai .caption { font-size: 1.02rem; margin: 0 0 10px; }
.ai .caption.second { font-size: .92rem; color: var(--muted); }  /* under the family's own caption */
/* the family's words: the caption, then comments */
.photo-words { margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.photo-words .said { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.family-caption .said { font-size: 1.1rem; }
.photo-words .hint { margin: 2px 0 8px; }
.words-form { display: grid; gap: 6px; justify-items: start; margin: 6px 0; }
.words-form textarea { width: 100%; min-height: 3.2em; font: inherit; padding: 6px 8px; border-radius: 8px;
                       border: 1px solid var(--edge); background: var(--bg); color: var(--text); resize: vertical; }
.comments { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.comments li { padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.comment-add summary { color: var(--accent); cursor: pointer; margin: 6px 0; }
button.link { padding: 0 2px; border: 0; background: none; color: var(--accent); font-size: inherit; min-height: 0; }
button.link:hover { text-decoration: underline; }
.ai dl { margin: 8px 0; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--tile); color: var(--text); }
.tag:hover { text-decoration: none; background: var(--line); }
.similar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.similar img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }

/* people */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin: 12px 0; }
.person-card { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; background: var(--surface);
               border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-align: center; }
.person-card:hover { text-decoration: none; border-color: var(--accent); }
.person-card img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.person-card .name { font-weight: 600; }
.person-card .count { color: var(--muted); font-size: .85rem; }
.group { padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.faces { display: flex; flex-wrap: wrap; gap: 4px; }
.faces img { display: block; width: 80px; height: 80px; border-radius: 6px; object-fit: cover; background: var(--tile); }
.faces.review .face { position: relative; }
.faces.review button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; padding: 0; border: 0;
                       border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; line-height: 1; }
.together .group-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.together .who { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.together .pick:has(input:checked) img { outline: none; opacity: 1; }  /* ticked: them */
.together .pick:has(input:not(:checked)) img { outline: 3px solid var(--danger); outline-offset: -3px; opacity: .35; }
.more-faces summary { margin: 4px 0; color: var(--muted); font-size: .88rem; cursor: pointer; }
.name-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.name-form .size { color: var(--muted); font-size: .88rem; min-width: 150px; }
.name-form input, .name-form select { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
                   background: var(--bg); color: var(--text); width: 200px; }
.name-form.compact { margin: 0; }
.name-form.compact input { width: 150px; padding: 2px 6px; font-size: .88rem; }
.date-form { margin-top: 4px; }
.face-row button.suggest { font-size: .85rem; padding: 2px 8px; }
.look-again { margin: 6px 0 0; }
.issues { list-style: none; padding: 0; margin: 0; }
.issues li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0;
             border-bottom: 1px solid var(--line); }
.issues .fixes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.issues .name-form { margin: 0; }
.name-form.date-form input { width: min(230px, 100%); }
button, .button { font: inherit; font-size: .9rem; padding: 4px 12px; border-radius: 6px; cursor: pointer;
                  border: 1px solid var(--edge); background: var(--surface); color: var(--text); }
/* boxes to type in or pick from show their edge at 3:1, whatever each kind's own rule says */
input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]), select, textarea {
  border-color: var(--edge); }
button:hover { border-color: var(--accent); }
button.primary, a.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.side a.update-ready { color: var(--accent); font-weight: 600; }
button.quiet, a.button.quiet { background: none; color: var(--muted); }
button:disabled { opacity: .5; cursor: wait; }
.hint.inline { display: inline; margin-left: 4px; }
.photo-people { margin: 12px 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.photo-people h2 { margin-top: 0; }
.face-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0; font-size: .9rem; }
.face-row button { white-space: nowrap; }
.face-row img { border-radius: 50%; object-fit: cover; flex: none; }
.face-row button { padding: 1px 8px; font-size: .8rem; margin-left: auto; }
.face-row .face-seek { margin: 0; padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.face-row .fix { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.face-row .fix button, .face-row .fix:not([hidden]) + button { margin-left: 0; }
/* video page: the frames faces and the description came from, and what was said; both jump the player */
.frame-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.frame-strip .frame { padding: 0; border: 0; background: var(--tile); cursor: pointer; aspect-ratio: 16 / 9;
                      overflow: hidden; border-radius: 3px; }
.frame-strip img { display: block; width: 100%; height: 100%; object-fit: cover; }
.transcript ol { list-style: none; padding: 0; margin: 0; max-height: 40vh; overflow-y: auto; font-size: .9rem; }
.transcript li { margin: 4px 0; }
.transcript .time { padding: 0 4px; margin-right: 4px; font-variant-numeric: tabular-nums; }

/* cleanup */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0; }
.card { display: grid; gap: 4px; align-content: start; padding: 14px; background: var(--surface);
        border: 1px solid var(--line); border-radius: 10px; color: var(--text); }
.card:hover { text-decoration: none; border-color: var(--accent); }
.card .num { font-size: 1.6rem; font-weight: 600; }
.card .num.loading { color: var(--muted); font-weight: 400; }
.cards > [data-later] { display: contents; }  /* a part loaded later (Cleanup's numbers): its cards are in the grid */
.card span:last-child { color: var(--muted); font-size: .88rem; }
.private-cards { grid-template-columns: minmax(0, 640px); margin-bottom: 0; }  /* Cleanup → Private papers, by itself */
.private-card.waiting { border: 2px solid var(--danger); }
.private-card.waiting .num { color: var(--danger); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0;
          margin-bottom: -1px; color: var(--muted); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a[aria-current] { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; }
.tabs small { font-weight: 400; color: var(--muted); }
.finish { display: flex; flex-wrap: wrap; gap: 12px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.finish-photo { position: relative; flex: 0 0 auto; }
.finish-photo img { width: 160px; height: 160px; object-fit: cover; border-radius: 8px; display: block; }
.finish-faces { flex: 1 1 320px; display: grid; gap: 6px; align-content: start; }
.finish-faces .hint { margin: 0 0 4px; }
.tile img.turn-90 { transform: rotate(90deg); }  /* Turned photos: shown the way they would be turned */
.tile img.turn-180 { transform: rotate(180deg); }
.tile img.turn-270 { transform: rotate(270deg); }
.pair { padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.pair p { margin: 8px 0; }
.samples { display: flex; gap: 4px; overflow: hidden; }
.samples img { display: block; height: 72px; width: auto; border-radius: 4px; background: var(--tile); }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* a folder's side of a pair (Duplicate copies): not .side, the menu at the side, whose rules took it over */
.copy-side { display: grid; gap: 4px; align-content: start; }
.copy-side button { justify-self: start; }
@media (max-width: 700px) { .sides { grid-template-columns: 1fr; } }
.similar { display: flex; flex-wrap: wrap; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.similar .pick { width: min-content; }  /* the caption wraps under the photo, so ↗ stays on it */
.similar .pick img { display: block; height: 160px; width: auto; max-width: none; border-radius: 6px; background: var(--tile); }
.similar .pick .meta { font-size: .8rem; }
.pick { position: relative; cursor: pointer; }
.pick input { position: absolute; top: 6px; left: 6px; z-index: 1; width: 20px; height: 20px; margin: 0; }
.pick:has(input:checked) img { outline: 3px solid var(--danger); outline-offset: -3px; opacity: .6; }
/* a photo the tick-photos bar has just changed (app.js bulkDone): it lights up green and settles back to ticked, so
   it is plain which photos the change was made to */
.pick.just-done img { animation: just-done 1.1s ease-out; }
@keyframes just-done {
  0%, 60% { outline: 3px solid var(--keep); outline-offset: -3px; opacity: 1; }
  100% { outline: 3px solid var(--danger); outline-offset: -3px; opacity: .6; }
}
@media (prefers-reduced-motion: reduce) { .pick.just-done img { animation: none; } }
.pick.keep:has(input:not(:checked)) img { outline: 3px solid var(--keep); outline-offset: -3px; }
.pick .open { position: absolute; top: 4px; right: 4px; z-index: 1; padding: 0 6px; border-radius: 4px;
              background: rgba(0, 0, 0, .55); color: #fff; }
.badge.wide { left: 4px; right: auto; max-width: calc(100% - 8px); overflow: hidden; text-overflow: ellipsis;
              white-space: nowrap; }
.badge.wide.why { white-space: normal; }  /* Private papers: why it looks private, on two lines if need be */
.select-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
              margin-top: 12px; padding: 10px 0; background: var(--bg); border-top: 1px solid var(--line); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.danger-zone { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }

.search { margin-left: auto; flex: 0 1 520px; min-width: 160px; }
.search input { width: 100%; font: inherit; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
                background: var(--bg); color: var(--text); }

/* status */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.stats section { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px 16px 14px; }
.stats h2 { margin-top: 14px; }
.stats dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

.similar .keep-all { align-self: center; }

/* status: live progress */
/* the Worker (and Downloads, while something downloads) in a column at the side, Work in progress beside them; one
   under the other on a narrow screen */
.progress-grid { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; gap: 16px;
                 margin: 16px 0; }
.progress-side { display: grid; gap: 16px; }
@media (max-width: 900px) { .progress-grid { grid-template-columns: minmax(0, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 2px 16px 14px; }
.panel h2 { margin-top: 14px; }
.panel h3 { font-size: .98rem; margin: 22px 0 6px; }
.panel dl { display: grid; grid-template-columns: fit-content(75%) minmax(0, 1fr); gap: 4px 16px; margin: 10px 0; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.state { font-weight: 600; margin: 8px 0; }
.state::before { content: ""; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%;
                 background: var(--muted); vertical-align: 1px; }
.state.busy::before { background: var(--keep); animation: pulse 1.6s ease-in-out infinite; }
.state.off::before { background: var(--danger); }
.state.on::before { background: var(--keep); }
.off { color: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .state.busy::before { animation: none; } }
.meter { height: 10px; border-radius: 999px; background: var(--tile); overflow: hidden; margin: 12px 0 6px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
/* Status → Work in progress: each kind of work's bar, how many of how many, and the time left at its pace */
.work { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px 28px; margin: 8px 0 12px;
  padding: 0; list-style: none; }
.work li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 2px 12px; }
.work .meter { grid-column: 1 / -1; height: 8px; margin: 2px 0; }
.work-numbers { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.work-eta { grid-column: 1 / -1; font-size: .9rem; }
.work li.done { color: var(--muted); }
.work li.done .meter i { background: var(--keep); }
.note.problem { border-left: 4px solid var(--danger); margin: 0 0 12px; }
ul.downloads { list-style: none; margin: 0; padding: 0; }
ul.downloads li { margin: 0 0 12px; }
ul.downloads .meter { margin: 6px 0 4px; }
.big { font-size: 1.6rem; font-weight: 600; margin: 4px 0; font-variant-numeric: tabular-nums; }
.big .hint { font-size: .9rem; font-weight: 400; }
.activity ol { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; }
.activity time { color: var(--muted); margin-right: 8px; font-variant-numeric: tabular-nums; }

/* settings */
/* Columns rather than grid rows, so a short panel leaves no gap beside a tall one. */
.settings { columns: 460px; column-gap: 16px; }
.settings > .panel { break-inside: avoid; margin: 0 0 16px; padding-top: 0; border-top: 3px solid var(--accent);
                     box-shadow: 0 1px 4px rgb(0 0 0 / .08); }
/* a tinted strip with a bigger heading on each panel, for the eye to go from one to the next */
.settings > .panel > h2 { font-size: 1.25rem; margin: 0 -16px 12px; padding: 11px 16px 9px; border-radius: 7px 7px 0 0;
                          background: color-mix(in srgb, var(--accent) 8%, var(--surface));
                          border-bottom: 1px solid var(--line); }
.settings input, .settings textarea { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
                                      background: var(--bg); color: var(--text); }
.settings input.num { width: 5.5em; }
.settings input.wide { width: min(100%, 22em); }
.settings textarea { display: block; width: 100%; margin: 6px 0; }
.settings #address input.wide { width: min(100%, 30em); }
.settings input[type=file] { border: 0; padding: 0; background: none; max-width: 100%; }
.settings .note { margin: 8px 0; }
.settings input[type=radio], .settings input[type=checkbox] { padding: 0; }
.settings fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0; }
.settings legend { color: var(--muted); padding: 0 4px; }
.settings .choice { display: block; margin: 6px 0; }
.settings .days { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 8px 26px; color: var(--muted); }
.settings .days label { color: var(--text); }
.watched, .browse { list-style: none; padding: 0; margin: 8px 0; }
.watched li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0;
              border-bottom: 1px solid var(--line); }
.watched li > span { display: grid; word-break: break-all; }
.browse { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.browse li { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-bottom: 1px solid var(--line); }
.browse li:last-child { border-bottom: 0; }
.browse li a { margin-right: auto; word-break: break-all; }
.browse button { padding: 1px 10px; font-size: .85rem; }
.inline-form { display: flex; gap: 8px; margin: 10px 0 4px; }
.inline-form input { flex: 1; min-width: 0; }

@media (max-width: 760px) {
  main { padding: 12px 16px 40px; }
  .top { padding: 0 16px; gap: 14px; }
  .top .brand { display: none; }
  .search { flex: 1 1 auto; min-width: 0; }
  .menu-button { display: grid; }
  .side { display: none; }
  .side.open { display: flex; position: fixed; top: var(--header-h); left: 0; bottom: 0; z-index: 30; width: min(280px, 85vw);
               height: auto; box-shadow: 0 8px 24px rgb(0 0 0 / .25); }
  .side-toggle { display: none; }
  :root { --tile-min: 100px; --tile-row: 120px; --day-row: 120px; }
  :root[data-tile-size="s"] { --tile-min: 72px; --tile-row: 84px; --day-row: 84px; }
  :root[data-tile-size="l"] { --tile-min: 160px; --tile-row: 190px; --day-row: 180px; }
  .folders { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  /* the photo fills the screen, and its details are a sheet at the foot: its handle (the caption or the date)
     shows, and a tap or a swipe up slides it up */
  .viewer { display: block; position: relative; height: calc(100dvh - var(--header-h)); }
  .stage { height: 100%; }
  .info { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; max-height: 82dvh; overflow: hidden;
          padding: 0 16px 24px; border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 24px rgb(0 0 0 / .35);
          transform: translateY(calc(100% - 64px)); transition: transform .25s ease; }
  .viewer.sheet-open .info { transform: none; overflow-y: auto; }
  .sheet-handle { position: sticky; top: 0; z-index: 1; display: grid; justify-items: center; gap: 6px; width: calc(100% + 32px);
                  margin: 0 -16px 8px; padding: 8px 16px 10px; border: 0; border-radius: 16px 16px 0 0;
                  background: var(--surface); color: var(--text); text-align: center; min-height: 64px; }
  .sheet-handle .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--edge); }
  .sheet-peek { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .95rem; }
  .viewer.sheet-open .sheet-peek { visibility: hidden; }
  .wide-only { display: none; }
  .stage .step { width: 40px; height: 64px; font-size: 34px; opacity: .55; }
  .stage .note.overlay { bottom: 76px; }
}

/* tags */
.tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 0 4px; }
.tag-filter input[type=search] { font: inherit; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line);
                                 background: var(--surface); color: var(--text); width: min(100%, 340px); }
.tag-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px 16px;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tag-list a { position: relative; display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px;
              border-radius: 6px; color: var(--text); overflow: hidden; }
.tag-list a:hover { text-decoration: none; background: var(--surface); }
.tag-list .name { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-list .count { position: relative; z-index: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.tag-list i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); opacity: .6; }
.tags.related { margin: 4px 0 14px; align-items: center; }

/* similar shots: kinds of group */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 6px; }
.filters a { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text);
             background: var(--surface); font-size: .9rem; }
.filters a span { color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.filters a:hover { text-decoration: none; border-color: var(--accent); }
.filters a[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.filters a[aria-current] span { color: inherit; opacity: .85; }
.filters a.empty { opacity: .5; }
.filters.small { align-items: center; color: var(--muted); font-size: .9rem; }
.bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }
.similar .pick .meta { display: block; max-width: 100%; }
.similar .pick .where { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.similar .pick .why { display: block; color: var(--danger); }
.similar .pick .keep-note { display: block; color: var(--keep); }

/* family: a person's relationships, the tree */
[hidden] { display: none !important; }
a.button { display: inline-block; color: var(--text); }
a.button:hover { text-decoration: none; border-color: var(--accent); }
.person-card .kin, .kin-badge { color: var(--muted); font-size: .8rem; }
.kin-badge { margin-left: 4px; padding: 1px 10px; border-radius: 999px; background: var(--tile); }
.family-panel, .events-panel { margin: 12px 0 8px; max-width: 980px; }
.family-panel summary, .events-panel > summary, .document-panel > summary, .info-panel > summary { cursor: pointer;
                                                                                                    padding: 12px 0 2px; }
.family-panel summary h2, .events-panel > summary h2, .document-panel > summary h2, .info-panel > summary h2 {
  display: inline; margin: 0; }
.family-panel input, .family-panel select, .events-panel input, .events-panel select, .document-panel input,
.document-panel select, .wizard input, .wizard select {
  font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.family-panel input[type=checkbox], .wizard input[type=checkbox], .wizard input[type=radio] { padding: 0; }
.facts, .links { display: grid; grid-template-columns: 84px 1fr; gap: 8px 14px; align-items: center; margin: 12px 0; }
.facts .label, .links dt { color: var(--muted); }
.links dd { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.link { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.link.former > a { color: var(--muted); }
.chip { padding: 2px 12px; border-radius: 999px; margin-right: 4px; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.inline-facts, .add-link, .family-panel .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.add-link { padding-top: 10px; border-top: 1px solid var(--line); }
button.x { padding: 0 5px; border: 0; background: none; color: var(--muted); font-size: 1.05rem; line-height: 1; }
button.x:hover { color: var(--danger); }
button.small { padding: 0 6px; font-size: .78rem; }
.tree-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.tree-pick select { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.tree, .tree ul { display: flex; justify-content: center; margin: 0; padding: 0; }
.tree { width: max-content; min-width: 100%; }
.tree ul { position: relative; padding-top: 18px; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 18px 5px 0; list-style: none; }
.tree > li { padding-top: 0; }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 18px;
                                    border-top: 2px solid var(--edge); }
.tree li::after { right: auto; left: 50%; border-left: 2px solid var(--edge); }
.tree li:only-child { padding-top: 0; }
.tree li:only-child::before, .tree li:only-child::after, .tree > li::before, .tree > li::after { display: none; }
.tree li:first-child::before, .tree li:last-child::after { border: 0; }
.tree li:last-child::before { border-right: 2px solid var(--edge); border-radius: 0 6px 0 0; }
.tree li:first-child::after { border-radius: 6px 0 0 0; }
.tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 18px; border-left: 2px solid var(--edge); }
.couple { display: flex; gap: 4px; }
.union > .with { margin-bottom: 2px; font-size: .75rem; color: var(--muted); }
/* the line to a former partner is dashed too (only the sides that are drawn) */
.tree li.union.former::before, .tree li.union.former::after { border-top-style: dashed; }
.tree li.union.former::after { border-left-style: dashed; }
.tree li.union.former:last-child::before { border-right-style: dashed; }
.fcard { display: grid; justify-items: center; align-content: start; gap: 1px; width: 104px; padding: 8px 4px;
         background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text);
         text-align: center; font-size: .85rem; }
a.fcard:hover { text-decoration: none; border-color: var(--accent); }
.fcard img, .fcard .ph { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--tile); }
.fcard .ph { display: flex; align-items: center; justify-content: center; font-size: 1.4rem; color: var(--muted); }
.fcard .name { font-weight: 600; overflow-wrap: anywhere; }
.fcard .kin { color: var(--muted); font-size: .76rem; }
.fcard.former, .fcard.ghost { border-style: dashed; }
.fcard.former { opacity: .75; }
.fcard.ghost { color: var(--muted); }
.fcard.late .name::after { content: " †"; color: var(--muted); font-weight: 400; }
.fcard { position: relative; }
.fcard-holder { position: relative; display: block; }
/* ↗ on a card opens that person's page in one click or tap (the card itself puts them in the middle) */
.fcard-open { position: absolute; top: 2px; left: 2px; display: grid; place-items: center; width: 30px; height: 30px;
              border-radius: 50%; color: var(--accent); font-weight: 700; }
.fcard-open:hover { text-decoration: none; background: var(--tile); }
@media (pointer: coarse) { .fcard-open { width: 40px; height: 40px; top: -4px; left: -4px; } }
/* × on a card under Not placed yet (admins): take out of the catalog someone with no photos, no family and no group */
.fcard-remove { position: absolute; top: 2px; right: 2px; z-index: 1; display: grid; place-items: center;
                width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none;
                color: var(--muted); font-size: 1.1rem; line-height: 1; }
.fcard-remove:hover { background: var(--danger); color: #fff; }
@media (pointer: coarse) { .fcard-remove { width: 40px; height: 40px; top: -4px; right: -4px; } }
.legend { margin: 6px 0 0; }
.meaning-form { display: grid; gap: 8px; max-width: 34em; margin: 8px 0; }
.meaning-form label { display: grid; grid-template-columns: 8rem 1fr; align-items: center; gap: 8px; }
.meaning-form input { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--edge);
                      background: var(--bg); color: var(--text); min-width: 0; }
.meaning-form .hint { margin: -4px 0 0 calc(8rem + 8px); }
@media (max-width: 560px) { .meaning-form label { grid-template-columns: 1fr; } .meaning-form .hint { margin-left: 0; } }
.fcard.direct { border: 2px solid var(--text); padding: 7px 3px; }  /* the family line; partners married in are plain */
.fcard.direct.ghost { border-style: dashed; }
.fcard .step-tag { position: absolute; top: 4px; right: 4px; padding: 0 5px; border-radius: 999px; font-size: .68rem;
                   background: var(--tile); color: var(--muted); }
.worked-out { font-size: .95rem; margin: 16px 0 4px; }
.worked-out small { color: var(--muted); font-weight: 400; }
.family-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
/* the family around one person: a row a generation, the one in the middle framed */
.family-view { max-width: 1100px; }
.family-view .gen { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 10px 28px;
                    padding: 12px 0; border-bottom: 1px dashed var(--line); }
.family-view .gen:last-of-type { border-bottom: 0; }
.family-view .branch { display: grid; justify-items: center; gap: 4px; }
.family-view .branch-label { color: var(--muted); font-size: .8rem; min-height: 1.1em; }
.family-view .branch.own .branch-label { color: var(--text); font-weight: 600; }
.family-view .fcard.center { border: 3px solid var(--accent); padding: 6px 2px; }
.family-view .climb { text-align: center; color: var(--muted); margin: 8px 0; }
.fcard .climb-mark { position: absolute; top: 3px; right: 6px; color: var(--accent); font-weight: 700; }
.hint-path { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 4px 0 8px; }
.hint-path a[aria-current] { font-weight: 600; color: var(--text); }
.hint-path small { color: var(--muted); }
.hint-path .sep { color: var(--muted); }
.group-head { font-size: .98rem; margin: 18px 0 8px; }
.group-head small { color: var(--muted); font-weight: 400; }
.other-head { margin: 10px 0 6px; color: var(--muted); font-size: .88rem; }
.whole-line { margin: 20px 0 8px; }
/* folded groups (data-glance): pointed at, the cards float over what follows until the pointer moves off */
details.glance { position: relative; }
details.glance > summary { width: fit-content; cursor: pointer; font-weight: 600; }
details.glance.glancing > .family-cards { position: absolute; z-index: 20; top: 100%; left: 0; margin: 0;
                                          width: min(960px, calc(100vw - 64px)); max-height: min(60vh, 520px);
                                          overflow: auto; padding: 12px; background: var(--surface);
                                          border: 1px solid var(--line); border-radius: 10px;
                                          box-shadow: 0 10px 28px rgb(0 0 0 / .18); }
/* the whole line down from one ancestor: the tree on a sheet, moved and zoomed in its frame (app.js); without the
   script the frame scrolls */
.tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.tree-tools [data-zoom="in"], .tree-tools [data-zoom="out"] { min-width: 2.4em; font-weight: 600; }
.tree-frame { position: relative; overflow: auto; height: calc(100dvh - var(--header-h) - 240px); min-height: 360px;
              background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.tree-frame.panning { overflow: hidden; cursor: grab; touch-action: none; }
.tree-frame.dragging, .tree-frame.dragging a { cursor: grabbing; }
.tree-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tree-sheet { position: absolute; top: 0; left: 0; width: max-content; padding: 16px; transform-origin: 0 0; }
.tree-frame.panning .tree-sheet { user-select: none; }
.tree-sheet .fcard.here { outline: 3px solid var(--accent); outline-offset: 3px; }

/* tours */
.tour-list { display: grid; gap: 8px; max-width: 900px; }
.tour-card { display: grid; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
             border-radius: 10px; color: var(--text); }
.tour-card:hover { text-decoration: none; border-color: var(--accent); }
.tour-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* sharing a folder, photo or tour (_macros.share_panel), and what is shared (Folders) */
.share-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.share-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.share-list.wide { max-width: 900px; }
.share-list .share-photo img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.share-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.share-form select { max-width: 100%; }
.folder-card .from { padding-top: 0; color: var(--muted); font-size: .82rem; }
.shared-home { margin: 8px 0 28px; padding-left: 14px; border-left: 4px solid var(--accent); }
.shared-home h2 { margin-top: 0; }
.folder-tools { margin: 4px 0 18px; }
.suggestions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px;
               margin: 12px 0 8px; }
.suggestion { display: grid; gap: 4px; align-content: start; padding: 10px; background: var(--surface);
              border: 1px solid var(--line); border-radius: 10px; }
.suggestion .covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-bottom: 4px; }
.suggestion .covers img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 4px; }
.suggestion button { justify-self: start; margin-top: 4px; }
.wizard { max-width: 760px; padding-top: 14px; }
.wizard fieldset, .tour-type fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 12px; margin: 0 0 12px; }
.wizard legend { font-weight: 600; padding: 0 4px; }
.wizard input.wide { width: min(100%, 26em); }
.tour-type fieldset > * { margin: 6px 6px 6px 0; }
.choice-inline { margin-right: 14px; }
.pick-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; max-height: 360px;
               overflow: auto; margin: 6px 0; }
.pp { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 1px solid var(--line);
      border-radius: 8px; cursor: pointer; font-size: .85rem; text-align: center; }
.pp:has(input:checked) { border-color: var(--accent); background: var(--tile); }
.pp img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.player { position: fixed; inset: 0; z-index: 100; display: grid; grid-template-rows: minmax(0, 1fr) auto;
          background: #000; color: #fff; }
.player .slide { display: flex; align-items: center; justify-content: center; min-height: 0; }
.player .slide img, .player .slide video { max-width: 100%; max-height: 100%; object-fit: contain; animation: fade-in .6s; }
.player .caption { position: absolute; left: 24px; bottom: 64px; display: grid; gap: 2px; max-width: 70%;
                   text-shadow: 0 1px 3px #000, 0 0 12px rgba(0, 0, 0, .8); }
.player .caption .when { font-size: 1.3rem; font-weight: 600; }
.player .caption .words { font-size: 1.15rem; white-space: pre-line; }
.player .caption .words:empty { display: none; }
.player .controls { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px;
                    background: rgba(255, 255, 255, .06); }
.player .controls button { min-width: 44px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.1rem; }
.player .controls .count { margin: 0 8px; color: #bbb; font-variant-numeric: tabular-nums; }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .player .slide img, .player .slide video { animation: none; } }

/* pages of a long list */
.list-pager { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 14px 0; }
.list-pager .sizes { margin-left: auto; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px;
                     color: var(--muted); font-size: .9rem; }
.list-pager .sizes a { padding: 1px 9px; border: 1px solid transparent; border-radius: 999px; }
.list-pager .sizes a[aria-current] { border-color: var(--accent); color: var(--text); }
ul.events { list-style: none; margin: 0 0 12px; padding: 0; }
ul.events > li { border-bottom: 1px solid var(--line); padding: 6px 0; }
ul.events summary { cursor: pointer; }
.event-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.name-review { list-style: none; margin: 0; padding: 0; }
.name-review li { margin: 0 0 8px; }
.name-review .who { display: inline-block; min-width: 14em; }
.person-card .ph { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: var(--tile); font-size: 1.6rem; color: var(--muted); }
.people-filter input { width: min(32rem, 100%); }
.chips .chip { margin: 0 4px 6px 0; }
ul.documents { list-style: none; margin: 0; padding: 0; }
div#map { height: 65vh; min-height: 320px; border-radius: 8px; border: 1px solid var(--line);
          isolation: isolate; }  /* Leaflet's layers (z-index 400 to 1000) stay inside it, under the top bar's menus */
.map-years { display: flex; align-items: flex-end; gap: 1px; height: 72px; overflow-x: auto; margin: 12px 0 4px; }
.map-years button { flex: 1 0 5px; min-width: 5px; height: 100%; padding: 0; border: 0; border-radius: 0; background: none;
  display: flex; flex-direction: column-reverse; cursor: pointer; }
.map-years button i { display: block; width: 100%; }
.map-years .dated { background: var(--accent); }
.map-years .undated { background: var(--line); }
.map-years button.on { outline: 2px solid var(--text); }
.year-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.year-pick input[type=range] { width: min(28rem, 100%); }
.map-popup .thumbs { display: grid; grid-template-columns: repeat(4, 52px); gap: 2px; margin: 6px 0; }
.map-popup .thumbs img { width: 52px; height: 52px; object-fit: cover; display: block; }
.map-popup ul { margin: 4px 0; padding-left: 16px; }
.leaflet-control-layers .swatch { display: inline-block; width: 10px; height: 10px; margin: 0 6px 0 4px; border-radius: 50%;
                                  border: 2px solid; vertical-align: -1px; }
.swatch.gps { border-color: #2f62c9; background: rgb(47 98 201 / .45); }
.swatch.confirmed { border-color: #1f7a3f; background: rgb(31 122 63 / .45); }
.swatch.folder { border-color: #7a3fb8; background: rgb(122 63 184 / .45); }
.map-popup .confirm { margin: 6px 0; }
.swatch.events { border-color: #b42318; background: rgb(180 35 24 / .25); }
.swatch.journeys { border-color: #0e7490; background: rgb(14 116 144 / .45); }
/* which way a journey went, in the middle of each leg (map.js drawJourney) */
.leaflet-marker-icon.map-journey-arrow { color: #0e7490; font-size: .9rem; line-height: 1; text-align: center;
                                         text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg); }
.face-row .age { font-weight: 600; }
.import-review table { width: 100%; border-collapse: collapse; }
.import-review td, .import-review th { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.import-review td .hint { display: block; }
.import-review .how { font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.import-review tr.how-unsure { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.import-review input { width: 12em; }
.net-paths { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; align-items: center; }
.net-paths dd { margin: 0; }
.photo-tags { align-items: center; }
.tag-chip { display: inline-flex; align-items: center; border-radius: 999px; background: var(--tile); }
.tag-chip .tag { background: none; padding-right: 2px; }
.tag-chip.mine { box-shadow: inset 0 0 0 1px var(--accent); }
.tag-chip button { padding: 0 8px 0 2px; border: 0; background: none; color: var(--muted); font-size: .9rem; line-height: 1.4; }
.tag-chip button:hover { color: var(--danger); }
.tag-form input { width: 7em; font: inherit; font-size: .8rem; padding: 2px 8px; border-radius: 999px; border: 1px dashed var(--line);
                  background: var(--bg); color: var(--text); }
.face-row .ph { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; flex: none;
                background: var(--tile); color: var(--muted); }
.select-bar.bulk .bulk-field { display: inline-flex; gap: 4px; align-items: center; }
.select-bar.bulk input { width: 9em; font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
                         background: var(--bg); color: var(--text); }
.stats dt[title] { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
.stats dt.sub { padding-left: 14px; color: var(--muted); }
table.broken { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.broken td, table.broken th { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.broken code { word-break: break-all; }
.suggest-box { position: absolute; z-index: 60; margin: 2px 0 0; padding: 4px; list-style: none; max-width: min(380px, calc(100vw - 32px));
               max-height: 50vh; overflow-y: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line);
               border-radius: 8px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); font-size: .95rem; }
.suggest-box li { display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: 6px; cursor: pointer; }
.suggest-box li.on, .suggest-box li[role=option]:hover { background: var(--tile); }
.suggest-box img, .suggest-box .ph { flex: none; width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--tile); }
.suggest-box b { display: block; font-weight: 600; }
.suggest-box small { display: block; color: var(--muted); font-size: .8rem; }
.suggest-box li.new { cursor: default; color: var(--muted); font-size: .85rem; padding: 6px 8px; }
.help-button { flex: none; width: 30px; height: 30px; padding: 0; border-radius: 50%; font-weight: 600; }
dialog.help { width: min(720px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 8px 22px 18px;
              border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
dialog.help::backdrop { background: rgba(0, 0, 0, .45); }
/* a question with things to tick (app.js choose): a group's family too */
dialog.choose { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); overflow: auto; padding: 6px 22px 16px;
                border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
dialog.choose::backdrop { background: rgba(0, 0, 0, .45); }
dialog.choose h2 { margin: 12px 0 6px; font-size: 1.2rem; }
dialog.choose ul { margin: 10px 0; padding: 0; list-style: none; }
dialog.choose li label { display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
dialog.choose li input { width: 20px; height: 20px; margin: 0; }
/* a text to check (a birth name with first names) */
dialog.choose p > input { width: 100%; min-height: 44px; font: inherit; padding: 6px 10px; border-radius: 6px;
                          border: 1px solid var(--edge); background: var(--bg); color: var(--text); }
.choose-answers { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.choose-answers button { min-height: 44px; padding: 6px 16px; }
dialog.help h2 { margin: 12px 0 8px; }
dialog.help h3 { margin: 18px 0 6px; font-size: 1rem; }
dialog.help p { margin: 6px 0; line-height: 1.45; }
.help-close { position: sticky; top: 0; float: right; margin: 0; }
.help-close button { border: 0; background: none; font-size: 1.4rem; color: var(--muted); padding: 2px 6px; }
.keys-list, .pages-list { display: grid; grid-template-columns: max-content 1fr; gap: 5px 14px; margin: 0; align-items: baseline; }
.keys-list dd, .pages-list dd { margin: 0; }
.keys-list dd a { white-space: nowrap; }
kbd { display: inline-block; min-width: 1.4em; margin-right: 3px; padding: 0 5px; border: 1px solid var(--line);
      border-bottom-width: 2px; border-radius: 4px; background: var(--bg); font: .82rem/1.5 ui-monospace, monospace;
      text-align: center; }
@media (max-width: 560px) { .keys-list, .pages-list { grid-template-columns: 1fr; gap: 2px; } .keys-list dd, .pages-list dd { margin-bottom: 6px; } }

/* Family accounts: the See-as strip, who is signed in, signing in, Who is this?, uploads, Recent changes */
.see-as { background: var(--accent); color: var(--on-accent); padding: 6px 16px; text-align: center; font-size: .9rem; }
.demo-note { background: var(--surface); border-bottom: 1px solid var(--line); border-top: 3px solid var(--ours);
  padding: 6px 16px; text-align: center; font-size: .9rem; }
fieldset.demo-locked { border: 0; margin: 0; padding: 0; min-width: 0; }  /* a demo's Settings: drawn, not changed */
.signin .demo-admin { margin-top: 28px; }
.see-as button { margin-left: 8px; }
.signin { max-width: 460px; margin: 48px auto; text-align: center; }
.signin details { text-align: left; }
/* Sign in with Google as developers.google.com/identity/branding-guidelines draws it, in its light theme, which Google
   allows on dark pages too: white, a 1px #747775 border, #1F1F1F text, the G at 20px, 12px | G | 10px | text | 12px.
   Google Sans or Roboto Medium where the device has them (no font is downloaded), else the system's. */
.google-signin { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px;
                 background: #fff; border: 1px solid #747775; border-radius: 20px; color: #1f1f1f;
                 font: 500 14px/20px "Google Sans", Roboto, system-ui, "Segoe UI", Arial, sans-serif;
                 letter-spacing: .25px; white-space: nowrap; transition: background-color .218s, box-shadow .218s; }
.google-signin svg { flex: none; display: block; width: 20px; height: 20px; }
/* Google's hover and press: #303030 laid over the white at 8% and 12% */
.google-signin:hover { text-decoration: none; background: #eee;
                       box-shadow: 0 1px 2px 0 rgb(60 64 67 / .3), 0 1px 3px 1px rgb(60 64 67 / .15); }
.google-signin:active { background: #e6e6e6; }
.questions { display: flex; flex-wrap: wrap; gap: 16px; margin: 8px 0 24px; }
.question { display: grid; justify-items: center; gap: 6px; padding: 10px; width: 210px; background: var(--surface);
            border: 1px solid var(--line); border-radius: 10px; }
.question img { border-radius: 8px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; background: var(--surface); }
.drop.over { border-color: var(--accent); }
.upload-list { list-style: none; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 2px 12px; align-items: center;
                  font-size: .88rem; }
.upload-list li span { overflow-wrap: anywhere; }
.upload-list li small { grid-column: 1 / -1; color: var(--danger); }
.upload-list li.ok span { color: var(--muted); }
.changes, .same-people { list-style: none; padding: 0; display: grid; gap: 10px; }
.changes li.undone { opacity: .55; }
.changes .when { color: var(--muted); font-size: .85rem; margin-right: 8px; }
.changes .widened { color: var(--danger); font-weight: 600; }
.account-row { border-top: 1px solid var(--line); padding: 8px 0; }
.account-row > summary { cursor: pointer; padding: 2px 0; }
.account-row > summary b { font-weight: 600; }
.account-row[open] > summary { margin-bottom: 6px; }
.account-body { padding: 0 0 4px 18px; }
.account-find { margin: 14px 0 6px; }
.account-find input { font: inherit; width: min(100%, 26em); padding: 4px 8px; border-radius: 6px;
                      border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.account-row .code { overflow-wrap: anywhere; }
.new-code { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; margin: 8px 0 4px; }
.new-code .qr svg { display: block; border-radius: 6px; }  /* 265 px: fits a phone */
.new-code ol { margin: 0 0 8px; padding-left: 20px; }
.new-code > div:last-child { flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.damaged { list-style: none; padding: 0; display: grid; gap: 8px; }
.damaged li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.damaged li a { overflow-wrap: anywhere; }

/* Settings, Family accounts and Codes for signing in at home: the menu at the side (_settings_nav.html) and the part
   it shows. app.js hides the other parts of Settings; on phones the menu is rows of buttons above the panels. */
.settings-page { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start;
                 margin-top: 12px; }
.settings-nav { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100dvh - var(--header-h) - 32px);
                overflow-y: auto; }
.settings-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.settings-nav a { display: block; padding: 7px 12px; border-left: 3px solid transparent; border-radius: 0 8px 8px 0;
                  color: var(--text); }
.settings-nav a:hover { text-decoration: none; background: var(--surface); }
.settings-nav a[aria-current] { border-left-color: var(--accent); background: var(--surface); font-weight: 600;
                                box-shadow: 0 1px 4px rgb(0 0 0 / .08); }
.settings-nav small { margin-left: 4px; color: var(--muted); font-weight: 400; }
.settings-nav .nav-group { margin: 20px 0 4px; padding: 0 15px; color: var(--muted); font-size: .78rem;
                           font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.settings-page [id] { scroll-margin-top: calc(var(--header-h) + 12px); }  /* not under the top bar */
.settings select { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
                   background: var(--bg); color: var(--text); }
.settings input { max-width: 100%; }
.settings > .panel > h2 + .account-row { border-top: 0; }
@media (max-width: 760px) {
  .settings-page { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
  .settings-nav { position: static; max-height: none; overflow: visible; }
  .settings-nav ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .settings-nav a { padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
                    font-size: .9rem; }
  .settings-nav a[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--on-accent);
                                  box-shadow: none; }
  .settings-nav a[aria-current] small { color: inherit; opacity: .85; }
  .settings-nav .nav-group { margin: 10px 0 4px; padding: 0; }
  .settings .net-paths { grid-template-columns: minmax(0, 1fr); }  /* each folder over its box; a long path wraps */
  .settings .net-paths code { overflow-wrap: anywhere; }
}

/* Home: the greeting with the storage meter beside it (admins), the row of memories, the photos by day */
.home-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.storage-meter { display: grid; gap: 2px; min-width: min(100%, 220px); color: var(--text); font-size: .85rem; }
.storage-meter:hover { text-decoration: none; }
.storage-meter:hover .label { color: var(--accent); }
.storage-meter .label { font-weight: 600; }
.storage-meter .meter { height: 6px; margin: 2px 0; }
.storage-meter .hint { font-size: .8rem; }
.meter.low i, .storage-meter.low .meter i { background: var(--danger); }
.memories-wrap { position: relative; margin: 18px 0 8px; }
.memories { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin;
            padding-bottom: 6px; }
.memory { position: relative; flex: 0 0 clamp(200px, 22vw, 300px); aspect-ratio: 4 / 3; border-radius: 12px;
          overflow: hidden; background: var(--tile); scroll-snap-align: start; color: #fff; }
.memory img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.memory:hover { text-decoration: none; }
.memory:hover img { transform: scale(1.04); }
.memory-text { position: absolute; inset: auto 0 0; display: grid; gap: 1px; padding: 28px 14px 12px;
               background: linear-gradient(transparent, rgb(0 0 0 / .72)); text-shadow: 0 1px 3px rgb(0 0 0 / .5); }
.memory-text b { font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.memory-text span { font-size: .82rem; opacity: .92; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memories-wrap .scroll, .events-wrap .scroll { position: absolute; top: calc(50% - 21px); z-index: 1; width: 36px;
  height: 36px; padding: 0; border-radius: 50%; box-shadow: 0 2px 8px rgb(0 0 0 / .25); font-size: 1.2rem; }
.memories-wrap .scroll.back, .events-wrap .scroll.back { left: -10px; }
.memories-wrap .scroll.on, .events-wrap .scroll.on { right: -10px; }
.days { --row: var(--day-row); display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px 22px; margin-top: 18px; }
.days .month { flex: 0 0 100%; margin: 22px 0 -6px; font-size: 1.5rem; font-weight: 400; }
/* a day is as wide as its photos side by side, and shares a line with others that fit; one too wide for a line
   wraps, and its rows but the last are stretched to the edge (where a day fits on one line there is nothing to fill) */
.day { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.day h3, .day h4 { margin: 0 0 8px; font-size: .9rem; font-weight: 600; }
.home-feed { margin-top: 26px; }  /* a member's Home: their family's photos, then everyone's */
.home-feed > h2 { margin: 0; }
.home-feed > .meta { margin: 4px 0 0; }
.home-feed .more-part { margin: 16px 0 0; }
/* a member's Home: a big button for each of their closest family, opening that one's memories and photos */
.kin-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 24px 0 0; }
.kin-button { display: flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--accent); color: var(--text); }
.kin-button:hover { text-decoration: none; background: var(--accent); color: var(--on-accent); }
.kin-button img, .kin-button .ph { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex: none; }
.kin-button .ph { display: grid; place-items: center; background: var(--tile); font-weight: 600; }
.kin-button > span:last-child { display: grid; line-height: 1.25; }
/* the last tile shows or hides the partners someone once had: the same tile, drawn as a choice */
.kin-choice { border-style: dashed; }
.kin-choice .ph { font-size: 1.4rem; color: var(--muted); }
.kin-button b { font-size: 1.05rem; font-weight: 600; }
.kin-button small { font-size: .8rem; opacity: .8; }
/* a day's photos, as Photo tiles says (the round button): squares aimed at their faces, each row but the last
   stretched to the edge as a list's are; or Whole photos, in rows of their own shapes */
.day-tiles { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; touch-action: pan-x pan-y; }
.day-tiles .tile { flex: 1 0 var(--tile-min); width: var(--tile-min); max-width: calc(var(--tile-min) * 1.6);
                   aspect-ratio: 1; }
:root[data-tiles="whole"] .day-tiles .tile { flex: var(--r) 0 auto; width: calc(var(--row) * var(--r)); max-width: 100%;
                                            height: var(--row); aspect-ratio: auto; }
.day-tiles::after { content: ""; flex-grow: 1000; margin-left: -4px; }  /* the last row isn't stretched */
@media (max-width: 760px) { .memory { flex-basis: 70vw; } .memories-wrap .scroll { display: none; } }

/* Storage, on the Status page: each disk's bar in parts, with what each part is */
.disk { margin: 10px 0 18px; }
.disk h3 { margin: 14px 0 0; }
.meter.parts { display: flex; height: 14px; }
.meter.parts i { border-radius: 0; }
.meter.parts i.ours, .legend i.ours { background: var(--ours); }
.meter.parts i.other, .legend i.other { background: var(--other); }
.meter.parts i.removed, .legend i.removed { background: var(--removed); }
.legend { display: grid; grid-template-columns: max-content auto; gap: 3px 18px; margin: 8px 0 0; }
.legend dt { color: var(--muted); }
.legend dd { margin: 0; font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px;
            background: var(--accent); vertical-align: -1px; }
.legend i.free { background: var(--tile); border: 1px solid var(--line); }

/* The larger look at a photo that pointing at one for a moment gives (app.js); a face's place on it is outlined */
.peek { position: fixed; z-index: 30; overflow: hidden; pointer-events: none; border-radius: 8px;
        background: var(--tile); border: 1px solid var(--line); box-shadow: 0 12px 40px rgb(0 0 0 / .35); }
.peek-in { position: absolute; left: 50%; top: 50%; }
.peek img { display: block; width: 100%; height: 100%; object-fit: contain; }
.peek-face { position: absolute; border: 2px solid #fff; border-radius: 4px;
             box-shadow: 0 0 0 2px rgb(0 0 0 / .55), 0 0 0 100vmax rgb(0 0 0 / .22); }
.peek-face[hidden] { display: none; }
.read-form textarea, .read-text textarea { display: block; width: 100%; margin: 4px 0 10px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
.read-form > label { display: block; margin-top: 12px; font-weight: 600; }
.read-form input:not([type]) { font: inherit; width: min(100%, 30em); padding: 4px 8px; border-radius: 6px;
                               border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.read-photo img, .read-text img { height: 96px; border-radius: 4px; vertical-align: middle; margin-right: 8px; }
.read-person { border-top: 1px solid var(--line); padding: 2px 0 10px; }
.read-person h3 { margin: 14px 0 4px; font-size: 1rem; }
.read-person.how-unsure { border-left: 4px solid var(--danger); padding-left: 10px; }
.read-person .how { font-size: .78rem; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.read-person select { max-width: 100%; }
.read-changes { list-style: none; padding: 0; margin: 6px 0; }
.read-changes li { margin: 4px 0; }
.read-changes label { cursor: pointer; }
.read-changes label:has(input:disabled) { opacity: .5; cursor: default; }
.read-changes .now::before { content: "· "; }
.read-unplaced li { margin: 3px 0; }
.read-apply { position: sticky; bottom: 0; margin: 12px 0 0; padding: 10px 0; background: var(--bg);
  border-top: 1px solid var(--line); }
.readings li { margin: 4px 0; }
/* A reading the AI is at: an hourglass whose sand runs down, then turns over (the full bulb on top again, so it
   goes round without a jump), and how long it has been */
.read-waiting { display: flex; gap: 20px; align-items: center; margin: 16px 0; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; }
.read-waiting h2 { margin: 0 0 4px; font-size: 1.25rem; }
.read-waiting p { margin: 4px 0; }
.read-took { font-variant-numeric: tabular-nums; }
.hourglass { flex: none; width: 54px; height: 76px; margin: 0 11px;  /* room to turn: 76px across, on its side */
  animation: hourglass-turn 2.4s ease-in-out infinite; }
.hourglass .frame { fill: var(--muted); }
.hourglass .glass { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.hourglass .sand { fill: var(--accent); }
.hourglass .top { transform-origin: 20px 26px; animation: sand-out 2.4s linear infinite; }
.hourglass .bottom { transform-origin: 20px 46px; animation: sand-in 2.4s linear infinite; }
.hourglass .stream { stroke: var(--accent); stroke-width: 1.2; animation: sand-stream 2.4s linear infinite; }
@keyframes hourglass-turn { 0%, 78% { transform: rotate(0deg); } 100% { transform: rotate(180deg); } }
@keyframes sand-out { 0% { transform: scaleY(1); } 78%, 100% { transform: scaleY(0); } }
@keyframes sand-in { 0% { transform: scaleY(0); } 78%, 100% { transform: scaleY(1); } }
@keyframes sand-stream { 0%, 76% { opacity: 1; } 78%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .hourglass { animation: none; }
  .hourglass .top, .hourglass .bottom, .hourglass .stream { animation-duration: 8s; }
}
/* Once the ticked changes are made: what changed, by person */
.read-summary h4 { margin: 12px 0 2px; font-size: .95rem; }
.read-made, .read-added { margin: 4px 0 8px; padding-left: 1.2em; }
.read-made li, .read-added li { margin: 3px 0; }
.read-added button { margin-left: 6px; }

/* Passkeys: the button that signs in with one or makes one (beside Google's on the sign-in page), and each passkey
   on the Passkeys page and on Family accounts */
.passkey-signin { margin-top: 18px; }
.passkey-button { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px;
                  border-radius: 20px; font-weight: 600; white-space: nowrap; }
.passkey-button svg { flex: none; display: block; }
.passkey-invite .note, .passkey-signin .note { text-align: left; }
.passkey-row { border-top: 1px solid var(--line); padding: 10px 0; }
.passkey-row .actions, .passkey-row .note { margin: 6px 0 0; }
.passkey-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 4px 0; }
.passkey-line svg { width: 16px; height: 16px; color: var(--muted); }

/* ---- big enough to tap: on touch screens every button, link in the menu and small control is at least 44px ---- */
@media (pointer: coarse) {
  button, .button, select { min-height: 44px; }
  .faces.review button { width: 34px; height: 34px; min-height: 0; font-size: 1.1rem; }
  .menu-button, .help-button, .avatar, .looks-button { width: 44px; height: 44px; }
  .faces.review button::after, .tag-chip button::after { content: ""; position: absolute; inset: -6px; }
  .tag-chip { position: relative; }
  .tag-chip button { position: relative; min-height: 32px; padding: 0 10px 0 4px; }
  .tag-chip button::after { inset: -6px -4px; }
  .pick input { width: 28px; height: 28px; }
  img[src^="/face/"] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }  /* held: its photo */
  .face-row button, .files button, .face-row button.suggest { min-height: 40px; padding: 4px 12px; }
}

/* ---- Search: a search's filters as chips that take them off, the ones to add (photos or videos, faces to name, no
   date, the order, years and a place), what to try when nothing is found, and the list that opens under the box at
   the top as a search is typed (app.js, data-search-suggest). Every chip is a link, big enough to tap on a phone. */
.search-chips, .search-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 6px; }
.search-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.search-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 14px;
               border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text);
               font-size: .9rem; }
.search-chip:hover { text-decoration: none; border-color: var(--accent); }
.search-chip[aria-current] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.search-chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.search-chip.on span { color: var(--muted); font-size: 1.05rem; line-height: 1; }
.search-chip.quiet { border-style: dashed; color: var(--muted); }
.search-chip .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
                   white-space: nowrap; }
.search-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 6px 0 12px; }
.search-range label { display: inline-flex; align-items: center; gap: 6px; }
.search-range select, .search-range input { font: inherit; padding: 4px 8px; border-radius: 6px;
                                             border: 1px solid var(--line); background: var(--surface);
                                             color: var(--text); }
.search-range input { width: min(16rem, 60vw); }
.search-range .hint { flex-basis: 100%; margin: 0; }
.search-none { max-width: 720px; margin: 18px 0; padding: 4px 18px 8px; border: 1px solid var(--line);
               border-radius: 10px; background: var(--surface); }
.search-ideas { margin: 4px 0 10px; padding-left: 1.2em; }
.search-ideas li { margin: 6px 0; }
.search-suggest { position: fixed; max-width: min(420px, calc(100vw - 32px)); }
.search-suggest li.head { cursor: default; padding: 8px 8px 2px; color: var(--muted); font-size: .75rem;
                          text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 760px) {
  .search-suggest { max-width: none; }
}
@media (pointer: coarse), (max-width: 760px) {
  .search-chip { min-height: 44px; padding: 6px 16px; }
  .search-range select, .search-range input { min-height: 44px; }
  .search-ideas a { display: inline-block; padding: 10px 0; }
  .search-suggest li[role=option] { min-height: 44px; }
}

/* Naming faces one at a time (People → Name faces, app.js): the whole photo with the face outlined, beside the face
   and the question (above them on phones), and answers big enough to tap (44 px and more). Check faces: ✓ and × on
   each face recognized, a box to tick it. */
.naming-start { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 18px; }
.naming-start .button { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 20px;
                        font-size: 1rem; }
.naming-steps { margin: 8px 0 14px; }
.naming-steps a { min-height: 36px; display: inline-flex; align-items: center; }
.naming-surest { margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; }
.naming-surest p { margin: 0 0 8px; }
.naming-surest p:last-child { margin: 0; }
.naming-surest .filters { margin-left: 8px; }
.naming-surest button { min-height: 44px; padding: 6px 18px; }
.sure { font-weight: 600; }
.sure.unsure { color: var(--danger); }
.naming-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); gap: 20px 28px;
               align-items: start; margin: 8px 0 24px; }
.naming-photo { display: flex; justify-content: center; align-items: center; min-height: 240px; padding: 8px;
                border-radius: 10px; background: var(--stage); }
.naming-framed { --tall: min(72vh, 820px); position: relative; display: inline-block; max-width: 100%; overflow: hidden;
                 line-height: 0; border-radius: 4px; }
.naming-framed img { display: block; max-width: 100%; max-height: var(--tall); width: auto; height: auto;
                     background: center / 100% 100% no-repeat var(--tile); }  /* the thumbnail, until it is in */
/* its shape known (--across: width over height): as large as fits, the picture filling it exactly */
.naming-framed.sized { width: min(100%, calc(var(--tall) * var(--across))); aspect-ratio: var(--across); }
.naming-framed.sized img { width: 100%; height: 100%; max-height: none; }
.naming-box { position: absolute; border: 3px solid #fff; border-radius: 6px; pointer-events: none;
              box-shadow: 0 0 0 2px rgb(0 0 0 / .6), 0 0 0 100vmax rgb(0 0 0 / .28); }  /* the rest a little darker */
.naming-ask { display: grid; gap: 14px; align-content: start; min-width: 0; }
.naming-face { display: flex; align-items: center; gap: 16px; }
.naming-face > div { min-width: 0; }
.naming-crop { flex: none; width: 160px; height: 160px; border-radius: 14px; object-fit: cover;
               background: var(--tile); }
.naming-question { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.25; overflow-wrap: anywhere; }
.naming-question:focus { outline: none; }
.naming-question a { color: inherit; }
.naming-who { width: 44px; height: 44px; margin: 0 4px 0 2px; border-radius: 50%; object-fit: cover; vertical-align: middle; }
.naming-ask .hint { font-size: .9rem; margin: 0; }
.naming-answers { display: flex; flex-wrap: wrap; gap: 10px; }
.naming-answers > button, .naming-answers > .button { flex: 1 1 0; min-width: 88px; min-height: 52px; display: inline-flex;
  align-items: center; justify-content: center; padding: 8px 16px; font-size: 1.1rem; border-radius: 10px; }
.naming-answers > .button:hover { text-decoration: none; }
.naming-name { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.naming-name input { flex: 1 1 200px; min-width: 0; min-height: 52px; padding: 8px 14px; font: inherit; font-size: 1.1rem;
                     border: 1px solid var(--edge, var(--line)); border-radius: 10px; background: var(--bg); color: var(--text); }
.naming-name button { min-height: 52px; padding: 8px 22px; font-size: 1.1rem; border-radius: 10px; }
.naming-about { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 0; color: var(--muted);
                font-size: .9rem; }
.naming-about a, .naming-about button { min-height: 44px; display: inline-flex; align-items: center; }
.naming-about button { padding: 4px 6px; font-size: .9rem; }
.naming-group .faces img { width: 88px; height: 88px; }
.naming-done { grid-template-columns: minmax(0, 640px); }
.naming-done p { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.naming-done .button { min-height: 44px; display: inline-flex; align-items: center; padding: 6px 18px; }
[data-naming].busy .naming-card { opacity: .55; transition: opacity .15s .15s; }  /* only when the answer is slow */
@media (max-width: 760px) {
  .naming-card { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 4px; }
  .naming-photo { min-height: 0; padding: 4px; }
  .naming-framed { --tall: 46vh; }
  .naming-crop { width: 96px; height: 96px; border-radius: 10px; }
  .naming-question { font-size: 1.3rem; }
  .naming-group .faces img { width: 64px; height: 64px; }
}
.check-faces .face { position: relative; }
/* how sure recognition is (people.how_sure): on the picture, between ↗ and ✓ */
.check-faces .face .sure { position: absolute; bottom: 6px; left: 50%; transform: translateX(-60%); z-index: 1;
                           padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .55); color: #fff;
                           font-size: .72rem; font-weight: 400; pointer-events: none; }
.check-faces .face .sure.unsure { background: var(--danger); font-weight: 600; }
.check-faces .faces img { display: block; width: 96px; height: 96px; }
.check-faces .pick:has(input:checked) img { outline: none; opacity: 1; }  /* ticked: them, when Yes is pressed */
.check-faces .pick:has(input:not(:checked)) img { opacity: .4; }  /* unticked: left as they are */
.check-faces .face .open { position: absolute; bottom: 4px; left: 4px; z-index: 1; padding: 0 6px; border-radius: 4px;
                           background: rgba(0, 0, 0, .55); color: #fff; }
.check-faces .face button { position: absolute; right: 2px; width: 30px; height: 30px; min-height: 0; padding: 0;
  border-radius: 50%; font-size: 1rem; line-height: 1; box-shadow: 0 1px 3px rgb(0 0 0 / .35); }
.check-faces .face button.no { top: 2px; border: 0; background: rgba(0, 0, 0, .65); color: #fff; }
.check-faces .face button.yes { bottom: 2px; background: var(--keep); border-color: var(--keep); color: #fff; }
@media (pointer: coarse) {
  .check-faces .face button { width: 36px; height: 36px; }
  .check-faces .face button::after { content: ""; position: absolute; inset: -5px; }  /* 46 px to tap */
}

/* ---- An app on the phone, New for you, photo frames ----------------------------------------------------------- */
/* New for you, at the top: a bell, and how many are new on it */
.news-button { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px;
               border: 1px solid var(--edge); border-radius: 50%; color: var(--muted); }
.news-button:hover { color: var(--text); text-decoration: none; }
.news-button[aria-current], .news-button.has-news { color: var(--text); }
.news-button .count { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 4px;
                      border-radius: 9px; background: var(--accent); color: var(--on-accent); font-size: .7rem;
                      font-weight: 700; line-height: 18px; text-align: center; }
@media (pointer: coarse) { .news-button { width: 44px; height: 44px; } }
.news-list { list-style: none; margin: 8px 0 16px; padding: 0; }
.news-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; margin: 0 0 8px;
             background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.news-item.new { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.news-item .news-text { color: var(--text); overflow-wrap: anywhere; }
.news-item time { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.news-item .news-new { justify-self: end; grid-column: 2; color: var(--accent); font-size: .8rem; font-weight: 700; }
.news-pictures { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.news-pictures img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
                     background: var(--tile); }
.news-pictures img.face { border-radius: 50%; }
.news-more { display: grid; place-items: center; min-width: 64px; height: 64px; border-radius: 6px;
             background: var(--tile); color: var(--text); font-weight: 600; }
/* Settings → Photo frames */
.device-links { list-style: none; margin: 8px 0 16px; padding: 0; }
.device-links li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.device-links li.off { color: var(--muted); }
.device-links button { margin-left: 8px; }
.device-made { padding: 12px; border: 1px solid var(--accent); border-radius: 10px; }

/* ---- Places by hand, town names, XMP sidecars and other apps' names --------------------------------------------- */
.swatch.placed { border-color: #b35c00; background: rgb(179 92 0 / .45); }
.map-placing { display: flex; gap: 14px; align-items: flex-start; margin: 12px 0; padding: 12px 14px;
               border: 1px solid var(--accent); border-radius: 10px; background: var(--surface); }
.map-placing[hidden] { display: none; }
.map-placing h2 { margin: 0 0 4px; font-size: 1.1rem; }
.map-placing img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; flex: none; }
.map-placing p { margin: 6px 0; }
.placing-find { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.placing-towns { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.placing-towns button { text-align: left; }
.leaflet-marker-icon.map-pin { border-radius: 50% 50% 50% 0; transform-origin: center; background: #b35c00;
                               border: 3px solid #fff; box-shadow: 0 1px 4px rgb(0 0 0 / .5); rotate: -45deg;
                               cursor: grab; }
dl.other-apps { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; }
dl.other-apps dd { margin: 0; }
.people-added { columns: 14rem; margin: 6px 0; padding-left: 18px; }
@media (max-width: 600px) { .map-placing { flex-direction: column; } }
@media (pointer: coarse) { .placing-towns button, .map-placing button { min-height: 44px; } }

/* ---- Recorded stories and long tapes (stories.py, _stories.html, chapters.py) ---------------------------------- */
.stories { margin: 4px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stories h2 { margin: 6px 0; }
.story-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.story { padding: 8px 10px; border-radius: 8px; background: var(--bg); }
.story-head { margin: 0 0 4px; }
.story audio, .story-form audio { display: block; width: 100%; margin: 4px 0; }
.story .said { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.story-tools { margin: 4px 0 0; display: flex; gap: 12px; }
.story-record summary { color: var(--accent); cursor: pointer; margin: 6px 0; }
.story-form p { margin: 6px 0; }
.story-form .recorder { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.story-form .record-time { font-variant-numeric: tabular-nums; color: var(--muted); }
.story-file input { display: block; margin-top: 4px; max-width: 100%; }
.stories-panel { margin: 12px 0; }
.stories-panel > .stories { border-bottom: 0; }
/* a recording on its page: the picture of its sound, and the player under it */
.stage .sound-wave { max-width: 100%; max-height: 70%; }
.stage .note.sound { position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; }
.stage .note.sound audio { display: block; width: 100%; }
.badge.sound { letter-spacing: .02em; }
/* a long video's chapters: each jumps the player to where it starts */
.chapter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 50vh; overflow-y: auto; }
.chapter { display: grid; grid-template-columns: 96px auto minmax(0, 1fr); align-items: center; gap: 8px; width: 100%;
           padding: 2px; border: 1px solid transparent; border-radius: 6px; background: none; color: inherit;
           text-align: left; cursor: pointer; }
.chapter:hover, .chapter:focus-visible { border-color: var(--edge); }
.chapter img { width: 96px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; background: var(--tile); }
.chapter .time { font-variant-numeric: tabular-nums; }
.chapter-said { color: var(--muted); font-size: .88rem; overflow-wrap: anywhere; }
.frame-strip.many { max-height: 40vh; overflow-y: auto; }
/* a transcript's lines, each put right where Whisper misheard */
.transcript li.removed { opacity: .6; }
.line-form { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.line-form input[name="text"] { flex: 1 1 220px; min-width: 0; }
@media (pointer: coarse) {
  .story-form button, .story-tools button, .chapter, .line-form button, .transcript .time { min-height: 44px; }
}

/* ---- Faces and dates that find more (face_ages.py, date_hints.py, camera_clock.py, routes/face_checks.py) -------- */
/* a photo's probable date, under Taken */
.date-hint { margin: 6px 0; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--bg);
             border-radius: 0 6px 6px 0; }
.date-hint details { margin-top: 2px; }
.date-hint summary { color: var(--accent); cursor: pointer; display: inline-block; }
.date-hint ul { margin: 4px 0 0; padding-left: 18px; }
/* who an unnamed group looks like */
.looks-like img { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 4px;
                  object-fit: cover; }
/* Confirm faces → Ages to check */
.age-cameras { margin: 8px 0; padding-left: 18px; }
.age-person { margin: 14px 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.age-person h2 { margin: 0 0 8px; font-size: 1.1rem; }
.age-faces { display: flex; flex-wrap: wrap; gap: 12px; }
.age-face { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 4px 8px; align-items: start;
            width: min(100%, 300px); }
.age-face img { width: 80px; height: 80px; border-radius: 6px; object-fit: cover; background: var(--tile); }
.age-face .hint { display: block; }
.age-answers { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
/* Confirm faces → Faces missed */
.missed-faces { display: flex; flex-wrap: wrap; gap: 14px; margin: 10px 0; }
.missed-photo { display: flex; flex-direction: column; gap: 4px; width: min(100%, 200px); }
.missed-photo img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--tile); }
/* Cleanup → Camera clocks (cleanup_camera_clock.html): the cameras, then one camera's photos a month at a time beside
   the panel for the photo clicked, which stays in view as the photos scroll (on a phone it rises from the foot) */
table.cameras { border-collapse: collapse; width: 100%; margin: 10px 0; }
table.cameras th, table.cameras td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line);
                                     vertical-align: top; }
.clock-stretches ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 10px; }
.clock-stretches li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.clock-stretches .sep { color: var(--muted); }
.clock-what { flex: 1 1 280px; }
.clock-thumb { display: inline-block; vertical-align: middle; line-height: 0; }
.clock-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--tile); }
.clock-browse { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; margin-top: 12px; }
.clock-when { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.clock-when a { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text);
                font-variant-numeric: tabular-nums; }
.clock-when a:hover { text-decoration: none; border-color: var(--accent); }
.clock-when a.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.clock-when small { color: inherit; opacity: .75; }
.clock-photos h2 .hint, .clock-day .hint { font-weight: 400; font-size: .85rem; }
.clock-day { margin: 16px 0 6px; font-size: .95rem; }
.clock-pages { color: var(--muted); }
.clock-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; }
.clock-tile { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 3px; border-radius: 8px;
              color: inherit; border: 2px solid transparent; }
.clock-tile:hover { text-decoration: none; border-color: var(--edge); }
.clock-tile img { width: 100%; aspect-ratio: 1; height: auto; object-fit: cover; border-radius: 5px; background: var(--tile); }
.clock-tile .when { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.clock-tile .when b { color: var(--accent); font-weight: 600; }
.clock-tile.fixed { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.clock-tile.draft { border-style: dashed; border-color: var(--accent); }
.clock-tile.start { border-style: solid; border-color: var(--accent); }
.clock-tile.on { border-color: var(--text); border-style: solid; }
.clock-tile .clock-mark { position: absolute; top: 6px; padding: 0 4px; border-radius: 4px; background: var(--surface);
                          font-size: .8rem; line-height: 1.5; }
.clock-tile .clock-mark.warn { left: 6px; }
.clock-tile .clock-mark.pin { right: 6px; }
.clock-tile .clock-mark.video { left: 6px; top: auto; bottom: 26px; }
.clock-mark.warn { color: var(--danger); }
.clock-pick { position: sticky; top: calc(var(--header-h) + 12px); max-height: calc(100vh - var(--header-h) - 24px);
              overflow: auto; }
.clock-pick h2 { font-size: 1.05rem; }
.clock-preview { display: block; width: 100%; max-height: 260px; object-fit: contain; margin: 12px 0 8px;
                 border-radius: 6px; background: var(--tile); }
.panel .clock-facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; margin: 8px 0; }
.panel .clock-facts dt { color: var(--muted); }
.panel .clock-facts dd { margin: 0; text-align: left; }
.clock-real { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.clock-real input { font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line);
                    background: var(--bg); color: var(--text); }
.clock-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.clock-draft { padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.clock-draft .clock-thumb img { width: 36px; height: 36px; }
.clock-steps { padding-left: 20px; }
.clock-steps li { margin: 6px 0; }
@media (max-width: 900px) {
  .clock-browse { grid-template-columns: minmax(0, 1fr); }
  .clock-pick { position: static; max-height: none; grid-row: 1; }
  /* the photo clicked: a sheet at the foot of the screen, over the photos, with room left for them beneath */
  .clock-pick.active { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 15; max-height: 52dvh;
                       border-radius: 12px 12px 0 0; box-shadow: 0 -4px 18px rgb(0 0 0 / .18); }
  .clock-browse:has(.clock-pick.active) { padding-bottom: 52dvh; }
  .clock-preview { max-height: 150px; }
}
@media (max-width: 640px) {
  table.cameras th:nth-child(3), table.cameras td:nth-child(3) { display: none; }
  .clock-tiles { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
}
@media (pointer: coarse) {
  .date-hint button, .date-hint summary, .age-answers button, .missed-photo button, .clock-real button,
  .clock-real input, .clock-actions .button, .clock-actions button, .clock-when a { min-height: 44px; }
  .clock-when a { display: inline-flex; align-items: center; }
}

/* Cleanup → Suggested dates (cleanup_dates.html): each scan beside what can tell its date, a button per suggestion */
.scan-dates { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 14px; }
.scan-date { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 12px;
             border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.scan-thumb { line-height: 0; align-self: start; }
.scan-thumb img { width: 120px; height: 120px; object-fit: contain; border-radius: 6px; background: var(--tile); }
.scan-about p { margin: 0 0 6px; }
.scan-name { overflow-wrap: anywhere; }
.scan-suggest { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.scan-type { margin: 8px 0 4px; }
.scan-type input { min-width: min(330px, 100%); }
.scan-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.scan-young { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.scan-young li { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scan-young img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--tile); }
.scan-young span { flex: 1 1 14em; }
@media (max-width: 560px) {
  .scan-date { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .scan-thumb img { width: 72px; height: 72px; }
}
@media (pointer: coarse) {
  .scan-suggest button, .scan-actions button, .scan-type button, .scan-type input, .scan-young button { min-height: 44px; }
}

/* ---- Albums, favorites, tours with stories (albums.py, favorites.py, slideshow.py; album.html, tour.html) ---- */
.player .title-card { display: grid; gap: 10px; justify-items: center; text-align: center; color: #fff; padding: 24px;
  animation: fade-in .6s; }
.player .title-card h2 { font-size: clamp(1.8rem, 5vw, 3.2rem); margin: 0; }
.player .title-card p { margin: 0; font-size: clamp(1rem, 2.4vw, 1.4rem); color: #ddd; }
@media (prefers-reduced-motion: reduce) { .player .title-card { animation: none; } }
.stage-button.heart { opacity: 1; font-size: 1.2rem; }
.stage-button.heart[aria-pressed="true"] { color: #ff6b81; }
.video-part { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.video-part progress { width: min(320px, 100%); }
.video-part .note { flex-basis: 100%; margin: 0; }
.album-about { font-size: 1.05rem; white-space: pre-line; margin: 4px 0; }
.album-new, .album-edit { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.album-edit label, .album-new label { display: grid; gap: 4px; flex: 1 1 260px; }
.album-links { margin: 6px 0; padding-left: 1.2rem; }
.album-photos { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.album-photo { display: grid; gap: 6px; align-content: start; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px; }
.album-photos[data-album] .album-photo { cursor: grab; }
/* held on a phone: picked up (app.js), not the phone's menu for the link or picture, nor words selected */
.album-photos[data-album] .tile { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  -webkit-user-drag: none; }
.album-photo.dragging { opacity: .45; border-color: var(--accent); border-style: dashed; }
.album-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; border-radius: 6px;
  overflow: hidden; opacity: .9; box-shadow: 0 8px 24px rgb(0 0 0 / .35); will-change: transform; }
.album-ghost img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.album-dragging { -webkit-user-select: none; user-select: none; }
body.album-dragging, body.album-dragging * { cursor: grabbing; }
.album-photo .tile { display: block; position: relative; }
.album-photo .tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px;
  background: var(--tile); }
.album-photo .said { margin: 0; font-size: .95rem; white-space: pre-line; }
.album-controls { display: flex; gap: 4px; }
.album-controls button { flex: 1; min-height: 32px; padding: 2px 6px; border: 1px solid var(--edge); }
.album-controls button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.album-caption input { width: 100%; box-sizing: border-box; }
@media (pointer: coarse) {
  .album-controls button { min-height: 44px; }
  .album-caption input { min-height: 44px; }
}
@media (max-width: 760px) { .album-photos { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }

/* ---- Person pages as a life story, and a deeper tree (person.html, _life_photos.html, _portraits.html): the portrait,
   the life story and notes, adopted and foster links, written sources, and the life by age ---- */
.portrait-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 4px 0 8px; }
.portrait { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--tile); flex: none; }
span.portrait { display: grid; place-items: center; font-size: 2rem; color: var(--muted); }
.portrait-pick > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none;
                          color: var(--accent); }
.portrait-pick > summary::-webkit-details-marker { display: none; }
.portrait-pick > summary:hover .portrait { outline: 2px solid var(--accent); outline-offset: 2px; }
.portrait-pick[open] > summary .portrait { outline: 2px solid var(--edge); outline-offset: 2px; }

/* Through the years (person_years.html, app.js): a face a year, lined up on the eyes, each fading in over the last
   (--fade, from the speed). The stage keeps the pictures' shape (400 x 500) and fits the screen's height. */
.years-modes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.years-modes small { opacity: .8; margin-left: 4px; }
.years-player { --fade: .9s; max-width: 760px; margin: 12px auto 0; }
.years-stage { position: relative; aspect-ratio: 4 / 5; width: min(100%, max(240px, (100dvh - var(--header-h) - 400px) * .8));
  margin: 0 auto; background: var(--stage); border-radius: 8px; overflow: hidden; touch-action: pan-y; }
.years-face { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0;
  transition: opacity var(--fade) ease-in-out; }
.years-face.on { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .years-face { transition: none; } }
.years-when { margin: 10px 0 0; text-align: center; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.years-when small { margin-left: 6px; font-size: 1rem; color: var(--muted); }
.years-photo { margin: 4px 0; text-align: center; color: var(--muted); }
.years-controls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 10px 0 4px; }
.years-controls [data-years-step] { min-width: 44px; font-size: 1.2rem; }
.years-speed { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.years-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 0; padding: 4px 2px;
  list-style: none; }
.years-strip button { display: grid; justify-items: center; gap: 2px; padding: 2px; border: 2px solid transparent;
  border-radius: 6px; background: none; color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.years-strip button[aria-current="true"] { border-color: var(--accent); color: var(--text); }
.years-strip img { display: block; width: 56px; height: 56px; border-radius: 4px; object-fit: cover; }
/* and as a panel on someone's Home (_years_panel.html): their face a year playing on its own, opening the whole */
.years-panel { display: flex; align-items: center; gap: 18px; max-width: 560px; margin: 18px 0 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
.years-panel:hover { text-decoration: none; border-color: var(--accent); }
.years-panel:hover .button.primary { filter: brightness(1.1); }
.years-panel-stage { --fade: .9s; position: relative; flex: none; width: 136px; aspect-ratio: 4 / 5; border-radius: 8px;
  overflow: hidden; background: var(--stage); }
.years-panel-text { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.years-panel-text b { font-size: 1.2rem; font-weight: 600; }
.years-panel-text > span { color: var(--muted); font-size: .9rem; }
.years-panel-text > .years-panel-year { color: var(--text); font-size: 1.7rem; font-variant-numeric: tabular-nums;
  line-height: 1.2; }
.years-panel-text > .button { margin-top: 4px; background: var(--accent); border-color: var(--accent);
  color: var(--on-accent); font-size: 1rem; }
@media (max-width: 760px) { .years-panel-stage { width: 112px; } .years-panel { gap: 14px; } }
.portrait-years { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 8px 0 0; color: var(--muted); }
.portrait-years a[aria-current] { font-weight: 600; color: var(--text); }
.portrait-mark { color: var(--accent); }
.portraits { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.portrait-choice { padding: 2px; border: 2px solid transparent; border-radius: 50%; background: none; line-height: 0; }
.portrait-choice img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.portrait-choice.on { border-color: var(--accent); }
.portrait-choice:hover, .portrait-choice:focus-visible { border-color: var(--edge); }
.story-panel, .sources-panel { margin: 12px 0 8px; max-width: 980px; }
.story-panel > summary, .sources-panel > summary, .notes-part > summary, #tree-media > summary { cursor: pointer;
  padding: 12px 0 2px; }
.story-panel > summary h2, .sources-panel > summary h2, #tree-media > summary h2, .notes-part > summary h3 {
  display: inline; margin: 0; }
.story-text { white-space: pre-line; font-size: 1.05rem; max-width: 70ch; margin: 10px 0; }
.story-form { display: grid; gap: 6px; max-width: 70ch; margin: 10px 0; }
.story-form button { justify-self: start; }
.story-panel textarea, .sources-panel input, .sources-panel select, .sources-panel textarea {
  font: inherit; padding: 4px 8px; border-radius: 6px; border: 1px solid var(--edge); background: var(--bg);
  color: var(--text); box-sizing: border-box; }
.story-panel textarea { width: 100%; }
.sources-panel textarea { width: min(60ch, 100%); }
.kind-form { display: inline; margin: 0; }
.kind-form select { font-size: .85rem; padding: 0 4px; }
.link.adopted > a, .link.foster > a { font-style: italic; }
ul.sources { list-style: none; margin: 8px 0; padding: 0; }
ul.sources > li { border-bottom: 1px solid var(--line); padding: 6px 0; }
.source-note { white-space: pre-line; color: var(--muted); margin: 4px 0 0; }
.source-edit > summary { cursor: pointer; color: var(--accent); display: inline; font-size: .9rem; }
.more-fields { flex-basis: 100%; }
.more-fields > summary { cursor: pointer; color: var(--accent); }
.more-fields[open] { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.more-fields[open] > summary { flex-basis: 100%; }
.life-story { margin: 20px 0; }
ol.life { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 3px solid var(--line); }
ol.life > .period { position: relative; margin: 0 0 14px; padding-left: 12px; }
ol.life > .period::before { content: ""; position: absolute; left: -22px; top: .55em; width: 13px; height: 13px;
  border-radius: 50%; background: var(--accent); }
ol.life > .period.aside::before { background: var(--edge); }
.period > h3 { margin: 0 0 4px; font-size: 1.1rem; }
.period > h3 small { color: var(--muted); font-weight: normal; }
ul.life-events { list-style: none; margin: 0 0 6px; padding: 0; }
ul.life-events > li { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.life-events .doc img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; vertical-align: middle; }
.source-mark { font-size: .85rem; padding: 0 8px; border-radius: 999px; background: var(--tile); color: var(--muted); }
.period-photos > summary { cursor: pointer; color: var(--accent); padding: 2px 0; }
.period-photos .grid { margin-top: 6px; }
.period-photos.more { margin-top: 6px; }
@media (pointer: coarse) {
  .portrait-choice img { width: 72px; height: 72px; }
  .period-photos > summary, .portrait-pick > summary, .source-edit > summary, .more-fields > summary,
  .notes-part > summary { min-height: 44px; display: flex; align-items: center; }
  .kind-form select, .sources-panel input, .sources-panel select { min-height: 44px; }
}

/* ---- AI on request (routes/ai.py, routes/tags.py): Describe again, More like this, a tag's changes ---- */
.like-this { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.like-this img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 3px; }
.describe-again { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.describe-again input { flex: 1 1 9em; min-width: 0; font: inherit; }
.tag-change { margin: 10px 0; }
.tag-change > summary { cursor: pointer; color: var(--accent); }
.tag-change form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
@media (pointer: coarse) {
  .describe-again input, .describe-again button, .tag-change > summary, .tag-change input,
  .tag-change button { min-height: 44px; }
}

/* ---- A shorter menu, first steps, plain words, light or dark, printing ---------------------------------------- */
/* the logo: the picture and the name, the picture alone on a phone; it always goes Home */
.brand { display: flex; flex: none; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 24px; height: 24px; border-radius: 6px; }
/* how the site looks (Colors, Photo tiles, Language), in the round button's panel at the top */
.theme-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; padding: 8px 0 2px;
              border-top: 1px solid var(--line); color: var(--muted); }
.theme-pick > span { flex-basis: 100%; font-size: .9rem; }
.theme-pick > .look-break { height: 0; }  /* Photo tiles: the sizes on a line of their own */
.theme-pick button { padding: 2px 10px; }
.theme-pick button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (max-width: 760px) {
  .top { gap: 10px; }
  .top .brand { display: flex; }
  .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (pointer: coarse) {
  .brand { min-width: 44px; min-height: 44px; justify-content: center; }
  .side a, .side-toggle { min-height: 44px; }
}

/* keyboard hints are for keyboards: none on a phone or tablet (the help's keys, "← → to step" on a photo) */
@media (hover: none) {
  .kbd-hint, dialog.help .keys-part { display: none; }
}

/* the first steps on a new LineageBox, on an admin's Home until they are done (_first_run.html) */
.first-run { margin: 12px 0 20px; padding: 14px 18px; max-width: 860px; background: var(--surface);
             border: 1px solid var(--accent); border-radius: 12px; }
.first-run h2 { margin: 0 0 4px; }
.first-steps { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 10px; }
.first-steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.first-steps .mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
                     border: 2px solid var(--edge); color: var(--muted); font-size: .85rem; font-weight: 700; }
.first-steps li.done .mark { border-color: var(--keep); background: var(--keep); color: #fff; }
.first-steps li.done .step-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--edge); }
.first-steps .step-title { font-weight: 600; }
.first-steps p { margin: 2px 0 0; }
.first-steps .step-note { color: var(--danger); }
.first-run-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 4px 0 0; }
.first-steps .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* the map's popups and boxes in the page's colors, so that dark reaches them (Leaflet draws them white); the map
   itself stays as the tile server draws it */
#map.leaflet-container { background: var(--tile); }
#map .leaflet-popup-content-wrapper, #map .leaflet-popup-tip { background: var(--surface); color: var(--text); }
#map .leaflet-popup-close-button { color: var(--muted); }
#map a { color: var(--accent); }
#map .leaflet-bar a { background-color: var(--surface); color: var(--text); border-bottom-color: var(--line); }
#map .leaflet-bar a:hover, #map .leaflet-bar a:focus { background-color: var(--tile); }
#map .leaflet-bar a.leaflet-disabled { background-color: var(--surface); color: var(--muted); }
#map .leaflet-control-layers { background: var(--surface); color: var(--text); }
#map .leaflet-control-layers-separator { border-top-color: var(--line); }
#map .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--muted); }

/* the tree's picture is drawn in the light colors (app.js treePicture): nothing fades while they are read */
.drawing, .drawing *, .drawing *::before, .drawing *::after { transition: none !important; }

/* printing: the light colors on white, without the top bar, the help or the message at the foot (the family book
   has its own, book.css). A person's page and the Family page print as a page about them: what is written, not the
   boxes and buttons to change it (filled-in boxes print as their words, empty ones not at all). */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    --bg: #fff; --surface: #fff; --text: #111; --muted: #555; --line: #ccc; --edge: #888; --accent: #1f4fa8;
    --on-accent: #fff; --tile: #eee; color-scheme: light;
  }
  body:not(.book-page) { background: #fff; color: #111; }
  body:not(.book-page) header.top, body:not(.book-page) .side, body:not(.book-page) .skip, body:not(.book-page) #notice,
  body:not(.book-page) .see-as, dialog.help { display: none !important; }
  body:not(.book-page) main { max-width: none; padding: 0; }
  :is(.person-page, .family-page) main :is(button:not(.chip.on), [type="submit"], .hint, .portrait-change,
    .portrait-pick > :not(summary), .read-panel, .years-link,
    #gedcom, #tree-media, audio, video, .story-record, .add-link, .fcard-open, .fcard-remove, .events-toggle, .people-filter, datalist,
    .kind-form select) { display: none !important; }
  :is(.person-page, .family-page) main :is(input, select, textarea) { border: 0; background: none; padding: 0;
    color: inherit; font: inherit; appearance: none; box-shadow: none; }
  :is(.person-page, .family-page) main :is(input, textarea):placeholder-shown { display: none !important; }
  :is(.person-page, .family-page) main button.chip.on { border: 0; background: none; color: inherit; padding: 0;
    font-weight: 600; }
  :is(.person-page, .family-page) a { color: inherit; text-decoration: none; }
  :is(.person-page, .family-page) :is(.panel, details, section, .fcard, .period, li) { break-inside: avoid; }
  :is(.person-page, .family-page) details > summary { list-style: none; }
  :is(.person-page, .family-page) details > summary::-webkit-details-marker { display: none; }
  :is(.person-page, .family-page) .fcard { border-color: #999; }
  .person-page main > form.name-form, .person-page .stories-panel:not(:has(.story)) { display: none !important; }
}

/* ---- Big pages in pieces, sharper tiles, ticking, keyboard and screen readers (_pieces.html, app.js) ------------- */
.pieced.scrubbed { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 14px; align-items: start; }
.pieced.scrubbed > .pieces { grid-column: 1; grid-row: 1; min-width: 0; }
/* the years and months at the side, which stay in view as the photos scroll */
.scrubber { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 8px); z-index: 4;
            max-height: calc(100dvh - var(--header-h) - 16px); overflow-y: auto; overscroll-behavior: contain;
            font-size: .9rem; font-variant-numeric: tabular-nums; scrollbar-width: thin; }
.scrubber ol { list-style: none; margin: 0; padding: 0; }
.scrubber a { display: block; padding: 2px 10px; border-radius: 6px; color: var(--muted); white-space: nowrap; }
.scrubber a:hover { background: var(--tile); text-decoration: none; }
.scrub-year > a { color: var(--text); font-weight: 600; }
.scrub-months { display: none; padding-left: 10px; }
.scrub-year.on > .scrub-months { display: block; }
.scrubber a[aria-current] { background: var(--accent); color: var(--on-accent); }
.scrubber a:focus-visible { outline-offset: -3px; }  /* inside the link: the rail scrolls, and would cut it off */
.pieces .tile, .pieces h2[id] { scroll-margin-top: calc(var(--header-h) + 12px); }
.pieces-earlier, .pieces-more { margin: 14px 0; text-align: center; }
.pieces-more .hint { color: inherit; }
@media (max-width: 760px) {
  /* a phone: a strip of years (and the months of the one in view) above the photos, under the top bar */
  .pieced.scrubbed { display: block; }
  .scrubber { top: var(--header-h); max-height: none; overflow-x: auto; overflow-y: hidden; margin: 0 -16px 8px;
              padding: 6px 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .scrubber > ol, .scrub-year, .scrub-year.on > .scrub-months { display: flex; gap: 2px; }
  .scrub-months { padding-left: 0; }
  .scrubber a { padding: 6px 10px; }
  .pieces .tile, .pieces h2[id] { scroll-margin-top: calc(var(--header-h) + 64px); }
}
@media (pointer: coarse) {
  .scrubber a { display: flex; align-items: center; min-height: 44px; }
  .pieces-earlier .button, .pieces-more .button { min-height: 44px; }
}
/* ticking: Shift and a click ticks from the last one, so the click mustn't select the page's text */
.grid.selectable .pick { -webkit-user-select: none; user-select: none; }
.ticked-count:empty { display: none; }
.select-bar { z-index: 3; }  /* the bar stays at the foot of the screen: over the photos' boxes, not under them */
.ticked-count { color: var(--text); }

/* the upload pickers' boxes are under their buttons, unseen: Tab reaches them, and the button shows the focus */
.file-pick { position: relative; overflow: hidden; }
.file-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-pick:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the slideshow is a dialog (app.js playTour): the whole screen, over everything */
dialog.player { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; }
dialog.player:not([open]) { display: none; }
dialog.player::backdrop { background: #000; }
.player .controls button:focus-visible { outline-color: #fff; }

/* the map's circles can be reached with Tab (map.js reachable) */
.leaflet-interactive:focus-visible { outline: none; stroke: var(--text); stroke-width: 4px; }

/* the help's switch for keys of one letter */
.keys-switch label { font-weight: 600; }
.keys-switch input { width: 1.1em; height: 1.1em; vertical-align: -2px; }

/* ---- A journey: an album read as a trip on the map (journeys.py, journey.html, journey.js) ---------------------- */
.journey-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0; }
.journey-near { color: var(--muted); font-size: .9rem; }
.journey-near .chip { font-size: .9rem; }
.journey-near .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* the way traveled: a dashed arc from each place to the next, drawn when the page opens (journey.js), with dots
   running along it afterwards the way the family went */
.journey-line { stroke: var(--accent); stroke-width: 4; opacity: .55; stroke-dasharray: 8 9; stroke-linecap: round; }
.journey-flow { stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: .1 18;
                animation: journey-flow 1.1s linear infinite; }
@keyframes journey-flow { to { stroke-dashoffset: -18.1; } }
.leaflet-marker-icon.journey-arrow { color: var(--accent); font-size: 1rem; line-height: 1; text-align: center;
                                     text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg); }
.leaflet-marker-icon.journey-pin { display: grid; place-items: center; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--accent); color: var(--text); font-weight: 700; font-size: .85rem;
  box-shadow: 0 1px 4px rgb(0 0 0 / .4); }
.leaflet-marker-icon.journey-pin.on { background: var(--accent); color: var(--on-accent); }
.leaflet-marker-icon.journey-dot { border-radius: 50%; background: var(--accent); border: 3px solid var(--surface);
  box-shadow: 0 0 10px 3px color-mix(in srgb, var(--accent) 65%, transparent); }
.folder-card .label.journey { color: var(--accent); }
.map-popup .said { margin: 4px 0; }
.journey-stops { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 10px; }
.journey-stop { display: flex; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface);
                border: 1px solid var(--line); }
.journey-stop.on { border-color: var(--accent);
                   box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.journey-n { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
             background: var(--accent); color: var(--on-accent); font-size: .85rem; }
.journey-what { flex: 1; min-width: 0; }
.journey-what h2 { margin: 0; font-size: 1.05rem; }
.journey-what h2 button { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left;
                          cursor: pointer; }
.journey-what h2 button:hover { color: var(--accent); }
.journey-what p { margin: 2px 0; }
.journey-photos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.journey-photo { display: block; width: 72px; height: 72px; }
.journey-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; background: var(--tile); }
.journey-photos .more { color: var(--muted); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .journey-flow { animation: none; } }
@media (pointer: coarse) { .journey-near .chip { min-height: 44px; display: inline-flex; align-items: center; } }

/* Settings → Address and HTTPS: the two ways to a name (a free address, a name of one's own), each a fold-out */
details.way { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 14px 0; }
details.way > summary { cursor: pointer; }
details.way > summary h3, details.way > summary h4 { display: inline; margin: 0; }
ol.steps { padding-left: 1.4em; }
ol.steps li + li { margin-top: 6px; }
details.way[open] > summary { margin-bottom: 10px; }
details.way h4 { margin: 18px 0 6px; }
