/* Drollery — playful sticker look. Colors are CSS variables: mode via [data-theme], highlight via [data-accent]. */
:root {
  color-scheme: light dark;            /* follows the system; the menu pins it with data-theme (below) */
  /* every colour is light-dark(light value, dark value): the palette is written once */
  --bg: light-dark(#fbf7ef, #15141a); --s1: light-dark(#ffffff, #1d1c24); --s2: light-dark(#f1ebdd, #272531);
  --chip: light-dark(#eee7d6, #000); --chip-ring: light-dark(rgba(40,30,10,.22), rgba(255,255,255,.38)); --chip-tx: light-dark(#26222e, #fff);
  --chip-x: light-dark(#e5383b, #ff4d52); --chip-fld: light-dark(#ffffff, #23222c);
  --ln: light-dark(rgba(40,30,10,.12), rgba(255,255,255,.1)); --ln2: light-dark(rgba(40,30,10,.26), rgba(255,255,255,.22));
  --tx: light-dark(#26222e, #f1eef8); --tx2: light-dark(#5e586c, #b0abc2); --tx3: light-dark(#675f76, #a19cb4);
  --ac: #ffb800; --ac-on: #16120a;
  --ac-ink: light-dark(color-mix(in srgb, var(--ac), black 42%), color-mix(in srgb, var(--ac), white 22%));
  --ok: light-dark(#23895a, #6fd09a); --bad: light-dark(#c43d33, #ff8a80);
  --k-image: light-dark(#e0267d, #ff5fa8); --k-video: light-dark(#0a84e0, #3db5ff); --k-audio: light-dark(#0e9e55, #3fe086);
  --k-album: light-dark(#d9660a, #ffa23d); --k-gif: light-dark(#8a3fd9, #b58cff); --k-movie: light-dark(#d23c2e, #ff7a6b);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --tex-vig: radial-gradient(ellipse 120% 90% at 50% 15%, transparent 50%, light-dark(rgba(130,85,20,.12), rgba(0,0,0,.38)));
  --tex-mottle: none;
  /* the two wall pictures are images, which light-dark() cannot switch everywhere yet: they are set per theme (dark first) */
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0.3 0 0 0 -.1'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23n)'/%3E%3C/svg%3E");
  --tex-blocks: url("/static/stone-dark.svg");
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.25 0 0 0 0 0.1 0.4 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23n)'/%3E%3C/svg%3E");
    --tex-blocks: url("/static/stone-light.svg");
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --tex-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' x='0' y='0' width='100%' height='100%'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.25 0 0 0 0 0.1 0.4 0 0 0 -.14'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23n)'/%3E%3C/svg%3E");
  --tex-blocks: url("/static/stone-light.svg");
}
:root[data-theme="dark"] { color-scheme: dark; }
/* highlight colors: fully saturated; text on them is dark, except white on the two deepest (grape, indigo) to keep 4.5:1 */
:root[data-accent="gold"] { --ac: #ffb800; }
:root[data-accent="tomato"] { --ac: #ff3d2e; }
:root[data-accent="pink"] { --ac: #ff2d87; }
:root[data-accent="grape"] { --ac: #9b3dff; }
:root[data-accent="indigo"] { --ac: #4457ff; }
:root[data-accent="sky"] { --ac: #00a2ff; }
:root[data-accent="teal"] { --ac: #00c9a7; }
:root[data-accent="mint"] { --ac: #1fd65f; }
:root[data-accent="lime"] { --ac: #a3e000; }
:root[data-accent="orange"] { --ac: #ff7a00; }
:root[data-accent="grape"], :root[data-accent="indigo"] { --ac-on: #fff; }

* { box-sizing: border-box; }
body { margin: 0; color: var(--tx); font: 400 16px/24px var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--bg); }
/* backdrop: a weathered stone wall (night stone in dark mode, limestone in light), generated by scripts/gen_stone.py */
body {
  background-image: var(--tex-grain), var(--tex-blocks), var(--tex-mottle);
  background-size: 200px 200px, 960px 480px, 600px 600px;
}
/* the darkened edges stay put while the page scrolls: a fixed layer of their own. (A fixed background-attachment makes the browser
   repaint the whole wall on every scroll step, which was several times slower.) */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--tex-vig); }
a { color: var(--ac-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2 { font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 36px; }
h2 { font-size: 20px; line-height: 28px; }
code, .mono, kbd { font-family: inherit; font-size: 14px; }
.meta, .folio, .seg i, .side summary i { font-variant-numeric: tabular-nums; }
.muted { color: var(--tx2); } .bad { color: var(--bad); }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; border-radius: 6px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 2px solid var(--ln); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.brand { position: relative; font: 600 22px/28px var(--sans); color: var(--tx); letter-spacing: -.01em; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 32px; height: 32px; image-rendering: pixelated; }          /* the fixed app icon: it does not follow the highlight colour */
nav { display: flex; align-items: center; gap: 4px; }
nav form { margin: 0; }
.nav-link, .icon-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 12px; color: var(--tx2);
  font: 500 14px/20px var(--sans); background: none; border: 0; cursor: pointer; list-style: none;
  transition: color .15s var(--ease), background-color .15s var(--ease); }
.nav-link:hover, .icon-btn:hover, .menu[open] > .icon-btn { color: var(--tx); background: var(--s2); text-decoration: none; }
.icon-btn { width: 36px; padding: 0; justify-content: center; color: var(--ac-ink); }
.icon-btn .ic { width: 20px; height: 20px; }
.icon-btn::-webkit-details-marker { display: none; }
main { max-width: 1280px; width: 100%; margin: 0 auto; padding: 24px; flex: 1; }

/* header ornament: a row of tiny medieval scenery standing on the header's bottom edge, fading out at both ends */
.orn { flex: 1; align-self: flex-end; height: 46px; margin: 0 40px; background: var(--ac); opacity: .62;
  -webkit-mask-image: url("/static/skyline.svg"), linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  -webkit-mask-size: auto 46px, 100% 100%; -webkit-mask-repeat: repeat-x, no-repeat; -webkit-mask-position: center bottom, 0 0; -webkit-mask-composite: source-in;
  mask-image: url("/static/skyline.svg"), linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-size: auto 46px, 100% 100%; mask-repeat: repeat-x, no-repeat; mask-position: center bottom, 0 0; mask-composite: intersect; }
@media (max-width: 760px) { .orn { display: none; } }

/* appearance menu */
.menu { position: relative; margin-left: 4px; }
.pop { position: absolute; right: 0; top: 44px; width: 264px; padding: 16px; background: var(--s1); border: 2px solid var(--ln); border-radius: 20px;
  box-shadow: 0 12px 32px rgba(0,0,0,.28); animation: pop .14s var(--ease); z-index: 20; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.pop-h { margin: 0 0 8px; font: 500 12px/16px var(--sans); color: var(--tx3); }
.pop-h:not(:first-child) { margin-top: 16px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--s2); border-radius: 14px; }
.modes button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border: 0; border-radius: 10px; background: none;
  color: var(--tx2); font: 500 12px/16px var(--sans); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.modes button:hover { color: var(--tx); }
.modes button[aria-pressed="true"] { background: var(--ac); color: var(--ac-on); }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sw { aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; color: transparent; padding: 0;
  background: var(--c); transition: border-color .12s var(--ease); }
.sw:hover { border-color: var(--tx2); }
.sw[aria-pressed="true"] { color: var(--sw-on, #16120a); border-color: var(--tx); box-shadow: inset 0 0 0 2px var(--s1); }
.sw-gold { --c: #ffb800; } .sw-tomato { --c: #ff3d2e; } .sw-pink { --c: #ff2d87; } .sw-grape { --c: #9b3dff; } .sw-indigo { --c: #4457ff; } .sw-sky { --c: #00a2ff; } .sw-teal { --c: #00c9a7; } .sw-mint { --c: #1fd65f; } .sw-lime { --c: #a3e000; } .sw-orange { --c: #ff7a00; }
.sw-grape, .sw-indigo { --sw-on: #fff; }

/* controls */
input, textarea, select { font: inherit; font-size: 14px; line-height: 20px; color: var(--tx); background: var(--s1); border: 2px solid var(--ln);
  border-radius: 12px; padding: 10px 14px; width: 100%; transition: border-color .15s var(--ease); }
input::placeholder, textarea::placeholder { color: var(--tx3); }
input:hover, textarea:hover { border-color: var(--ln2); }
input:focus-visible, textarea:focus-visible { outline: none; border-color: var(--ac); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 20px; border-radius: 12px; cursor: pointer;
  font: 500 14px/20px var(--sans); color: var(--tx); background: var(--s2); border: 2px solid var(--ln);
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), box-shadow .1s var(--ease); }
.btn:hover { border-color: var(--ln2); }
.btn.primary { background: var(--ac); color: var(--ac-on); border-color: transparent; box-shadow: 0 3px 0 color-mix(in srgb, var(--ac), black 38%); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 0 color-mix(in srgb, var(--ac), black 38%); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--ac), black 38%); }
.btn.danger { background: transparent; color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
kbd { color: var(--tx3); border: 2px solid var(--ln); border-radius: 6px; padding: 0 6px; line-height: 18px; }

/* add bar */
.add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
.drop { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; height: 64px; border: 2px dashed color-mix(in srgb, var(--ac) 60%, transparent);
  border-radius: 16px; color: var(--tx2); font-size: 14px; font-weight: 500; cursor: pointer; background: color-mix(in srgb, var(--ac) 6%, var(--s1));
  transition: border-color .15s var(--ease), background-color .15s var(--ease), color .15s var(--ease); }
.drop .ic { color: var(--ac-ink); width: 20px; height: 20px; }
.drop:hover, .drop.over { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 16%, var(--s1)); color: var(--tx); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; padding: 0; }
.drop u { text-decoration-color: var(--ac); text-underline-offset: 3px; }
.field { position: relative; display: flex; align-items: center; gap: 8px; }
.field > .ic { position: absolute; left: 14px; color: var(--tx3); pointer-events: none; }
.field > input { padding-left: 40px; height: 44px; }
.field > kbd { position: absolute; right: 14px; pointer-events: none; }
.add .field { height: 64px; padding: 8px; background: var(--s1); border: 2px solid var(--ln); border-radius: 16px; }
.add .field > .ic { left: 28px; }
.add .field > input { border: 0; background: transparent; padding-left: 40px; height: 40px; }
.add .field > input:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }

.toolbar { display: flex; gap: 16px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 240px; }
.toolbar .field > input { border-radius: 12px; height: 48px; padding-left: 44px; }
.toolbar .field > .ic { left: 16px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--s1); border: 2px solid var(--ln); border-radius: 18px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 14px; font-size: 14px; font-weight: 500; color: var(--tx2);
  transition: color .15s var(--ease), background-color .15s var(--ease); }
.seg label:hover span { color: var(--tx); }
.seg input:checked + span { background: var(--ac); color: var(--ac-on); }
.seg input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: 2px; }
.seg i { font: 500 12px/16px var(--sans); font-style: normal; opacity: .65; }
.sortpick { margin: 0; }
.sortpick select { width: auto; height: 48px; padding: 0 36px 0 16px; border-radius: 12px; font-weight: 500; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.status { display: flex; gap: 16px; align-items: center; margin: 0 0 16px; font-size: 14px; color: var(--tx2); }
.pill { display: inline-flex; gap: 8px; align-items: center; height: 28px; padding: 0 12px; border-radius: 14px; background: var(--ac); color: var(--ac-on); font-weight: 500; }
.pill a { color: inherit; opacity: .7; }

/* tile grid: stickers that tilt and lift */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 20px; padding-bottom: 8px; }
.tile { --tilt: -.8deg; display: block; background: var(--s1); border: 2px solid var(--ln); border-radius: 16px; overflow: hidden; color: var(--tx);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.tile:nth-child(even) { --tilt: .8deg; }
.tile:hover { text-decoration: none; border-color: var(--ac); transform: translateY(-4px) rotate(var(--tilt)); box-shadow: 0 6px 0 var(--ac); }
.thumb { position: relative; aspect-ratio: 1; background: var(--s2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--k-audio);
  background: color-mix(in srgb, var(--k-audio) 14%, var(--s2)); }
.ph.k-album { color: var(--k-album); background: color-mix(in srgb, var(--k-album) 14%, var(--s2)); }
.ph .ic { width: 40px; height: 40px; stroke-width: 1.25; }
.chip { position: absolute; top: 10px; left: 10px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: var(--k); color: #16120a; box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.k-image { --k: var(--k-image); } .k-video { --k: var(--k-video); } .k-audio { --k: var(--k-audio); } .k-album { --k: var(--k-album); } .k-gif { --k: var(--k-gif); } .k-movie { --k: var(--k-movie); }
.cap { padding: 12px 16px 16px; }
.cap .t { display: block; font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { font: 400 12px/16px var(--sans); color: var(--ac-ink); }

.empty { grid-column: 1 / -1; text-align: center; padding: 64px 16px; color: var(--tx2); }
.empty svg, .doodle svg { stroke-width: 2.6; }
.empty svg { width: 280px; max-width: 80%; height: auto; color: var(--ac); opacity: .7; margin-bottom: 24px; }
.empty h2 { color: var(--tx); margin-bottom: 4px; }
.empty p { margin: 0; font-size: 14px; }
/* the empty-state words sit straight on the wall: a label plate each */
.empty h2, .empty p { width: fit-content; margin-inline: auto; padding: 4px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* item page */
.back { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--tx2); font-size: 14px; font-weight: 500; }
.back:hover { color: var(--tx); text-decoration: none; }
/* text that would sit straight on the stone wall gets a label plate of the page colour, so it stays readable on the texture */
.back, .page-head > h1, .page-head > h2, .lead, .share > .hint, .stage + .hint { width: fit-content; padding: 4px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 88%, transparent); }
.detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px; align-items: start; }
/* the picture (or the track list) stays in view next to the long forms; a long list scrolls inside its own column */
@media (min-width: 801px) {
  .detail > :first-child { position: sticky; top: 76px; }
  .detail.album > .tracks-col { max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; }
}
.frame { background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; padding: 12px; display: grid; place-items: center; box-shadow: 0 6px 0 var(--ln); }
.frame img, .frame video { max-width: 100%; max-height: 72vh; border-radius: 8px; display: block; background: #000; }
/* a video keeps the shape of the film whatever its preview picture is (a square card image, say): the player has that
   ratio from the start, the picture sits centred in it and the rest is grey, so nothing jumps when the video loads */
.frame video { --ar: 1.7778; --vh: 72vh; width: min(100%, calc(var(--vh) * var(--ar))); max-width: none; max-height: var(--vh); aspect-ratio: var(--ar);
  object-fit: contain; background: #2b2a31; }
.share .frame video { --vh: 78vh; }
.frame audio { width: 100%; margin: 16px 0; }
.side { display: grid; gap: 16px; }
.itemhead { display: grid; gap: 12px; }
.itemhead p { margin: 0; }
.folio { margin: 0; font: 500 12px/16px var(--sans); color: var(--ac-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.chips:empty { display: none; }
.chips a { --h: var(--k-image); height: 28px; line-height: 24px; padding: 0 12px; border: 2px solid var(--h); border-radius: 14px; font-size: 14px; font-weight: 500;
  color: var(--tx); background: color-mix(in srgb, var(--h) 16%, transparent); transition: transform .12s var(--ease); }
.chips a:nth-child(5n+2) { --h: var(--k-video); } .chips a:nth-child(5n+3) { --h: var(--k-audio); }
.chips a:nth-child(5n+4) { --h: var(--ac); } .chips a:nth-child(5n+5) { --h: #9b3dff; }
.chips a:hover { transform: translateY(-2px) rotate(-1.5deg); text-decoration: none; }
/* footer bar: the header's twin. It rises into view when you reach the end of the page */
.foot { margin-top: 24px; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.foot.wait { opacity: 0; transform: translateY(16px); }
.foot-bar { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 2px solid var(--ln); height: 60px; padding: 0 24px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
.foot-bar .orn { margin: 0; height: 44px; align-self: flex-end; }
.foot-bar a { flex: none; }
.foot-bar a { display: inline-flex; align-items: baseline; gap: 12px; flex-wrap: wrap; justify-content: center; color: var(--tx3); text-decoration: none; }
.foot-bar b { font-weight: 500; color: var(--tx2); border-bottom: 1px dotted currentColor; }
.foot-bar a:hover, .foot-bar a:focus-visible { color: var(--tx); text-decoration: none; }
.foot-bar a:hover b { color: var(--ac-ink); border-bottom-style: solid; }
@media (prefers-reduced-motion: reduce) { .foot { transition: none; } }
.ic.ic-brand { fill: currentColor; stroke: none; }
.about .actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
/* albums */
.add-more { margin: -4px 0 16px; text-align: right; }
.cover { background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; padding: 12px; box-shadow: 0 6px 0 var(--ln); }
.cover img, .cover .nocover { width: 100%; aspect-ratio: 1; border-radius: 8px; display: block; object-fit: cover; background: var(--s2); }
.cover .nocover { display: grid; place-items: center; color: var(--k-album); background: color-mix(in srgb, var(--k-album) 14%, var(--s2)); }
.cover .nocover .ic { width: 64px; height: 64px; stroke-width: 1.25; }
.player { margin-bottom: 16px; display: grid; gap: 8px; }
.album-head { display: grid; gap: 16px; }
/* on a phone the order is: title and cover, then the tracks, then everything you edit */
@media (max-width: 800px) {
  .detail.album .side { display: contents; }
  .detail.album .album-head { order: 1; } .detail.album .tracks-col { order: 2; } .detail.album .side > :not(.album-head) { order: 3; }
  .detail.album .side > * + * { margin-top: 0; }
}
.player audio { width: 100%; }
/* the browser's own player, dressed like the other blocks: same surface, hairline and corners in every theme.
   (Chromium and Safari let the control panel be styled; Firefox draws its own, which follows color-scheme.) */
audio { color-scheme: inherit; box-sizing: border-box; height: 54px; border: 2px solid var(--ln); border-radius: 20px; background: var(--s1); }
audio::-webkit-media-controls-enclosure { border-radius: 18px; background-color: var(--s1); }
audio::-webkit-media-controls-panel { background-color: var(--s1); }
.nowplaying { margin: 0; font-size: 14px; line-height: 20px; color: var(--tx2); min-height: 20px; }
.nowplaying b { color: var(--tx); font-weight: 500; }
.tracklist { list-style: none; margin: 0; padding: 0; display: grid; }
.tracklist li { display: grid; grid-template-columns: 36px 28px minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px dashed var(--ln); border-radius: 12px; font-size: 14px; }
.tracklist li:first-child { border-top: 0; }
.tracklist li.playing { background: color-mix(in srgb, var(--ac) 16%, var(--s1)); border-top-color: transparent; }
.tracklist .num { color: var(--tx3); font-variant-numeric: tabular-nums; text-align: right; }
.tracklist .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracklist .dur { color: var(--tx3); font-variant-numeric: tabular-nums; font-size: 12px; }
.play { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 2px solid var(--ln2); border-radius: 50%; background: var(--s1); color: var(--tx); cursor: pointer; }
.play:hover { border-color: var(--ac); color: var(--ac-ink); }
.play .ic { width: 14px; height: 14px; fill: currentColor; stroke: none; }
.play.share { margin: 0; max-width: none; width: 28px; height: 28px; border-color: transparent; background: none; color: var(--tx3); }
.play.share .ic { fill: none; stroke: currentColor; stroke-width: 1.5; width: 16px; height: 16px; }
.play.share:hover { color: var(--ac-ink); border-color: var(--ln2); }
.play .on { display: none; } .play[aria-pressed="true"] .on { display: block; } .play[aria-pressed="true"] .off { display: none; }
.tracklist li.playing .play:not(.share) { background: var(--ac); border-color: var(--ac); color: var(--ac-on); }
.tracklist li.match { background: color-mix(in srgb, var(--ac) 10%, var(--s1)); }
/* the transcript popup */
.modal { width: min(720px, 92vw); max-height: 86vh; padding: 0; border: 2px solid var(--ln); border-radius: 20px; background: var(--s1); color: var(--tx); box-shadow: 0 12px 0 var(--ln); }
.modal[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.modal::backdrop { background: rgba(8, 7, 12, .62); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 16px 20px 8px; }
.modal-head h2 { margin: 0; font-size: 18px; line-height: 24px; }
.modal-head p { margin: 0; }
.modal-body { padding: 8px 20px 16px; overflow: auto; font-size: 14px; line-height: 22px; color: var(--tx2); }
.modal-body mark { background: color-mix(in srgb, var(--ac) 35%, transparent); color: var(--tx); border-radius: 3px; padding: 0 1px; }
.modal-foot { padding: 12px 20px 16px; border-top: 1px dashed var(--ln); }
.transcribe { display: grid; gap: 8px; margin-top: 12px; }
.transcribe p { margin: 0; }
.transcribe form { display: flex; gap: 8px; flex-wrap: wrap; }
.play.share.hit { color: var(--ac-ink); border-color: var(--ln2); }
.hit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 12px; line-height: 16px; color: var(--tx2); }
.hit b { font-weight: 500; color: var(--tx); }
.hit mark { background: color-mix(in srgb, var(--ac) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.trackedit { display: grid; gap: 8px; margin-top: 12px; }
.trackedit .row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
.facts dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--tx3); }
.facts dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.facts dd.chips { gap: 6px; }
.diff { width: 100%; border-collapse: collapse; font-size: 14px; }
.diff th { text-align: left; font-weight: 500; font-size: 12px; color: var(--tx3); padding: 4px 8px; }
.diff td { padding: 8px; border-top: 1px dashed var(--ln); vertical-align: middle; overflow-wrap: anywhere; }
.diff .check { display: inline-flex; align-items: center; gap: 8px; color: var(--tx); font-size: 14px; }
.diff input[type="checkbox"], .form .check input[type="checkbox"] { width: auto; padding: 0; }
.mini { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; display: block; background: var(--s2); }
.lookup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lookup-pick { display: grid; gap: 2px; padding: 12px 16px; border: 2px solid var(--ln); border-radius: 12px; color: var(--tx); text-decoration: none; }
.lookup-pick:hover { border-color: var(--ac); text-decoration: none; }
.kindpick { display: flex; gap: 16px; flex-wrap: wrap; }
.form .kindpick label { display: inline-flex; align-items: center; gap: 8px; color: var(--tx); font-size: 14px; }
.kindpick input { width: auto; padding: 0; }
.form label.drop { display: flex; gap: 12px; font-size: 14px; color: var(--tx2); }
.legal { max-width: 720px; }
.legal h1 { margin-top: 0; }
.panel { background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; padding: 20px; }
.panel.flush { padding: 0; overflow-x: auto; }   /* a wide table scrolls inside its panel, the buttons in its last column stay reachable on a phone */
.form { display: grid; gap: 16px; }
.form label { display: grid; gap: 4px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tx2); }
.form .btn { justify-self: start; }
.fld { display: grid; gap: 4px; }
.fld > label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tx2); }
/* manual tags: small chips (black in dark mode, pale in light mode), each with its own red round cross */
.tagfield { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; background: var(--chip-fld); border: 2px solid var(--ln); border-radius: 12px; cursor: text; }
.tagfield:focus-within { border-color: var(--ac); }
.tagchip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 4px 0 10px; border-radius: 13px; background: var(--chip); color: var(--chip-tx); font-size: 14px; font-weight: 500; box-shadow: 0 0 0 1px var(--chip-ring); }
.tagchip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--chip-x); color: #fff; cursor: pointer; transition: filter .15s; }
.tagchip button svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.tagchip button:hover { filter: brightness(1.12); }
.tagchip button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.tagfield .tag-entry { flex: 1; min-width: 96px; width: auto; padding: 0; border: 0; outline: 0; background: transparent; box-shadow: none; height: 24px; }
.side details { border-top: 2px dashed var(--ln); padding-top: 12px; }
.side summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--tx2); list-style: none; display: flex; gap: 8px; align-items: center; }
.side summary::-webkit-details-marker { display: none; }
.side summary::before { content: "›"; color: var(--ac-ink); transition: transform .12s var(--ease); display: inline-block; }
.side details[open] > summary::before { transform: rotate(90deg); }
.side summary i { font: 400 12px/16px var(--sans); font-style: normal; color: var(--tx3); }
.side details > * { margin-top: 12px; margin-bottom: 0; }
.pre { white-space: pre-wrap; font-size: 14px; line-height: 20px; }
.job { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tx3); margin-right: 8px; }
.job .dot { margin-right: 0; }
.dot.done { background: var(--ok); } .dot.failed { background: var(--bad); } .dot.running, .dot.run { background: var(--ac); }
.dot.queued { background: var(--tx2); } .dot.idle { background: transparent; box-shadow: inset 0 0 0 2px var(--tx3); }
.dot.running { animation: dot-breathe 1.6s ease-in-out infinite; }
@keyframes dot-breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot.running { animation: none; } }
@media (max-width: 800px) { .detail { grid-template-columns: 1fr; } .add { grid-template-columns: 1fr; } }

/* jobs + login */
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--tx3); font-size: 14px; }
th, td { padding: 12px 20px; border-bottom: 2px solid var(--ln); line-height: 20px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--s2); }
td.clip { max-width: 360px; } .narrow-form td.clip { max-width: 240px; }
td.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.login-wrap { max-width: 360px; margin: 48px auto; }
.doodle svg { width: 100%; height: auto; color: var(--ac); opacity: .7; margin-bottom: 16px; }
.login { display: grid; gap: 16px; padding: 24px; }
.login p { margin: 0; font-size: 14px; }

/* card image cropper */
.lead { margin: -8px 0 20px; }
.cardedit { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .cardedit { grid-template-columns: 1fr; } }
.cardedit-main { display: grid; gap: 12px; min-width: 0; }
.snap { display: grid; gap: 12px; padding: 12px; }
.snap video { width: 100%; max-height: 40vh; border-radius: 12px; background: #000; }
.snapbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nudge { display: inline-flex; gap: 6px; } .snapbar .small b { color: var(--tx); font-weight: 500; }
.stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; border: 2px solid var(--ln); border-radius: 16px; overflow: hidden; background: #000; touch-action: none; line-height: 0; user-select: none; }
.stage img { display: block; max-width: 100%; max-height: 70vh; min-width: min(100%, 460px); }
.cropbox { position: absolute; cursor: move; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 0 0 9999px rgba(0,0,0,.58); touch-action: none; outline-offset: 2px; }
.cropbox::before, .cropbox::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 33.333% 33.333%; pointer-events: none; }
.cropbox::after { display: none; }
.cropbox:focus-visible { outline: 2px solid var(--ac); }
.previewcard { width: 240px; max-width: 100%; margin: 0 auto; border: 2px solid var(--ln); border-radius: 20px; overflow: hidden; background: var(--s2); line-height: 0; }
.previewcard canvas { width: 100%; height: auto; display: block; }
.zoom { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--tx2); } .zoom input[type=range] { accent-color: var(--ac); padding: 0; border: 0; background: none; }
.reset-row { margin-top: 16px; }

/* sharing */
.errcell { width: 46%; max-width: 0; }                 /* max-width: 0 lets the cell shrink so a long line truncates instead of stretching the table */
.errbox summary { display: block; list-style: none; cursor: pointer; color: var(--bad); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.errbox .s-short { display: block; overflow: hidden; text-overflow: ellipsis; }
.errbox summary::-webkit-details-marker { display: none; }
.errbox summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.errbox .s-hide { display: none; font-size: 14px; color: var(--tx2); } .errbox[open] .s-hide { display: inline; } .errbox[open] .s-short { display: none; }
.errbox pre { margin: 8px 0; padding: 10px 12px; max-height: 280px; overflow: auto; background: var(--bg); border: 2px solid var(--ln); border-radius: 12px;
  color: var(--bad); font: inherit; font-size: 14px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.side details.errbox { border-top: 0; padding-top: 0; }
.side .errbox summary::before { content: none; }
.job { flex-wrap: wrap; }
.job .errbox { flex: 1 1 100%; min-width: 0; margin-top: 0; }
.job form.inline { display: inline; margin: 0 0 0 auto; }
.with-icon { display: flex; align-items: center; gap: 10px; }
.with-icon .ic { width: 20px; height: 20px; }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 600px) { .duo { grid-template-columns: 1fr; } }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.links li { padding: 14px; border: 2px solid var(--ln); border-radius: 16px; background: var(--bg); display: grid; gap: 10px; }
.links li.expired, .links li.revoked { opacity: .7; }
.links .meta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.links .keyline { margin: 0; padding: 8px 12px; font-size: 14px; }
.status { display: inline-block; padding: 0 10px; height: 22px; line-height: 20px; border-radius: 11px; font-size: 12px; font-weight: 500; border: 2px solid var(--ln); color: var(--tx2); }
.status.permanent { border-color: var(--ac); color: var(--ac-ink); }
.status.active { border-color: var(--ok); color: var(--ok); }
.status.expired, .status.revoked { color: var(--bad); border-color: var(--bad); }
.share { max-width: 860px; margin: 0 auto; display: grid; gap: 16px; }
.share .cover { max-width: 420px; width: 100%; justify-self: center; }
.share h1 { margin-top: 4px; } .share p { margin: 0; }
.share .frame img { max-height: 78vh; }

/* user tags vs AI tags */
button.link { background: none; border: 0; padding: 0; color: var(--ac-ink); font: inherit; cursor: pointer; }
button.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tagsplit { display: grid; gap: 12px; }
.tagset h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--tx2); }
.tagset p { margin: 0; }
.tag-actions { margin-left: auto; display: inline-flex; gap: 12px; } .tag-actions form { margin: 0; }
.tag-actions .link { font-size: 12px; font-weight: 500; }
.tagset.ai { padding: 12px; border: 2px dashed var(--ln2); border-radius: 12px; }
ul.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips.ai li { display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 12px; border: 2px dashed var(--ln2); border-radius: 14px; background: transparent; }
.chips.ai li a { padding: 0; height: auto; line-height: 24px; border: 0; background: none; border-radius: 0; font-size: 14px; font-weight: 500; color: var(--tx2); }
.chips.ai li a:hover { color: var(--ac-ink); transform: none; }
.chips.ai li form { display: inline-flex; margin: 0; }
.chips.ai li button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--tx3); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); }
.chips.ai li button .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.chips.ai li button:hover { background: var(--s2); color: var(--tx); }
.chips.ai li form + form button:hover { color: var(--bad); }
.pill.ai { background: transparent; color: var(--tx); border: 2px dashed var(--ac); }
.pill small { font-size: 12px; font-weight: 500; opacity: .75; }

/* settings, forms, notices */
[hidden] { display: none !important; }
.small { font-size: 14px; }
.note { margin: 0 0 16px; padding: 10px 16px; border-radius: 14px; border: 2px solid var(--ln); background: var(--s1); font-size: 14px; }
.note.ok { border-color: var(--ok); } .note.error { border-color: var(--bad); color: var(--bad); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 12px; color: var(--tx2); font-size: 14px; font-weight: 500;
  border: 2px solid var(--ln); background: var(--s1); transition: color .15s var(--ease), border-color .15s var(--ease); }
.tabs a:hover { color: var(--tx); text-decoration: none; border-color: var(--ln2); }
.tabs a.on { background: var(--ac); color: var(--ac-on); border-color: transparent; }
.stack { display: grid; gap: 16px; align-content: start; }
.stack > *, .stack h2 { margin: 0; }
.stack, .panel { scroll-margin-top: 80px; }
.backup-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.backup-choices form { padding: 16px; border: 2px solid var(--ln); border-radius: 14px; align-content: space-between; }
.backup-choices h3 { font-size: 16px; }
.restore-code { margin: 0; padding: 12px 16px; overflow-x: auto; border-radius: 14px; border: 2px solid var(--ln); background: var(--s2); font-size: 14px; }
.panel + .panel, .panel + .page-head, .reveal + .panel, section.panel + div.panel, div.panel + section.panel, .tabs + .panel { margin-top: 16px; }
.narrow-form { max-width: 640px; }
.page-head.sub { margin: 24px 0 12px; }
.hint { display: block; margin-top: 2px; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--tx3); }
.form.row { grid-template-columns: 1fr 220px auto; align-items: end; }
@media (max-width: 700px) { .form.row { grid-template-columns: 1fr; } }
.form.inline { display: flex; gap: 8px; align-items: center; } .form.inline input { max-width: 180px; }
select { font: inherit; font-size: 14px; color: var(--tx); background: var(--s1); border: 2px solid var(--ln); border-radius: 14px; padding: 10px 14px; width: 100%; }
select:focus-visible { outline: none; border-color: var(--ac); }
.check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--tx); }
.check input { width: auto; }
.assign { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; padding: 8px 0; border-top: 2px dashed var(--ln); }
.assign:first-of-type { border-top: 0; }
.assign b { color: var(--tx); font-weight: 500; }
@media (max-width: 700px) { .assign { grid-template-columns: 1fr; gap: 4px; } }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
td.actions { display: table-cell; width: 1%; white-space: nowrap; vertical-align: middle; }
.acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; } .acts form { margin: 0; } td.nw { white-space: nowrap; }
.btn.small { height: 32px; border-radius: 10px; padding: 0 12px; font-size: 14px; }
.badge { display: inline-block; padding: 0 8px; border-radius: 10px; background: color-mix(in srgb, var(--ac) 20%, transparent); color: var(--ac-ink); font-size: 12px; line-height: 20px; font-weight: 500; }
tr.subrow td { padding: 0 20px; border-bottom: 0; } tr.subrow:has(span:empty) { display: none; }
.test { display: inline-block; padding: 4px 0 12px; font-size: 14px; } .test.ok { color: var(--ok); } .test.bad { color: var(--bad); }
.presets { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.reveal { margin-bottom: 16px; padding: 20px; border: 2px solid var(--ac); border-radius: 20px; background: color-mix(in srgb, var(--ac) 10%, var(--s1)); }
.reveal h3 { margin: 0 0 4px; font-size: 16px; } .reveal p { margin: 0 0 12px; font-size: 14px; color: var(--tx2); }
.keyline { padding: 10px 14px; border-radius: 12px; background: var(--bg); border: 2px solid var(--ln); font-size: 14px; word-break: break-all; user-select: all; letter-spacing: .02em; }
.codes { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0; margin: 0 0 12px; }
.codes li { padding: 8px 12px; border-radius: 10px; background: var(--bg); border: 2px solid var(--ln); font-size: 14px; letter-spacing: .04em; text-align: center; font-variant-numeric: tabular-nums; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 20px; } .steps li { padding-left: 4px; }
.qr { display: block; width: fit-content; max-width: 100%; margin: 12px auto; padding: 0; border-radius: 12px; background: #fff; line-height: 0; overflow: hidden; }
.qr svg { display: block; max-width: 100%; height: auto; }
.snippet { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 2px solid var(--ln); font-size: 14px; line-height: 20px; overflow-x: auto; white-space: pre; }
.login-wrap.wide { max-width: 440px; }
.pop.narrow { width: 200px; }
.langlist { display: grid; gap: 2px; margin: 0; }
.langlist button { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border: 0; border-radius: 10px; background: none;
  font: inherit; font-size: 14px; color: var(--tx2); cursor: pointer; text-align: left; }
.langlist button:hover { color: var(--tx); background: var(--s2); }
.langlist button .flag { width: 20px; height: 14px; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.28); }
.langlist button span { flex: 1; }
.langlist button .ic { visibility: hidden; }
.langlist button[aria-current] { background: var(--ac); color: var(--ac-on); }
.langlist button[aria-current] .ic { visibility: visible; }
.login .note { margin: 0; }

@media (max-width: 600px) {
  main { padding: 16px; } .top-in { padding: 0 16px; }
  .nav-link span { display: none; } .nav-link { padding: 0 10px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .field > kbd { display: none; }
  .sortpick, .sortpick select { width: 100%; }
  .seg { width: 100%; overflow-x: auto; scrollbar-width: none; } .seg label { flex: 1 0 auto; } .seg span { justify-content: center; padding: 0 12px; width: 100%; }   /* seven filters do not fit: the bar scrolls inside itself */
  .pop { right: -8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } .tile:hover { transform: none; } }

/* the popup that frames another page (lookup, card image) */
.modal.framed { width: min(1080px, 96vw); height: 88vh; max-height: 88vh; }
.modal.framed[open] { grid-template-rows: auto minmax(0, 1fr); }
.modal.framed iframe { width: 100%; height: 100%; border: 0; border-top: 1px dashed var(--ln); border-radius: 0 0 18px 18px; background: var(--bg); }
.embed .top, .embed .foot, .embed .leave, .embed .page-head { display: none; }
.embed main { padding: 16px 20px 24px; max-width: none; }
body.embed { background: var(--s1); background-image: none; }
.own-picture { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 16px; margin-bottom: 20px; padding: 14px 20px; }
.own-picture h2 { flex: 1 0 100%; margin: 0; font-size: 16px; }
.own-picture label { flex: 1 1 260px; }
.own-picture .hint { flex: 1 0 100%; margin: 0; order: 3; }
.own-picture .btn { order: 2; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.toolbar form { margin: 0; }
.toolbar .btn .dot { margin-right: 0; }
.jobs { margin-top: 12px; }
.jobs h2 { margin: 0; font-size: 16px; }
.jobs[hidden] { display: none; }
.modal.confirm { width: min(440px, 92vw); }
.modal.confirm[open] { grid-template-rows: auto auto auto; }
.modal.confirm .modal-foot { display: flex; justify-content: flex-end; gap: 8px; }
.modal.confirm .btn.danger { border-color: var(--bad); }
.jobs .joblist { display: grid; gap: 8px; max-height: 260px; overflow: auto; }
.album-head .toolbar { margin-top: 4px; }

/* people: the field on an item, the popup form, the list and a person's page */
.people { display: grid; gap: 8px; margin: 0; }
.people-label { margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--tx2); }
.people .hint, .people .persons { margin: 0; }
.persons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.person-chip { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 4px 0 4px; border-radius: 16px; background: var(--s1); border: 2px solid var(--ln); font-size: 14px; font-weight: 500; }
.person-chip a { display: inline-flex; align-items: center; gap: 8px; color: var(--tx); padding-right: 4px; }
.person-chip a:hover { text-decoration: none; color: var(--ac); }
.person-chip form { margin: 0; display: flex; }
.person-chip button { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; background: var(--chip-x); color: #fff; cursor: pointer; }
.person-chip button svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }
.avatar { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--s2); color: var(--tx2); font-size: 12px; font-weight: 500; box-shadow: 0 0 0 1px var(--ln); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.big { width: 112px; height: 112px; font-size: 44px; border: 2px solid var(--ln); box-shadow: none; }
.person-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.suggest-wrap { position: relative; flex: 1 1 200px; min-width: 0; }
.person-in { width: 100%; height: 32px; padding: 0 12px; font-size: 14px; }
.suggest { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--s1); border: 2px solid var(--ln); border-radius: 14px; box-shadow: 0 8px 0 var(--ln); max-height: 240px; overflow: auto; }
.suggest[hidden] { display: none; }
.suggest li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.suggest li small { color: var(--tx3); }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--s2); }
.person-form { max-width: 560px; }
.person-form .actions { display: flex; gap: 8px; }
.person-head { display: flex; align-items: center; gap: 24px; margin: 8px 0 24px; }
.person-head h1 { margin: 0 0 8px; }
@media (max-width: 600px) { .person-head { flex-direction: column; align-items: flex-start; gap: 16px; } }   /* picture above the facts on a phone */
.facts-inline { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: 14px; }
.facts-inline dt { color: var(--tx3); } .facts-inline dd { margin: 0; overflow-wrap: anywhere; }
.person-edit { margin-bottom: 24px; max-width: 640px; }
.person-edit:not([open]) { display: block; }   /* closed, it is just its title line: no empty grid row below it */
.person-edit summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.person-edit .form { margin-top: 12px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 16px 0 0; padding: 0; list-style: none; }
.person-card { display: grid; justify-items: center; gap: 8px; padding: 20px 12px; background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; color: var(--tx); text-align: center; }
.person-card:hover { text-decoration: none; border-color: var(--ac); }
.person-card .avatar { width: 72px; height: 72px; font-size: 28px; }
.pc-name { font-weight: 500; overflow-wrap: anywhere; }
.embed .person-form { max-width: none; border: 0; box-shadow: none; padding: 0; background: transparent; }
#edit-form { display: none; }
.person-edit .actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.person-edit .actions .btn { justify-self: auto; }
#delete-person { display: none; }
.person-edit .btn.danger { background: var(--s2); border-color: var(--ln); }
.person-edit .btn.danger:hover { border-color: var(--bad); }

/* sound cards: a round soundboard button that plays right on the card */
.tile.sound { --h: 140; }
.tile.sound .thumb { display: grid; place-items: center; background: color-mix(in srgb, hsl(var(--h) 75% 55%) 14%, var(--s2)); }
.sound-play { --p: 0; position: relative; z-index: 1; display: grid; place-items: center; width: 62%; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; cursor: pointer; color: #16120a;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 90% 74%), hsl(var(--h) 76% 52%) 62%);
  box-shadow: 0 7px 0 hsl(var(--h) 70% 30%), 0 12px 18px rgba(0, 0, 0, .18);
  transition: transform .1s var(--ease), box-shadow .1s var(--ease), filter .15s; }
.sound-play:hover { filter: brightness(1.06); }
.sound-play:active, .sound-play.playing { transform: translateY(5px); box-shadow: 0 2px 0 hsl(var(--h) 70% 30%), 0 4px 8px rgba(0, 0, 0, .18); }
.sound-play:focus-visible { outline: 3px solid var(--ac); outline-offset: 4px; }
.sound-play::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; opacity: 0; transition: opacity .15s;
  background: conic-gradient(var(--ac) calc(var(--p) * 1%), transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.sound-play.on::after { opacity: 1; }
.sound-play .ic { width: 42%; height: 42%; fill: currentColor; stroke: none; }
.sound-play .sp-play, .sound-play .sp-pause { display: grid; place-items: center; width: 100%; height: 100%; }
.sound-play .sp-pause, .sound-play.playing .sp-play { display: none; }
.sound-play.playing .sp-pause { display: grid; }
.sound-play .sp-play .ic { margin-left: 4%; }
.sound-play.over { width: 28%; opacity: .92; }
.tile.sound > .cap { display: block; color: var(--tx); }
.tile.sound > .cap:hover { text-decoration: none; }
@media (prefers-reduced-motion: reduce) { .sound-play { transition: none; } }
.sound-stage { --h: 140; display: grid; place-items: center; min-height: 340px; border-radius: 16px; background: color-mix(in srgb, hsl(var(--h) 75% 55%) 14%, var(--s2)); }
.sound-stage .sound-play { width: min(240px, 62%); }
.sound-stage { width: 100%; }

/* the search bar's suggestions (tags and people) */
.field .suggest { top: calc(100% + 6px); }
.suggest .grp { padding: 8px 10px 4px; font-size: 12px; font-weight: 500; color: var(--tx3); }
.suggest li { padding: 0; }
.suggest li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; color: var(--tx); font-size: 14px; }
.suggest li a:hover { text-decoration: none; }
.suggest li a small { margin-left: auto; color: var(--tx3); }
.suggest li a[aria-selected="true"], .suggest li a:hover { background: var(--s2); }

/* upload progress */
form.uploading { opacity: .55; pointer-events: none; }
.upload-panel { position: fixed; z-index: 60; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(560px, 92vw); display: grid; gap: 8px; padding: 16px 20px;
  background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; box-shadow: 0 8px 0 var(--ln), 0 16px 32px rgba(0, 0, 0, .18); }
.upload-panel .up-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.upload-panel .up-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.upload-panel .up-pct { font-variant-numeric: tabular-nums; font-weight: 500; }
.upload-panel .up-bar { height: 14px; border-radius: 7px; background: var(--s2); box-shadow: inset 0 0 0 2px var(--ln); overflow: hidden; }
.upload-panel .up-fill { height: 100%; width: 0; border-radius: 7px; background: var(--ac); transition: width .2s linear; }
.upload-panel.processing .up-fill { background: repeating-linear-gradient(45deg, var(--ac) 0 12px, color-mix(in srgb, var(--ac) 65%, #fff) 12px 24px); background-size: 34px 34px; animation: up-stripes 1s linear infinite; }
@keyframes up-stripes { to { background-position: 34px 0; } }
.upload-panel.error { border-color: var(--bad); }
.upload-panel.error .up-fill { background: var(--bad); }
.upload-panel .up-detail { margin: 0; font-variant-numeric: tabular-nums; }
.upload-panel .up-foot { display: flex; justify-content: flex-end; }
@media (prefers-reduced-motion: reduce) { .upload-panel .up-fill { transition: none; } .upload-panel.processing .up-fill { animation: none; } }

/* the working signal of a lookup (spinner card over the page, or over the popup while its page loads) */
.busy { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(2px); cursor: progress; }
.busy.in-dialog { position: absolute; inset: 64px 0 0 0; z-index: 5; border-radius: 0 0 18px 18px; background: color-mix(in srgb, var(--s1) 86%, transparent); }
.busy-card { display: grid; justify-items: center; gap: 6px; padding: 24px 32px; min-width: 240px; max-width: min(420px, 86vw); text-align: center; background: var(--s1); border: 2px solid var(--ln); border-radius: 20px; box-shadow: 0 8px 0 var(--ln); }
.busy-spin { width: 44px; height: 44px; margin-bottom: 8px; border-radius: 50%; border: 5px solid var(--s2); border-top-color: var(--ac); animation: busy-turn .9s linear infinite; }
@keyframes busy-turn { to { transform: rotate(360deg); } }
.busy-msg { margin: 0; font-weight: 500; }
.busy-hint, .busy-time { margin: 0; min-height: 1.2em; }
.busy-time { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .busy-spin { animation: none; border-top-color: var(--s2); border-right-color: var(--ac); } }

/* the unified upload zone */
.uploader { display: grid; gap: 12px; margin-bottom: 16px; }
.uploader .uz { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 96px; padding: 20px; text-align: center; cursor: pointer; }
.uploader .uz.over { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 14%, var(--s1)); }
.uploader .uz.picked { min-height: 64px; opacity: .85; }
.uploader .uz input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.uploader .uz { position: relative; }
.uz-link { max-width: 560px; justify-self: center; width: 100%; }
.uz-link .btn { height: 40px; }
.uz-panel { max-width: 760px; width: 100%; justify-self: center; }
.uz-panel[hidden] { display: none; }
.uz-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.uz-sum b { overflow-wrap: anywhere; }
.uz-types { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.uz-types legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; color: var(--tx2); }
.uz-types label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--ln); border-radius: 16px; background: var(--s1); cursor: pointer; }
.uz-types label[hidden] { display: none; }
.uz-types label:has(input:checked) { border-color: var(--ac); background: color-mix(in srgb, var(--ac) 10%, var(--s1)); }
.uz-types input { margin-top: 4px; }
.uz-types b { display: flex; align-items: center; gap: 8px; }
.uz-types small { display: block; color: var(--tx3); font-size: 14px; line-height: 18px; }
.uz-badge { margin-left: 4px; padding: 0 8px; border-radius: 10px; background: var(--ac); color: var(--ac-on); font-size: 12px; font-style: normal; font-weight: 500; line-height: 18px; }
.uz-fields { display: grid; gap: 12px; }
.uz-fields[hidden] { display: none; }
.uz-note { color: var(--bad); margin: 0; }
.uz-panel.uploading > :not(#uz-progress):not(.uz-sum) { display: none; }                  /* while it uploads: just the summary and the bar */
.uz-panel.uploading #uz-change { display: none; }
.upload-panel.inline { position: static; transform: none; width: auto; box-shadow: none; margin-top: 4px; }
#uz-progress:empty { display: none; }
.uploader .uz { height: auto; }
.uz-types input[type=radio] { width: 18px; height: 18px; flex: none; padding: 0; margin: 3px 0 0; }
.uz-types label > span { display: grid; gap: 2px; min-width: 0; }
.uz-types label b { flex-wrap: wrap; }
.uz-panel.uploading { opacity: 1; pointer-events: auto; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; }

/* selecting tiles (bulk.js) */
.tile .pick { display: none; position: absolute; top: 10px; right: 10px; z-index: 2; width: 28px; height: 28px; place-items: center; border-radius: 50%;
  background: var(--s1); border: 2px solid var(--ln2); color: transparent; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.tile .pick .ic { width: 16px; height: 16px; stroke-width: 2.5; }
.selecting .tile .pick { display: grid; }
.selecting .tile { cursor: pointer; }
.selecting .tile:hover { transform: none; box-shadow: none; border-color: var(--ln2); }
.selecting .tile.sound .sound-play { pointer-events: none; }
.tile.selected { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac); }
.selecting .tile.selected:hover { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac); }
.tile.selected .pick { background: var(--ac); border-color: var(--ac); color: var(--ac-on); }
.bulkbar { position: fixed; z-index: 30; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(1120px, calc(100% - 32px)); padding: 12px 16px;
  background: var(--s1); border: 2px solid var(--ln2); border-radius: 20px; box-shadow: 0 12px 32px rgba(0,0,0,.28); }
.bulkbar[hidden] { display: none; }
.bulk-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bulk-row + .bulk-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ln); }
.bulk-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.bulk-params label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
.bulk-params label[hidden] { display: none; }
.bulk-params .fld { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
.bulk-params [data-for][hidden] { display: none; }
.bulk-params .tagfield { flex: 1 1 280px; min-width: 260px; }
.bulk-people { position: relative; }
.bulk-people .suggest { top: auto; bottom: calc(100% + 6px); left: auto; right: 0; width: min(360px, 100%); }       /* the bar sits at the bottom: suggestions open upwards */
.bulk-params input, .bulk-params select { width: auto; min-width: 220px; height: 36px; padding: 0 12px; }
.selecting main { padding-bottom: 160px; }   /* the bar must not cover the last row of tiles */
@media (max-width: 600px) { .bulkbar { bottom: 8px; width: calc(100% - 16px); padding: 10px 12px; } .bulk-actions { margin-left: 0; } .bulk-params input, .bulk-params select { min-width: 0; width: 100%; } .bulk-params label { width: 100%; } }

/* managing tags and merging people */
.plainlist { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14px; }
.mergebar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0; padding: 12px 16px; }
.mergebar label { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx2); }
.mergebar input { width: auto; min-width: 220px; height: 36px; padding: 0 12px; }
.inline-rename { display: flex; gap: 8px; margin: 0; }
.inline-rename input { width: 180px; height: 32px; padding: 0 10px; }
.tagtable td { vertical-align: middle; }
.tagtable input[type="checkbox"] { width: auto; padding: 0; }
.person-card.dup { border-style: dashed; border-color: var(--ac); }
.dups .plainlist li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 600px) { .mergebar input { min-width: 0; width: 100%; } .mergebar label { width: 100%; flex-wrap: wrap; } }
.listnote { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: fit-content; max-width: 100%; margin: 0 0 16px; padding: 4px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); font-size: 14px; color: var(--tx2); }
.listnote form { display: inline; margin: 0; }
.toolbar .check { display: inline-flex; align-items: center; gap: 8px; margin: 0; white-space: nowrap; font-size: 14px; color: var(--tx2); }
.toolbar .check input { width: auto; padding: 0; }
.redirect-list li { display: flex; align-items: center; gap: 12px; }
.redirect-list form { margin: 0; }
