/* The signed-in app: shell, library, lightbox, tree, billing. */

body.app { background: var(--bg); }

/* --- auth screens -------------------------------------------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } }
/* The left half of the sign-in screen: a deep blue field with a soft bloom
   and a faint grid, so it reads as a distinct surface on an already dark page. */
.auth-side {
  background:
    radial-gradient(90% 70% at 15% 0%, rgba(47, 107, 255, .28), transparent 60%),
    linear-gradient(160deg, #121829, #090b12 65%);
  color: var(--ink);
  padding: clamp(2rem, 4vw, 4rem);
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
  border-right: 1px solid var(--line);
}
.auth-side::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--hairline) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 30% 25%, #000, transparent 75%);
  pointer-events: none;
}
.auth-side > * { position: relative; }
@media (max-width: 900px) { .auth-side { display: none; } }
.auth-side h2 { color: #fff; font-size: clamp(1.7rem, 1.2rem + 1.5vw, 2.5rem); }
.auth-side p { color: var(--ink-2); }
.auth-side .brand { color: #fff; }
.auth-side .auth-quote { color: var(--ink-2); }
.auth-quote { font-family: var(--display); font-size: 1.15rem; line-height: 1.5; }
.auth-quote cite { display: block; margin-top: .7rem; font-size: .82rem; font-style: normal; opacity: .65; font-family: var(--sans); }

.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; }
.auth-card { width: min(100%, 25rem); }
.auth-card h1 { font-size: 1.9rem; margin-bottom: .3rem; }
.auth-switch { margin-top: 1.4rem; font-size: .9rem; color: var(--muted); text-align: center; }

.demo-box {
  margin-top: 1.5rem; padding: .9rem 1rem;
  background: var(--accent-soft); border-radius: var(--radius); font-size: .84rem; color: var(--ink-2);
}
.demo-box b { display: block; margin-bottom: .35rem; color: var(--accent-text); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.demo-box button { background: none; border: none; padding: 0; font: inherit; color: var(--accent-text); cursor: pointer; text-decoration: underline; }

/* --- shell --------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } }

.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1rem .8rem 1.2rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 120;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(4, 5, 8, .62); z-index: 110; }
}

.side-brand { display: flex; align-items: center; gap: .5rem; padding: .3rem .5rem 1rem; text-decoration: none; color: var(--ink); }
.side-brand .brand-name { font-family: var(--display); font-size: 1.15rem; font-weight: 700; }

.family-switch { position: relative; margin-bottom: .8rem; }
.family-switch > button {
  width: 100%; text-align: left; display: flex; align-items: center; gap: .6rem;
  padding: .55rem .6rem; border-radius: var(--radius); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit;
}
.family-switch > button:hover { border-color: var(--accent); }
.family-switch .fs-name { font-weight: 700; font-size: .92rem; }
.family-switch .fs-role { font-size: .72rem; color: var(--muted); }
.family-menu {
  position: absolute; z-index: 60; top: calc(100% + .3rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .3rem; display: grid; gap: .1rem;
}
.family-menu button {
  width: 100%; text-align: left; background: none; border: none; font: inherit;
  padding: .5rem .55rem; border-radius: var(--radius-sm); cursor: pointer; color: var(--ink); font-size: .88rem;
}
.family-menu button:hover { background: var(--surface-2); }
.family-menu hr { margin: .3rem 0; }

.side-nav { display: grid; gap: .12rem; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .6rem; border-radius: var(--radius-sm);
  color: var(--ink-2); text-decoration: none; font-size: .92rem; font-weight: 500;
}
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a.is-active { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.side-nav a svg { flex: none; opacity: .8; }
.side-nav .badge {
  margin-left: auto; background: var(--accent); color: var(--accent-ink);
  font-size: .68rem; font-weight: 700; padding: .05rem .38rem; border-radius: 999px;
}
.side-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700; padding: 1rem .6rem .35rem; }
.side-foot { margin-top: auto; padding-top: 1rem; }

.usage-mini { padding: .7rem; background: var(--surface-2); border-radius: var(--radius); font-size: .76rem; color: var(--muted); }
.usage-mini .spread { margin-bottom: .4rem; }
.usage-mini b { color: var(--ink); }

/* --- top bar ------------------------------------------------------------- */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; gap: .7rem;
  padding: .7rem clamp(.9rem, 2vw, 1.6rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.topbar .search { position: relative; flex: 1 1 15rem; max-width: 26rem; }
.topbar .search input { padding-left: 2.1rem; background: var(--surface); }
.topbar .search svg { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.icon-btn {
  position: relative;
  width: 2.35rem; height: 2.35rem; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: .3rem; right: .35rem;
  min-width: 1rem; height: 1rem; padding: 0 .2rem; border-radius: 999px;
  /* --bad is tuned to be read as text on dark; as a fill behind white it is
     far too light, so the badge uses a deeper red of its own. */
  background: #d92d20; color: #fff; font-size: .62rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.menu-btn { display: none; }
@media (max-width: 900px) { .menu-btn { display: grid; } }

.dropdown {
  position: absolute; right: 0; top: calc(100% + .4rem); z-index: 90;
  min-width: 15rem; max-width: min(22rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: .3rem; display: grid; gap: .05rem;
}
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  padding: .5rem .55rem; border-radius: var(--radius-sm);
  background: none; border: none; font: inherit; font-size: .9rem; color: var(--ink); text-decoration: none; cursor: pointer;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); color: var(--ink); }
.dropdown .who { padding: .6rem .55rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.dropdown .who b { display: block; font-size: .9rem; }
.dropdown .who span { font-size: .78rem; color: var(--muted); }

.notif-list { max-height: 24rem; overflow-y: auto; }
.notif {
  display: block; padding: .6rem .55rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink); font-size: .86rem;
}
.notif:hover { background: var(--surface-2); }
.notif.is-unread { background: var(--accent-soft); }
.notif b { display: block; }
.notif span { color: var(--muted); font-size: .8rem; }
.notif time { display: block; color: var(--faint); font-size: .72rem; margin-top: .15rem; }

.view { padding: clamp(1.1rem, 2.5vw, 2rem) clamp(.9rem, 2vw, 1.6rem) 4rem; flex: 1; }
.view-head { margin-bottom: 1.4rem; }
.view-head h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin-bottom: .2rem; }
.view-head p { color: var(--muted); margin: 0; }

/* --- stat tiles ---------------------------------------------------------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .8rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; }
.stat b { display: block; font-family: var(--display); font-size: 1.9rem; line-height: 1.05; letter-spacing: -.03em; }
.stat span { font-size: .8rem; color: var(--muted); }

/* --- photo grid ---------------------------------------------------------- */
.filters {
  display: flex; gap: .55rem; flex-wrap: wrap; align-items: center;
  margin-bottom: 1.2rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--line);
}
.filters select, .filters input { width: auto; min-width: 8rem; }
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-size: .84rem; font-weight: 600; color: var(--ink-2);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip .x { opacity: .7; font-size: 1.1em; line-height: 1; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .7rem;
}
@media (max-width: 520px) { .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; } }

/* The tile is a container; .tile-open is the button that fills it. They were
   one element until the tick and the download control needed somewhere valid
   to live - a button cannot hold other buttons. */
.tile {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.tile-open {
  display: block; width: 100%; height: 100%; padding: 0; border: none;
  background: none; cursor: pointer; color: inherit; font: inherit;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tile:hover img { transform: scale(1.04); }

/* Both controls stay hidden until the tile is hovered or something inside it
   has focus, so the grid is photographs rather than chrome. A ticked tile
   keeps its checkbox visible, or there would be no way to untick it without
   hunting for it. */
.tile-pick, .tile-get {
  position: absolute; z-index: 2;
  opacity: 0; transition: opacity .14s ease;
}
.tile:hover .tile-pick, .tile:hover .tile-get,
.tile:focus-within .tile-pick, .tile:focus-within .tile-get,
.tile.is-picked .tile-pick { opacity: 1; }

.tile-pick {
  top: .45rem; left: .45rem; width: 1.15rem; height: 1.15rem;
  accent-color: var(--accent); cursor: pointer;
}
.tile-get {
  bottom: .45rem; right: .45rem;
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  background: rgba(8, 9, 13, .72); color: #fff; border-radius: 999px;
  backdrop-filter: blur(4px);
}
.tile-get:hover { background: var(--accent); color: var(--accent-ink); }
.tile.is-picked { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Appears only once something is ticked, and sticks to the top of the
   scroll so the count and the download stay reachable in a long library. */
.pick-bar {
  position: sticky; top: 3.6rem; z-index: 40;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-bottom: .9rem; padding: .6rem .8rem;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: var(--radius);
}
.tile figcaption {
  position: absolute; inset: auto 0 0 0; padding: 1.8rem .6rem .5rem;
  background: linear-gradient(transparent, rgba(4, 5, 8, .88));
  color: #fff; font-size: .78rem; text-align: left;
  opacity: 0; transition: opacity .16s ease;
}
.tile:hover figcaption, .tile:focus-visible figcaption { opacity: 1; }
.tile figcaption b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile figcaption span { opacity: .8; font-size: .72rem; }
.tile .corner {
  position: absolute; top: .4rem; right: .4rem; display: flex; gap: .25rem;
}
.tile .corner i {
  background: rgba(8, 9, 13, .72); color: #fff; border-radius: 999px;
  font-size: .68rem; font-style: normal; font-weight: 700; padding: .1rem .4rem;
  display: inline-flex; align-items: center; gap: .2rem; backdrop-filter: blur(4px);
}
.tile.is-selected { outline: 3px solid var(--accent); outline-offset: 2px; }

.year-head {
  grid-column: 1 / -1;
  font-family: var(--display); font-size: 1.3rem; font-weight: 700;
  padding: 1.2rem 0 .2rem; border-top: 1px solid var(--line); margin-top: .6rem;
  display: flex; align-items: baseline; gap: .6rem;
}
.year-head:first-child { border-top: none; margin-top: 0; padding-top: 0; }
.year-head span { font-family: var(--sans); font-size: .78rem; color: var(--muted); font-weight: 500; }

/* --- lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed; inset: 0; z-index: 160;
  background: rgba(4, 5, 8, .94);
  display: grid; grid-template-columns: 1fr 22rem;
  animation: fade-in .16s ease;
}
@media (max-width: 1000px) { .lightbox { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } }

.lb-stage { position: relative; display: grid; place-items: center; padding: 1.5rem; min-height: 0; min-width: 0; }
.lb-figure { position: relative; max-width: 100%; max-height: 100%; line-height: 0; }
.lb-figure img { max-width: 100%; max-height: calc(100vh - 3rem); object-fit: contain; border-radius: 4px; }
@media (max-width: 1000px) { .lb-figure img { max-height: 55vh; } }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 2.8rem; height: 2.8rem; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; border: none; cursor: pointer;
  display: grid; place-items: center; backdrop-filter: blur(6px);
}
.lb-nav:hover { background: rgba(255, 255, 255, .24); }
.lb-nav.prev { left: .8rem; }
.lb-nav.next { right: .8rem; }
.lb-close { position: absolute; top: .8rem; left: .8rem; z-index: 3; }

.lb-tag {
  position: absolute;
  border: 2px solid rgba(255, 253, 248, .92);
  border-radius: 5px;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .15s ease;
  pointer-events: auto;
}
.lb-figure.show-tags .lb-tag, .lb-tag.is-pinned { opacity: 1; }
.lb-tag b {
  position: absolute; left: 50%; top: calc(100% + 5px); transform: translateX(-50%);
  background: rgba(8, 9, 13, .92); color: #fff; font-size: .7rem; font-weight: 600;
  padding: .14rem .45rem; border-radius: 4px; white-space: nowrap;
  display: flex; align-items: center; gap: .3rem;
}
.lb-tag b button { background: none; border: none; color: rgba(255,255,255,.65); cursor: pointer; padding: 0 0 0 .1rem; font-size: .9em; line-height: 1; }
.lb-tag b button:hover { color: #fff; }
.lb-tag.is-draft { border-color: var(--accent); border-style: dashed; opacity: 1; }
.lb-tag.is-draft b { background: var(--accent); }

.lb-figure.is-tagging { cursor: crosshair; }
.lb-figure.is-tagging img { user-select: none; -webkit-user-drag: none; }

.tag-hint {
  position: absolute; top: .8rem; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--accent-ink);
  padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  z-index: 4; white-space: nowrap; box-shadow: var(--shadow);
}

.lb-side {
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
  overflow-y: auto;
}
@media (max-width: 1000px) { .lb-side { border-left: none; border-top: 1px solid var(--line); max-height: 42vh; } }
.lb-side section { padding: 1rem 1.1rem; border-bottom: 1px solid var(--line); }
.lb-side section:last-child { border-bottom: none; }
.lb-side h2 { font-size: 1.15rem; margin-bottom: .2rem; }
.lb-meta { font-size: .82rem; color: var(--muted); display: grid; gap: .25rem; }
.lb-meta div { display: flex; gap: .5rem; }
.lb-meta dt { color: var(--faint); min-width: 5.2rem; }

.people-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.person-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .25rem .6rem .25rem .25rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--ink); text-decoration: none;
}
.person-chip:hover { border-color: var(--accent); color: var(--ink); }
.person-chip .avatar { --size: 22px; font-size: .6rem; }
.person-chip .x { color: var(--faint); font-weight: 400; }
.person-chip .x:hover { color: var(--bad); }

.reactions { display: flex; gap: .3rem; flex-wrap: wrap; }
.react-btn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: .25rem .6rem; font-size: .9rem; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center;
}
.react-btn:hover { border-color: var(--accent); }
.react-btn.is-mine { background: var(--accent-soft); border-color: var(--accent-text); color: var(--accent-text); }
.react-btn small { font-weight: 700; font-size: .74rem; }

.comment { display: flex; gap: .6rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.comment:last-of-type { border-bottom: none; }
.comment .body { font-size: .87rem; }
.comment .body b { font-size: .84rem; }
.comment .body time { color: var(--faint); font-size: .74rem; margin-left: .35rem; }
.comment .del { margin-left: auto; opacity: 0; background: none; border: none; color: var(--faint); cursor: pointer; }
.comment:hover .del { opacity: 1; }

/* --- person picker ------------------------------------------------------- */
.picker {
  position: absolute; z-index: 6; width: 17rem;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.picker-head { padding: .5rem .6rem; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.picker-head .now-tagging { font-size: .74rem; color: var(--muted); }
.picker-head .now-tagging b { color: var(--accent-text); }
.picker input { border: none; border-radius: 0; background: var(--surface); padding: .55rem .7rem; }
.picker input:focus { box-shadow: none; }
.picker-list { max-height: 15rem; overflow-y: auto; }
.picker-list button {
  display: flex; align-items: center; gap: .55rem; width: 100%; text-align: left;
  padding: .45rem .6rem; background: none; border: none; font: inherit; font-size: .88rem; cursor: pointer; color: var(--ink);
}
.picker-list button:hover, .picker-list button.is-active { background: var(--accent-soft); color: var(--accent-text); }
.picker-list button .count { margin-left: auto; font-size: .72rem; color: var(--faint); }
.picker-list .new { color: var(--accent-text); font-weight: 600; border-top: 1px solid var(--line); }
.picker-foot { padding: .45rem .6rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--faint); }

/* --- upload -------------------------------------------------------------- */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem; text-align: center; color: var(--muted);
  background: var(--surface-2); transition: border-color .15s, background .15s;
  cursor: pointer;
}
.dropzone.is-over { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }
.dropzone h3 { color: var(--ink); margin-bottom: .3rem; }

.upload-item {
  display: grid; grid-template-columns: 74px 1fr auto; gap: .8rem; align-items: start;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.upload-item img { width: 74px; height: 74px; object-fit: cover; border-radius: var(--radius-sm); }
.upload-item .field { margin-bottom: .5rem; }
.upload-item .bar { height: 4px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin-top: .4rem; }
.upload-item .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.upload-item.is-done { opacity: .6; }

/* --- family tree ---------------------------------------------------------
   Cards are absolutely positioned over an SVG connector layer, both inside a
   canvas that the camera transforms as one. Coordinates come from
   tree-layout.js, so nothing here may change size without changing CARD_W /
   CARD_H there - the lines would stop meeting the cards. */
.tree-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem 0; border-bottom: 1px solid var(--line); margin-bottom: .2rem;
}
.tree-search-wrap { position: relative; }
.tree-search {
  width: 15rem; max-width: 45vw; padding: .42rem .7rem; font: inherit; font-size: .85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
}
.tree-search-results {
  position: absolute; z-index: 5; top: calc(100% + .3rem); left: 0; width: 16rem; max-width: 70vw;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden;
}
.tree-search-hit {
  display: flex; align-items: center; gap: .5rem; width: 100%; padding: .45rem .6rem;
  background: none; border: 0; font: inherit; font-size: .85rem; color: var(--ink); text-align: left; cursor: pointer;
}
.tree-search-hit:hover { background: var(--surface-2); }
.tree-focus-chip {
  display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--ink-2);
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 999px; padding: .2rem .3rem .2rem .7rem;
}
.tree-chip-x {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 1rem; line-height: 1; padding: 0 .35rem;
}
.tree-chip-x:hover { color: var(--ink); }

.tree-stage {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  height: min(72vh, 720px); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.tree-stage.is-panning { cursor: grabbing; }
.tree-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.tree-links { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.tree-cards { position: absolute; top: 0; left: 0; }

/* Line TYPE is carried by shape, not colour: a partnership is the double
   rule, a descent is the single one. Colour then says WHICH parents a line
   comes from, so the two channels answer different questions and the chart
   still works for anyone who cannot separate the hues. */
.lnk { fill: none; }
.lnk-descent { stroke: var(--tone-0); stroke-width: 1.8; }
.lnk-spouse { stroke: var(--accent); stroke-width: 1.5; }
.lnk-node { fill: var(--tone-0); stroke: none; }

/* Eight tones, cycled in reading order so neighbouring branches never
   collide. Mid-lightness on purpose - each has to hold its own against both
   the light and the dark surface, since the app ships several palettes. */
:root {
  --tone-0: #c2565f;
  --tone-1: #3d8ea8;
  --tone-2: #7d9b3c;
  --tone-3: #b5762a;
  --tone-4: #8a6bb1;
  --tone-5: #2f9e8f;
  --tone-6: #c15887;
  --tone-7: #5b7fbd;
}
.lnk-descent.tone-0, .lnk-node.tone-0 { stroke: var(--tone-0); }
.lnk-descent.tone-1, .lnk-node.tone-1 { stroke: var(--tone-1); }
.lnk-descent.tone-2, .lnk-node.tone-2 { stroke: var(--tone-2); }
.lnk-descent.tone-3, .lnk-node.tone-3 { stroke: var(--tone-3); }
.lnk-descent.tone-4, .lnk-node.tone-4 { stroke: var(--tone-4); }
.lnk-descent.tone-5, .lnk-node.tone-5 { stroke: var(--tone-5); }
.lnk-descent.tone-6, .lnk-node.tone-6 { stroke: var(--tone-6); }
.lnk-descent.tone-7, .lnk-node.tone-7 { stroke: var(--tone-7); }
.lnk-node.tone-0 { fill: var(--tone-0); }
.lnk-node.tone-1 { fill: var(--tone-1); }
.lnk-node.tone-2 { fill: var(--tone-2); }
.lnk-node.tone-3 { fill: var(--tone-3); }
.lnk-node.tone-4 { fill: var(--tone-4); }
.lnk-node.tone-5 { fill: var(--tone-5); }
.lnk-node.tone-6 { fill: var(--tone-6); }
.lnk-node.tone-7 { fill: var(--tone-7); }

.tree-card {
  position: absolute; width: 190px; height: 96px; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .14s, box-shadow .14s;
}
.tree-card:hover { border-color: var(--accent); box-shadow: var(--shadow); z-index: 2; }
.tree-card-hit {
  display: flex; align-items: center; gap: .55rem; width: 100%; height: 100%;
  padding: .6rem .7rem; background: none; border: 0; cursor: pointer;
  font: inherit; color: var(--ink); text-align: left;
}
.tree-card-text { min-width: 0; }
.tree-card b { font-size: .88rem; display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-card small { font-size: .72rem; color: var(--muted); display: block; }
.tree-side {
  display: inline-block; margin-top: .25rem; font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: .05rem .4rem;
}
.tree-card.is-me { border-color: var(--accent); }
.tree-card.is-deceased .avatar { filter: grayscale(1); opacity: .85; }
.tree-card.is-loose { border-style: dashed; }

/* The side tint is a second channel only - every one of these also carries
   its wording in .tree-side, so nothing depends on colour being seen. */
.tree-card.side-focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-line); }
.tree-card.side-focus .tree-side { color: var(--accent-text); border-color: var(--accent); }
.tree-card.side-maternal { border-left: 3px solid #c2739b; }
.tree-card.side-paternal { border-left: 3px solid #5f8fbf; }
.tree-card.side-ancestor { border-left: 3px solid var(--line-strong); }
.tree-card.side-descendant { border-left: 3px solid #6aa87f; }
.tree-card.side-sibling { border-left: 3px dotted var(--line-strong); }
.tree-card.side-partner { border-left: 3px double var(--accent); }

.tree-fold {
  position: absolute; right: .3rem; bottom: .3rem; z-index: 3;
  min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem;
  font: inherit; font-size: .7rem; font-weight: 700; line-height: 1;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
}
.tree-fold:hover { color: var(--ink); border-color: var(--accent); }
.tree-fold.is-folded { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }

.tree-key {
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
  padding: .6rem .1rem 0; font-size: .72rem; color: var(--muted);
}
.tree-key-item { display: inline-flex; align-items: center; gap: .35rem; }
.tree-key-line { overflow: visible; }

@media (max-width: 700px) {
  .tree-stage { height: 62vh; }
  .tree-search { width: 100%; max-width: none; }
  .tree-search-wrap { flex: 1 1 100%; }
}

.person-head { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.5rem; }
.person-head .avatar { --size: 76px; }

/* --- billing ------------------------------------------------------------- */
.current-plan {
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 1.5rem;
}
.current-plan .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.current-plan .price { font-family: var(--display); font-size: 2.4rem; letter-spacing: -.03em; line-height: 1; }
.renewal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin-top: 1.4rem; }
.renewal-grid > div { border-top: 1px solid var(--line); padding-top: .7rem; }
.renewal-grid dt { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: .2rem; }
.renewal-grid dd { margin: 0; font-size: .98rem; font-weight: 600; }
.renewal-grid dd small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }

.plan-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.plan-option {
  text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  padding: 1rem; cursor: pointer; font: inherit; color: var(--ink); position: relative;
  transition: border-color .14s, transform .14s;
}
.plan-option:hover { border-color: var(--accent); transform: translateY(-2px); }
.plan-option.is-current { border-color: var(--accent); background: var(--accent-soft); }
.plan-option b { display: block; font-family: var(--display); font-size: 1.15rem; }
.plan-option .p { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; margin: .3rem 0 .1rem; }
.plan-option small { color: var(--muted); font-size: .78rem; }
.plan-option .now { position: absolute; top: .6rem; right: .6rem; }

.method-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.method-row:last-child { border-bottom: none; }
.method-row .grow b { font-size: .92rem; }
.method-row .grow small { display: block; color: var(--muted); font-size: .78rem; }

.card-preview {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 85% -10%, rgba(47, 107, 255, .55), transparent 60%),
    linear-gradient(140deg, #1b2135, #0d1018);
  border: 1px solid var(--line-strong);
  color: #fff; border-radius: var(--radius-lg); padding: 1.2rem 1.3rem;
  font-family: var(--mono); box-shadow: var(--shadow);
  display: grid; gap: .9rem; margin-bottom: 1.2rem;
}
.card-preview::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .05) 50%, transparent 60%);
  pointer-events: none;
}
.card-preview .num { font-size: 1.15rem; letter-spacing: .1em; }
.card-preview .foot { display: flex; justify-content: space-between; font-size: .74rem; opacity: .85; }
.card-preview .brand { font-family: var(--sans); font-weight: 800; letter-spacing: .04em; text-align: right; }

.method-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .5rem; }
.method-choice button {
  display: flex; align-items: center; gap: .5rem; padding: .55rem .6rem;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer; color: var(--ink); text-align: left;
}
.method-choice button:hover { border-color: var(--accent); }
.method-choice button.is-on { border-color: var(--accent-text); background: var(--accent-soft); color: var(--accent-text); }

.invoice-status { font-weight: 700; font-size: .78rem; }
.invoice-status.paid { color: var(--good); }
.invoice-status.open { color: var(--warn); }
.invoice-status.refunded { color: var(--muted); }

.receipt { font-family: var(--sans); }
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.receipt-total { display: flex; justify-content: space-between; padding: .5rem 0; }
.receipt-total.grand { border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .7rem; font-weight: 700; font-size: 1.1rem; }

/* --- mail ---------------------------------------------------------------- */
.mail-layout { display: grid; grid-template-columns: 20rem 1fr; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .mail-layout { grid-template-columns: 1fr; } }
.mail-item {
  display: block; width: 100%; text-align: left; padding: .7rem .8rem; border: none;
  background: none; border-bottom: 1px solid var(--line); cursor: pointer; font: inherit; color: var(--ink);
}
.mail-item:hover { background: var(--surface-2); }
.mail-item.is-active { background: var(--accent-soft); }
.mail-item b { display: block; font-size: .88rem; }
.mail-item span { font-size: .78rem; color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-frame { width: 100%; height: 34rem; border: none; background: #fff; border-radius: var(--radius); }

/* --- misc ---------------------------------------------------------------- */
.two-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.2rem; align-items: start; }

/* --- the location editor -------------------------------------------------- */
.geo-results {
  margin-top: .35rem; max-height: 15rem; overflow-y: auto;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
}
.geo-hit {
  display: block; width: 100%; padding: .45rem .6rem; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--line);
  font: inherit; color: var(--ink); cursor: pointer;
}
.geo-hit:last-child { border-bottom: 0; }
.geo-hit:hover { background: var(--surface-2); }
.geo-hit b { display: block; font-size: .88rem; }
.geo-hit span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo-hit.muted { color: var(--muted); cursor: default; }
.geo-chosen {
  margin-top: .45rem; padding: .5rem .65rem;
  border: 1px solid var(--accent-line); border-radius: var(--radius-sm); background: var(--accent-soft);
}
.geo-suggest {
  display: flex; align-items: center; gap: .5rem;
  margin: .5rem 0 .8rem; padding: .45rem .6rem;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  font-size: .82rem;
}

/* --- the pin picker -------------------------------------------------------
   A small map with one draggable pin. Dragging the PIN moves the pin;
   dragging anywhere else moves the map. Keeping those apart is what stops a
   clumsy pan from silently relocating somebody's photograph. */
.pp { position: relative; margin: .6rem 0 .2rem; }
.pp-surface {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  height: 240px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.pp-surface.is-panning { cursor: grabbing; }
.pp-tiles { position: absolute; inset: 0; }
.pp-tile { position: absolute; width: 256px; height: 256px; user-select: none; pointer-events: none; }

/* The pin is anchored at its point, not its middle, so the tip sits on the
   coordinate it represents. */
.pp-pin {
  position: absolute; z-index: 3; width: 22px; height: 22px; padding: 0;
  transform: translate(-50%, -100%);
  background: var(--accent); border: 2px solid #fff; cursor: grab;
  border-radius: 50% 50% 50% 0; rotate: -45deg;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
}
.pp-pin:hover, .pp-pin:focus-visible { filter: brightness(1.15); outline: none; }
.pp-pin:focus-visible { box-shadow: 0 0 0 3px var(--accent-line), 0 2px 6px rgba(0, 0, 0, .45); }
.pp-pin.is-dragging { cursor: grabbing; filter: brightness(1.2); }

.pp-controls { position: absolute; top: .5rem; right: .5rem; z-index: 4; display: grid; gap: .25rem; }
.pp-zoom {
  width: 1.9rem; height: 1.9rem; display: grid; place-items: center;
  font: inherit; font-size: 1rem; line-height: 1; cursor: pointer;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.pp-zoom:hover { border-color: var(--accent); }
.pp-hint { margin-top: .35rem; font-size: .72rem; color: var(--muted); }

/* Filters sit above the map rather than over it: a dropdown floating on the
   tiles is unusable on a phone, where the map is most of the screen. */
.map-filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .6rem; }
.map-filter {
  padding: .35rem .55rem; font: inherit; font-size: .82rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
}
@media (max-width: 640px) { .map-filter { flex: 1 1 8rem; min-width: 0; } }

/* --- sharing, connections and succession --------------------------------- */
.connect-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.35rem; font-weight: 700; letter-spacing: .18em;
  color: var(--ink); user-select: all;
}
/* A standing state somebody needs to read before they act on the panel -
   a nomination waiting on them, or a claim on the archive in progress. */
.notice {
  border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: .7rem .9rem; margin-bottom: .8rem;
  background: var(--surface-2);
}
.notice b { display: block; margin-bottom: .2rem; }
.notice p { margin: .2rem 0 0; color: var(--ink-2); }
.notice-warn { border-left-color: var(--warn); }
/* For a notice about something irreversible - deleting an archive, losing an
   album - rather than something merely worth knowing. */
.notice-bad { border-left-color: var(--bad); }
.notice-bad ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.notice-bad li { margin: .15rem 0; }
/* Borrowed photographs carry the owning family's name on the tile, so the
   corner badge has to hold a word rather than a count. */
.tile .corner i { max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 940px) { .two-col { grid-template-columns: 1fr; } }

.setting-row { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.setting-row:last-child { border-bottom: none; }
.setting-row .grow b { display: block; font-size: .92rem; }
.setting-row .grow small { color: var(--muted); font-size: .82rem; }

.switch { position: relative; width: 2.6rem; height: 1.5rem; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong);
  transition: background .18s;
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 1.1rem; height: 1.1rem;
  background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(1.1rem); }
.switch input:focus-visible + i { outline: 2.5px solid var(--accent); outline-offset: 2px; }

.activity-item { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .88rem; }
.activity-item:last-child { border-bottom: none; }
.activity-item time { color: var(--faint); font-size: .76rem; margin-left: auto; white-space: nowrap; }

.code-box {
  font-family: var(--mono); font-size: 1.3rem; letter-spacing: .18em; font-weight: 700;
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: .8rem 1rem; text-align: center; color: var(--accent-text);
}
/* --- the photograph tree --------------------------------------------------
   A trunk down the middle, an arm per decade or event sweeping off it, and a
   twig per photograph. All of it is one SVG whose coordinates come from
   timeline-layout.js, so nothing here may change a size without changing the
   geometry there - the thumbnails would stop meeting their twigs. */
.tl-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem 0; border-bottom: 1px solid var(--line); margin-bottom: .2rem;
}
.tl-bar select { width: auto; min-width: 11rem; }

.tl-stage {
  position: relative; overflow: hidden; touch-action: none; cursor: grab;
  height: min(76vh, 780px);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.tl-stage.is-panning { cursor: grabbing; }
.tl-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.tl-sheet { display: block; overflow: visible; }

/* The trunk is the one thing that is not a branch colour: it is the spine
   everything else hangs from, so it stays quiet. */
.tl-trunk { stroke: var(--line-strong); stroke-width: 5; stroke-linecap: round; fill: none; }

/* Two passes over the same path give the taper: a wide soft one for the
   thickness near the trunk, a narrow solid one over it for the tip. */
.tl-arm { fill: none; stroke-linecap: round; }
.tl-arm-base { stroke-width: 7; opacity: .28; }
.tl-arm-tip { stroke-width: 2.4; }

.tl-twig { stroke-width: 1.4; opacity: .75; }

.tl-thumb { cursor: pointer; }
.tl-thumb-ring { fill: none; stroke-width: 2; opacity: .9; }
.tl-thumb:hover .tl-thumb-ring,
.tl-thumb:focus-visible .tl-thumb-ring { stroke-width: 3.5; opacity: 1; }
.tl-thumb:focus-visible { outline: none; }
.tl-thumb image { transition: opacity .12s; }
.tl-thumb:hover image { opacity: .85; }

.tl-label {
  font-family: var(--display); font-size: 15px; font-weight: 700;
  paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px;
}
.tl-sublabel {
  font-size: 11px; fill: var(--muted);
  paint-order: stroke; stroke: var(--surface-2); stroke-width: 3px;
}

.tl-gap { stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 3 5; }
.tl-gap-label { font-size: 11px; fill: var(--faint); }

.tl-undated-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(6rem, 1fr));
  gap: .6rem; margin-top: .6rem;
}
.tl-undated {
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; overflow: hidden; font: inherit; text-align: left;
}
.tl-undated:hover { border-color: var(--accent); }
.tl-undated img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.tl-undated span {
  display: block; padding: .35rem .45rem; font-size: .72rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 700px) {
  .tl-stage { height: 66vh; }
  .tl-bar select { flex: 1 1 100%; width: 100%; }
}


/* --- memories map ---------------------------------------------------------
   Tiles are plain images positioned on a grid; pins are buttons over the top.
   Both are re-laid on every pan rather than transformed, so a pin can never
   drift away from the ground it belongs to. */
.map-bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .7rem 0; border-bottom: 1px solid var(--line); margin-bottom: .2rem;
}
.map-surface {
  position: relative; overflow: hidden; cursor: grab;
  /* pan-y, NOT none. `none` handed every touch to the map, so a finger
     landing on something that fills most of a phone screen panned the map
     instead of scrolling the page, with no way past it. This lets the
     browser keep one-finger scrolling while two-finger gestures still reach
     the map - see public/js/gestures.js. */
  touch-action: pan-y;
  height: min(70vh, 680px); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.map-surface.is-panning { cursor: grabbing; }
.map-tiles, .map-pins { position: absolute; inset: 0; }
.map-pins { pointer-events: none; }
.map-tile {
  position: absolute; width: 256px; height: 256px;
  user-select: none; -webkit-user-drag: none;
}
.map-pin {
  position: absolute; pointer-events: auto;
  width: 1.5rem; height: 1.5rem; transform: translate(-50%, -100%);
  padding: 0; cursor: pointer;
  background: var(--accent); color: #fff;
  border: 2px solid #fff; border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  box-shadow: 0 2px 6px rgb(0 0 0 / .4);
  font: inherit; font-size: .65rem; font-weight: 700; line-height: 1;
}
.map-pin span { display: block; rotate: 45deg; }
.map-pin.is-many { width: 1.9rem; height: 1.9rem; font-size: .72rem; }
.map-pin:hover { filter: brightness(1.15); z-index: 2; }
.map-credit { margin: .5rem .1rem 0; font-size: .7rem; color: var(--faint); }
.map-credit a { color: var(--muted); }

@media (max-width: 700px) { .map-surface { height: 60vh; } }

/* --- cancelling ----------------------------------------------------------
   Its own panel at the foot of the billing screen. The one irreversible
   action on the page should not sit in a row of ghost buttons next to
   "All invoices". */
.cancel-panel { border-color: var(--line-strong); }
.cancel-steps {
  margin: 0; padding-left: 1.2rem;
  display: grid; gap: .9rem; font-size: .9rem;
}
.cancel-steps li { padding-left: .2rem; }
.cancel-steps li::marker { color: var(--muted); font-weight: 700; }
.cancel-steps b { display: block; margin-bottom: .15rem; }

/* The permanence warning on the share dialog. Deliberately loud: it is the
   only moment anybody can still change their mind. */
.share-warning {
  margin-top: .2rem; padding: .7rem .8rem;
  border: 1px solid var(--warn); border-radius: var(--radius);
  background: var(--warn-soft);
}
.share-warning > b { color: var(--warn); }

/* Picking photographs for a timeline event. A dense grid of thumbnails that
   toggle, because filling a wedding means looking at fifty pictures at once
   rather than reading fifty filenames. */
.event-pick-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: .45rem; max-height: 52vh; overflow-y: auto;
  padding: .3rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.event-pick {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--radius-sm);
  background: none; cursor: pointer; aspect-ratio: 1; overflow: hidden; line-height: 0;
}
.event-pick img { width: 100%; height: 100%; object-fit: cover; opacity: .55; transition: opacity .12s; }
.event-pick:hover img { opacity: .8; }
.event-pick.is-on { border-color: var(--accent); }
.event-pick.is-on img { opacity: 1; }
.event-pick:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Marks the ones the date already claimed, so a tick never looks arbitrary. */
.event-pick-auto {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: color-mix(in srgb, var(--ink) 65%, transparent); color: var(--surface);
  font-size: .58rem; letter-spacing: .04em; text-transform: uppercase;
  line-height: 1.5; padding: .05rem .2rem;
}
