:root {
  --bg: #f6f5f2; --panel: #ffffff; --ink: #1d1d1b; --soft: #66645e; --line: #e3e1db; --tile: #e9e7e1;
  --accent: #2f5d50; --accent-ink: #ffffff; --chip: #ecebe6; --danger: #a33a2c;
  --nav-w: 216px; --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
}
:root[data-theme="dark"] { --bg: #151514; --panel: #1f1f1d; --ink: #f1efea; --soft: #a3a097; --line: #2f2e2b; --tile: #262624; --accent: #7fb6a4; --accent-ink: #10201b; --chip: #2a2a27; --danger: #e0806f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) { --bg: #151514; --panel: #1f1f1d; --ink: #f1efea; --soft: #a3a097; --line: #2f2e2b; --tile: #262624; --accent: #7fb6a4; --accent-ink: #10201b; --chip: #2a2a27; --danger: #e0806f; } }
:root[data-theme="dark"] { color-scheme: dark; } :root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.text-link { font-weight: 600; color: var(--accent); }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#app { display: flex; height: 100%; }

/* Navigation: sidebar on wide screens, tab bar on phones */
#nav { width: var(--nav-w); flex: none; display: flex; flex-direction: column; gap: 2px; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--bg); }
#nav a { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 8px; font-weight: 500; color: var(--soft); }
#nav a svg { width: 21px; height: 21px; flex: none; }
#nav a:hover { background: var(--chip); color: var(--ink); }
#nav a.on { background: var(--chip); color: var(--ink); font-weight: 650; }
#nav .brand { height: 48px; margin-bottom: 14px; color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
#nav .brand:hover { background: none; }
#nav .brand img { width: 28px; height: 28px; }
#nav a[data-page="settings"] { margin-top: auto; }
main { flex: 1; min-width: 0; position: relative; }

@media (max-width: 760px) {
  #app { flex-direction: column-reverse; }
  #nav { width: 100%; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); }
  #nav .brand, #nav .wide { display: none; }
  #nav a { flex-direction: column; gap: 3px; height: 52px; padding: 6px 8px; font-size: 11px; justify-content: center; flex: 1; }
  #nav a[data-page="settings"] { margin-top: 0; }
  #nav a.on { background: none; color: var(--accent); }
}

/* Page frame */
.page { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 24px;
  background: var(--bg);
  transition: box-shadow .15s ease; }
/* Dave's one exception to "no drop shadows" (2026-11-28): a soft shadow under the header once the page is scrolled. */
.page.scrolled .head { box-shadow: 0 1px 0 var(--line), 0 6px 14px -8px rgba(0, 0, 0, .18); }
:root[data-theme="dark"] .page.scrolled .head { box-shadow: 0 1px 0 var(--line), 0 6px 14px -8px rgba(0, 0, 0, .55); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .page.scrolled .head, :root[data-theme="system"] .page.scrolled .head { box-shadow: 0 1px 0 var(--line), 0 6px 14px -8px rgba(0, 0, 0, .55); } }
.head h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; flex: 1; }
.head .sub { color: var(--soft); font-size: 14px; font-weight: 500; }
.body { padding: 4px 24px 40px; }
@media (max-width: 760px) { .head { padding: 10px 14px; min-height: 54px; } .head h1 { font-size: 20px; } .body { padding: 4px 14px 32px; } }

/* Justified grid (virtual) */
.grid { position: relative; margin: 0 48px 0 24px; }
@media (max-width: 760px) { .grid { margin: 0 2px; } }
.tile { position: absolute; top: 0; left: 0; overflow: hidden; background: var(--tile); cursor: pointer; contain: strict; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .18s ease; }
.tile img.in { opacity: 1; }
.tile:focus { outline: none; }
.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; z-index: 2; }
.tile .badge { position: absolute; right: 6px; bottom: 5px; color: #fff; font-size: 12px; font-weight: 650; display: flex; align-items: center; gap: 4px;
  text-shadow: 0 0 0 transparent; background: rgba(0,0,0,.45); padding: 2px 6px; border-radius: 6px; }
.tile .badge svg { width: 12px; height: 12px; fill: #fff; stroke: none; }
.tile.noimg::after { content: attr(data-fmt); position: absolute; inset: 0; display: grid; place-items: center; color: var(--soft); font-size: 12px; font-weight: 650; text-transform: uppercase; }
.month { position: absolute; left: 0; font-size: 15px; font-weight: 700; letter-spacing: -0.005em; display: flex; align-items: flex-end; padding-bottom: 8px; }
.month span { color: var(--soft); font-weight: 500; margin-left: 8px; }
.empty { padding: 80px 24px; text-align: center; color: var(--soft); line-height: 1.6; }
.empty strong { display: block; color: var(--ink); font-size: 18px; margin-bottom: 6px; }

/* Year scrubber */
.scrub { position: absolute; top: 72px; bottom: 16px; right: 0; width: 44px; z-index: 6; cursor: ns-resize; touch-action: none; }
.scrub .year { position: absolute; right: 10px; font-size: 11px; font-weight: 650; color: var(--soft); transform: translateY(-50%); pointer-events: none; }
.scrub .label { position: absolute; right: 46px; transform: translateY(-50%); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 650; padding: 5px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.scrub.active .label, .scrub:hover .label { opacity: 1; }
/* The marker is a short bar on the very edge, beside the years, never across their text. */
.scrub .thumbline { position: absolute; right: 2px; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; transform: translateY(-50%); pointer-events: none; }
@media (max-width: 760px) { .scrub { width: 30px; } .scrub .year { display: none; } .scrub .label { right: 32px; } .scrub .thumbline { width: 5px; height: 28px; } }

/* Search */
.searchbar { flex: 1; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); max-width: 680px; }
.searchbar svg { width: 19px; height: 19px; color: var(--soft); flex: none; }
.searchbar input { flex: 1; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--chip); font-size: 13px; font-weight: 600; border: 0; cursor: pointer; }
.chip small { color: var(--soft); font-weight: 500; }
.chip.on { background: var(--accent); color: var(--accent-ink); }
.suggest { padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 8px; }

/* People */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 22px 16px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; text-align: center; }
.face { width: 112px; height: 112px; border-radius: 50%; overflow: hidden; position: relative; background: var(--tile); flex: none; }
.face img { position: absolute; max-width: none; }
.person b { font-size: 14px; font-weight: 650; } .person small { color: var(--soft); font-size: 12px; margin-top: -5px; }

/* Lists, settings */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-bottom: 16px; max-width: 760px; }
/* Settings use the whole width: cards flow into as many even columns as fit. */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr)); gap: 16px; align-items: stretch; }
.settings .card { max-width: none; margin: 0; }
.settings .card.wide { grid-column: 1 / -1; }
.card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.card p { margin: 4px 0 12px; color: var(--soft); font-size: 14px; line-height: 1.5; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row small { color: var(--soft); }
.row > svg { width: 18px; height: 18px; flex: none; color: var(--soft); }
.btn { height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--chip); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn:disabled { opacity: .5; cursor: default; }
.field { height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); font: inherit; font-size: 15px; color: var(--ink); outline: 0; min-width: 0; }
.field:focus { border-color: var(--accent); }
select.field { appearance: none; -webkit-appearance: none; padding: 0 38px 0 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366645e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: right 14px center; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; word-break: break-all; background: var(--chip); padding: 10px 12px; border-radius: 9px; user-select: all; }
.stat { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.stat div { background: var(--bg); border-radius: 10px; padding: 10px 12px; } .stat b { display: block; font-size: 20px; } .stat small { color: var(--soft); font-size: 12px; }
.places li { list-style: none; } .places { padding: 0; margin: 0; }
.place-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.place-row img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--tile); }
.place-row .grow { flex: 1; } .place-row small { color: var(--soft); display: block; margin-top: 2px; }
.country { font-size: 13px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; margin: 22px 0 4px; }

/* Viewer */
#viewer { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; color: #fff; }
#viewer .stage { flex: 1; position: relative; overflow: hidden; touch-action: pan-y; }
#viewer .stage img, #viewer .stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
#viewer .bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: 12px 14px; z-index: 3; background: linear-gradient(rgba(0,0,0,.45), transparent); }
#viewer .bar .when { flex: 1; font-weight: 650; font-size: 15px; } #viewer .bar .when small { display: block; font-weight: 500; opacity: .75; font-size: 12.5px; }
.vbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.vbtn:hover { background: rgba(255,255,255,.22); } .vbtn svg { width: 20px; height: 20px; }
.vnav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; }
.vnav.prev { left: 14px; } .vnav.next { right: 14px; }
@media (hover: none) { .vnav { display: none; } }
#viewer .info { width: 340px; flex: none; background: var(--panel); color: var(--ink); overflow-y: auto; padding: 20px; border-left: 1px solid var(--line); }
#viewer .info[hidden] { display: none; }
#viewer .info h3 { margin: 18px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
#viewer .info h3:first-child { margin-top: 0; }
#viewer .info .line { font-size: 14px; line-height: 1.5; } #viewer .info .line small { color: var(--soft); display: block; }
#viewer .facebox { position: absolute; border: 2px solid rgba(255,255,255,.85); border-radius: 6px; pointer-events: none; z-index: 2; }
#viewer .facebox span { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 4px; background: rgba(0,0,0,.65); padding: 2px 7px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
@media (max-width: 760px) { #viewer { flex-direction: column; } #viewer .info { width: 100%; max-height: 52%; border-left: 0; border-top: 1px solid var(--line); } }

/* In-page windows and messages (never browser pop-ups) */
#sheet { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(0,0,0,.35); padding: 20px; }
#sheet .win { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(440px, 100%); max-height: 86vh; overflow: auto; }
#sheet .win h2 { margin: 0 0 8px; font-size: 18px; } #sheet .win p { color: var(--soft); margin: 0 0 16px; line-height: 1.5; font-size: 14px; }
#sheet .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 11px; font-size: 14px; font-weight: 600; max-width: 90vw; }
@media (max-width: 760px) { #toast { bottom: 90px; } }

/* Sign in */
.signin { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg); z-index: 40; }
.signin .box { width: min(380px, 100%); text-align: center; }
.signin img { width: 64px; height: 64px; } .signin h1 { margin: 16px 0 6px; font-size: 26px; letter-spacing: -0.02em; }
.signin p { color: var(--soft); line-height: 1.5; margin: 0 0 22px; }
.signin .btn { width: 100%; height: 46px; font-size: 16px; }
.signin .err { color: var(--danger); margin-top: 14px; font-size: 14px; min-height: 20px; }

/* Grid shape switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--chip); transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--soft); transition: transform .15s, background .15s; }
.switch input:checked ~ .track { background: var(--accent); }
.switch input:checked ~ .track::after { transform: translateX(14px); background: var(--accent-ink); }
.switch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.head .sub .num { color: var(--ink); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.chip.tagchip { display: inline-flex; align-items: center; gap: 0; padding: 0; }
.chip.tagchip .tagname { border: 0; background: none; color: inherit; font: inherit; padding: 0 0 0 12px; height: 100%; cursor: pointer; }
.chip.tagchip .tagname:only-child { padding-right: 12px; }
.chip.tagchip .tagx { border: 0; background: none; color: var(--soft); font: inherit; font-size: 15px; line-height: 1; padding: 0 10px 0 6px; height: 100%; cursor: pointer; }
.chip.tagchip .tagx:hover { color: var(--ink); }
.section-title { font-size: 15px; font-weight: 700; margin: 6px 0 12px; letter-spacing: -.01em; }
.section-title + .albums { margin-bottom: 26px; }
.shape-toggle { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--chip); gap: 2px; }
.shape-toggle button { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font-size: 13px; font-weight: 600; color: var(--soft); cursor: pointer; }
.shape-toggle button.on { background: var(--panel); color: var(--ink); }
@media (max-width: 760px) { .head .sub { display: none; } .head .sub.keep { display: inline; font-size: 13px; } .shape-toggle button { padding: 0 9px; } .switch .lbl { font-size: 12px; } }

/* Selecting several photos */
.tile .check { position: absolute; top: 7px; left: 7px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.95); background: rgba(0,0,0,.18); display: none; place-items: center; z-index: 1; }
.tile .check svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3; opacity: 0; }
.selecting .tile .check { display: grid; }
.tile.sel .check { background: var(--accent); border-color: var(--accent); }
.tile.sel .check svg { opacity: 1; }
.tile.sel img { transform: scale(.9); border-radius: 6px; }
.tile img { transition: opacity .18s ease, transform .12s ease; }
.selbar { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; font-weight: 650; font-size: 14px; white-space: nowrap; }
.selbar .count { margin-right: 8px; }
@media (max-width: 760px) { .selbar { bottom: 84px; left: 10px; right: 10px; transform: none; padding-left: 12px; } .selbar .count { flex: 1; } .selbar .btn { padding: 0 10px; } }

/* Photos from someone else's shared library: a thin ring in that person's color (no shadow, 0-offset ring). */
:root { --lib1: #d0902a; --lib2: #4a7fc1; --lib3: #c25b7a; --lib4: #7d63b8; }
:root[data-theme="dark"] { --lib1: #e8b04b; --lib2: #79a8e6; --lib3: #e48aa6; --lib4: #a990e0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) { --lib1: #e8b04b; --lib2: #79a8e6; --lib3: #e48aa6; --lib4: #a990e0; } }
/* Subtle: a 2 px ring at 60% strength. */
.tile[data-lib]::after { content: ''; position: absolute; inset: 0; border: 2px solid color-mix(in srgb, var(--libc) 60%, transparent); pointer-events: none; z-index: 1; }
.tile.noimg[data-lib]::after { content: attr(data-fmt); display: grid; place-items: center; }
[data-lib="1"] { --libc: var(--lib1); } [data-lib="2"] { --libc: var(--lib2); } [data-lib="3"] { --libc: var(--lib3); } [data-lib="4"] { --libc: var(--lib4); }
.libseg { display: inline-flex; align-items: center; padding: 3px; border-radius: 10px; background: var(--chip); gap: 2px; }
.libseg button { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--soft); cursor: pointer; white-space: nowrap; }
.libseg button:hover { color: var(--ink); }
.libseg button.on { background: var(--panel); color: var(--ink); }
.libseg .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--libc); flex: none; }
.libseg .dot.own { background: var(--accent); }
.libseg .libpal { width: 30px; padding: 0; justify-content: center; margin-left: 2px; }
.libseg .colordot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--panel); outline: 1px solid var(--line); }
.libseg .libpal:hover .colordot { outline-color: var(--soft); }
.colorpanel { position: fixed; z-index: 70; width: 300px; padding: 14px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.cp-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin-bottom: 10px; }
.cp-row + .cp-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cp-name { font-size: 14px; font-weight: 650; margin-bottom: 8px; }
.cp-swatches { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cp-sw { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; background: var(--c); cursor: pointer; transition: transform .1s ease; }
.cp-sw:hover { transform: scale(1.1); }
.cp-sw.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ink); }
.cp-sw.custom { background: conic-gradient(#e5484d, #f5a524, #e8d44d, #46a758, #2f9bb0, #4a7fc1, #8e4ec6, #e5484d); overflow: visible; }
.cp-sw.custom[style] { background: var(--c); }
.cp-sw.custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.cp-note { margin-top: 12px; font-size: 12px; color: var(--soft); }
@media (max-width: 760px) { .libseg button { padding: 0 9px; } .head { flex-wrap: wrap; } }

.no-rings .tile[data-lib]::after { border-color: transparent; }

/* ---- 2026-11-28 feature batch ---- */
#nav .navgap { height: 12px; }
#nav a.narrow { display: none; }
@media (max-width: 760px) { #nav a.narrow { display: flex; } #nav .navgap { display: none; } }
.btn { display: inline-flex; align-items: center; gap: 6px; }
.btn svg { width: 17px; height: 17px; }
.tile .favmark { position: absolute; left: 6px; bottom: 6px; z-index: 2; width: 18px; height: 18px; color: #fff; pointer-events: none; }
.tile .favmark svg { width: 18px; height: 18px; fill: #fff; stroke: rgba(0,0,0,.35); stroke-width: 1.2; }
.vbtn.faved svg { fill: #ff5a6e; stroke: #ff5a6e; }
.vbtn.live { width: auto; padding: 0 12px; border-radius: 20px; font-size: 12px; font-weight: 750; letter-spacing: .06em; }
#viewer .stage video.liveclip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; pointer-events: none; }
.selbar { flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 20px); }
.popmenu { position: fixed; z-index: 95; min-width: 210px; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; }
.popmenu button { text-align: left; height: 38px; padding: 0 12px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; color: var(--ink); }
.popmenu button:hover { background: var(--chip); }
.picklist { display: flex; flex-direction: column; gap: 4px; max-height: 42vh; overflow: auto; }
.pickrow { display: flex; align-items: center; gap: 12px; padding: 6px; border: 0; border-radius: 10px; background: none; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
.pickrow:hover { background: var(--chip); }
.pickrow img, .pickblank { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--tile); flex: none; }
.pickrow small { display: block; color: var(--soft); font-size: 12px; margin-top: 2px; }
.picklist.small .pickrow { padding: 6px 8px; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form > label:not(.check):not(.inline) { font-size: 13px; font-weight: 650; color: var(--soft); margin-bottom: -4px; }
.form small { color: var(--soft); line-height: 1.45; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.check.row { padding: 8px 0; align-items: flex-start; }
.check.row small { color: var(--soft); }
.inline { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.chosen { font-size: 14px; font-weight: 600; }
.albums { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 22px 16px; }
.albumcard { display: flex; flex-direction: column; gap: 4px; }
.albumcard .cover { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--tile); display: grid; place-items: center; color: var(--soft); margin-bottom: 6px; }
.albumcard .cover img { width: 100%; height: 100%; object-fit: cover; }
.albumcard .cover svg { width: 40px; height: 40px; }
.albumcard b { font-size: 14px; } .albumcard small { color: var(--soft); font-size: 12px; }
.look { margin-bottom: 22px; }
.lookhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.lookhead small { color: var(--soft); font-size: 13px; }
.lookhead .btn { height: 30px; font-size: 13px; }
.lookrow { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.lookrow .tile { flex: none; border-radius: 6px; contain: none; }
.lookrow .tile img { opacity: 1; cursor: pointer; }
.mapbox { height: min(58vh, 560px); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--tile); }
.mapmark { width: 54px; height: 54px; border-radius: 10px; overflow: visible; border: 2px solid #fff; background: var(--tile); }
.mapmark img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.mapmark span { position: absolute; top: -8px; right: -10px; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.leaflet-container a { text-decoration: none; }
.changelog .entry { padding: 12px 0; border-top: 1px solid var(--line); }
.changelog .entry:first-of-type { border-top: 0; }
.changelog .when { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); margin-bottom: 4px; }
.changelog ul { margin: 6px 0 0; padding-left: 20px; color: var(--ink); font-size: 14px; line-height: 1.6; }

/* Appearance switch in Settings */
.themes { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--chip); gap: 2px; margin-top: 4px; }
.themes button { height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--soft); cursor: pointer; }
.themes button.on { background: var(--panel); color: var(--ink); }

/* Hover a photo: its circle appears; clicking it starts selecting (2026-11-29). */
@media (hover: hover) { .tile:hover .check { display: grid; } .tile .check { cursor: pointer; } .tile:hover .check:hover { background: rgba(0,0,0,.4); } }
/* Lookalikes: a clear selected state, the circle always shown and easy to hit. */
.lookrow .tile .check { width: 28px; height: 28px; top: 8px; left: 8px; cursor: pointer; }
.lookrow .tile.sel { outline: 3px solid var(--accent); outline-offset: -3px; }
.lookrow .tile.sel img { opacity: .55; transform: none; border-radius: 0; }
.lookrow .tile img { cursor: zoom-in; }

/* Settings › Damaged files */
.damaged-list { display: flex; flex-direction: column; gap: 2px; margin-top: 14px; max-width: 900px; }
.damaged-list .row { display: flex; align-items: center; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.damaged-list .fname { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.damaged-list small { color: var(--soft); }
.body > p.note { color: var(--soft); max-width: 760px; line-height: 1.5; margin: 0; }

/* Settings › Dropbox: one block per connected Dropbox */
.dbxlink { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.dbxhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.dbxhead small { color: var(--soft); }

/* Photos page title: click to rename */
.head h1 .pagetitle { cursor: text; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; }
.head h1 .pagetitle:hover { background: var(--chip); }
.head h1 .titleinput { font: inherit; letter-spacing: inherit; color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 1px 6px; margin: -2px -7px; width: min(420px, 100%); outline: none; }
.head h1 .titleinput:focus { border-color: var(--accent); }

/* Settings › Sharing › one person */
.person-sharing h3 { margin: 16px 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.person-sharing .albumroles { max-height: 44vh; overflow: auto; }
.person-sharing .albumroles .row { display: flex; align-items: center; gap: 12px; }
.person-sharing .albumroles small { color: var(--soft); }
.person-sharing .note { color: var(--soft); font-size: 13px; margin: 8px 0 0; }

/* Search with nothing typed: sections */
.searchhome { padding: 4px 24px 40px; display: flex; flex-direction: column; gap: 26px; }
.searchhome .sx { min-width: 0; }
.searchhome .sxhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.searchhome .sxmore { font-size: 13px; font-weight: 650; color: var(--accent); text-decoration: none; }
.searchhome .suggest { padding: 0; }
.otd { display: flex; gap: 22px; overflow-x: auto; }
.otdyear { flex: none; display: flex; flex-direction: column; gap: 8px; }
.otdlabel { display: flex; align-items: baseline; gap: 8px; }
.otdlabel b { font-size: 14px; } .otdlabel small { color: var(--soft); font-size: 12px; }
.otdthumbs { display: flex; gap: 4px; }
.otdthumb { position: relative; width: 132px; height: 132px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--tile); cursor: pointer; flex: none; }
.otdthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.otdplay { position: absolute; right: 6px; bottom: 6px; } .otdplay svg { width: 14px; height: 14px; fill: #fff; stroke: none; }
.people.mini { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px 12px; }
.people.mini .person b { font-size: 13px; }
.placecards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.placecard { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); }
.placecard img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; background: var(--tile); display: block; }
.placecard span { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.placecard b { font-size: 14px; } .placecard small { color: var(--soft); font-size: 12px; }
.chip.clearchip { background: none; border: 1px dashed var(--line); color: var(--soft); cursor: pointer; font: inherit; }
@media (max-width: 760px) { .searchhome { padding: 4px 14px 32px; gap: 22px; } .otdthumb { width: 104px; height: 104px; } .placecards { grid-template-columns: repeat(2, 1fr); } }

/* No scroll bars anywhere (Dave, 2026-11-29). Everything still scrolls by wheel, trackpad, touch and keyboard. */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* Rows that scroll sideways show faded edges with arrows instead (sideScroller in app.js). */
.sidescroll { position: relative; }
.sidescroll .sidearrow { position: absolute; top: 0; bottom: 0; width: 56px; border: 0; padding: 0; display: flex; align-items: center; cursor: pointer;
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; color: var(--ink); }
.sidescroll .sidearrow.left { left: 0; justify-content: flex-start; background: linear-gradient(to right, var(--bg) 25%, transparent); }
.sidescroll .sidearrow.right { right: 0; justify-content: flex-end; background: linear-gradient(to left, var(--bg) 25%, transparent); }
.sidescroll .sidearrow svg { width: 30px; height: 30px; padding: 6px; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); box-sizing: border-box; }
.sidescroll.more-left .sidearrow.left, .sidescroll.more-right .sidearrow.right { opacity: 1; pointer-events: auto; }

/* Hidden unlocked: a small mark beside Hidden in the menu (click to lock), and the Hidden albums section on Albums */
#nav a .navlock { margin-left: auto; font: inherit; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--chip); border: 0; border-radius: 999px; padding: 2px 8px; cursor: pointer; }
#nav a .navlock:hover { color: var(--danger); }
.hiddenhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.hiddenhead .section-title { margin: 0; }

/* Audit round (2026-11-29): Undo in messages, zoom, slideshow, Name faces, Activity */
#toast { display: flex; align-items: center; gap: 14px; } #toast[hidden] { display: none; }
#toast .toastbtn { font: inherit; font-weight: 700; color: inherit; background: none; border: 1px solid currentColor; border-radius: 8px; padding: 3px 10px; cursor: pointer; }
#viewer .vbtn.on { background: #fff; color: #000; }
#viewer .zoomwrap { position: absolute; inset: 0; overflow: auto; z-index: 2; background: #000; cursor: grab; display: grid; touch-action: pan-x pan-y pinch-zoom; }
#viewer .zoomwrap:active { cursor: grabbing; }
#viewer .zoomwrap img { position: static; inset: auto; max-width: none; object-fit: fill; margin: auto; display: block; user-select: none; }
.facetile { background: none; border: 0; font: inherit; color: inherit; padding: 0; }
.facetile small { color: var(--soft); font-size: 12px; margin-top: 0; }
.facecontext { display: block; width: 100%; max-height: 42vh; object-fit: contain; border-radius: 10px; background: var(--tile); margin-bottom: 12px; }
.activity { max-width: 900px; }
.activity .row { display: flex; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.activity small { color: var(--soft); } .activity .at { flex: none; }
/* Dropbox folders: name and status on their own line, the controls on the line below (nothing gets squeezed). */
.dbxlink .row { flex-wrap: wrap; row-gap: 8px; }
.dbxlink .row .grow { flex: 1 0 100%; min-width: 0; }
.dbxlink .row .field { margin-left: auto; }
#viewer:focus { outline: none; }
.win .parts { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.perfpanel { position: fixed; left: 8px; bottom: 8px; z-index: 50; background: var(--ink); color: var(--bg); font: 12px/1.5 ui-monospace, monospace; padding: 6px 10px; border-radius: 8px; pointer-events: none; opacity: .9; }
/* Phone header: two rows, not three (Upload no longer wraps onto a row of its own). */
.btn.upload svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.upload { gap: 6px; }
@media (max-width: 760px) { .wide-only { display: none; } .head { gap: 8px; } .btn.upload { padding: 0 11px; } }
.sortbtn .stack { display: inline-grid; } .sortbtn .stack > span { grid-area: 1 / 1; text-align: center; } .sortbtn .stack > .ghost { visibility: hidden; }
.card .card-sub { margin: 18px 0 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--soft); }
.card .card-note { display: block; margin-top: 8px; color: var(--soft); }
.accents { display: flex; flex-wrap: wrap; gap: 12px; padding: 4px; }
