/* loupie-server web UI - global styles. Plain CSS; no framework. */

/* Two themes, one palette.
 *
 * data-theme is stamped on <html> by the inline script in _layout.html
 * before the first paint, and it is always the RESOLVED theme - "light" or
 * "dark", never "auto". Following the OS is the script's job, not the
 * stylesheet's, which is what keeps the dark values in ONE block here
 * instead of repeated between a media query and an attribute selector where
 * the two could drift.
 *
 * Everything below this block reads a token. A literal colour anywhere else
 * is a bug in one theme or the other - the exception being the modal scrim
 * and the shadows, which are black in both because they are shadow, not
 * surface.
 */
:root {
    /* Tells the browser to draw form controls, scrollbars and the canvas
       to match. Without it a dark page keeps light scrollbars and a white
       <select>. */
    color-scheme: light;

    --fg: #1a1a1a;
    --fg-mute: #666;
    --fg-dim: #999;
    --bg: #fafafa;
    --bg-card: #fff;
    --border: #e0e0e0;
    --border-strong: #b8b8b8;
    --accent: #1f6feb;
    --accent-mute: #dfe9fb;
    --good: #197b30;
    --bad: #b3261e;
    /* Two reds behind two different things, which is why there are two.
       --bad-mute sits behind text that is already --bad (the marked pill), so
       it must stay dark enough for that pair. --bg-row-culled is a whole
       table row behind ORDINARY text, so it answers to --fg-mute and
       --accent instead, and can be redder and lighter than the pill could
       ever be. One token serving both is what kept the row muted. */
    --bad-mute: #fbe3e0;
    --bg-row-culled: #fbe3e0;
    --warn: #b26a00;

    /* Table furniture, and the tint a hovered row takes. */
    --bg-th: #f3f3f3;
    --bg-row-hover: #f6f9ff;
    /* A wash over whatever is behind it - used for subtle hover fills. */
    --bg-soft: rgba(0, 0, 0, 0.04);
    /* The same, strong enough to read against a pill: under its ×. */
    --bg-soft-strong: rgba(0, 0, 0, 0.15);
    /* Text ON an accent-filled surface, which is not the same decision as
       the accent itself: the accent has to stay legible as a LINK against
       the page, and a link colour bright enough for a dark background is
       too bright to put white on. */
    --on-accent: #fff;
    --star-on: #f5a623;
    --star-off: #d6d6d6;
    /* Behind a picture shown alone, as full screen shows it: one in both
       themes. */
    --picture-ground: #000;
    /* Behind a QR code: a phone's camera reads dark on light. */
    --qr-ground: #fff;
    /* The histogram's channels: deep primaries that add as light, so
       all three make white, on a well grey enough under the white for
       that to show. The channels and the clip marks are one set in both
       themes; the well and the line are each theme's own. */
    --hist-r: #b33a3a;
    --hist-g: #2f9a3f;
    --hist-b: #3a5fcc;
    --hist-well: #c8cbd0;
    --hist-luma: rgba(0, 0, 0, 0.7);
    --hist-note: rgba(0, 0, 0, 0.55);
    --hist-clip-r: #ff5a52;
    --hist-clip-g: #4ec46a;
    --hist-clip-b: #6a9bff;
    --hist-clip-rg: #f0cf3a;
    --hist-clip-rb: #f05ad2;
    --hist-clip-gb: #3cc8e0;
    --hist-clip-all: #f5f5f7;
    --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Dark. Deliberately not black: this is a photo tool, and a near-black
   surround exaggerates the brightness of the image sitting on it. Neutral
   greys, so nothing casts a colour onto what is being judged. */
:root[data-theme="dark"] {
    color-scheme: dark;

    --fg: #e6e6e6;
    --fg-mute: #9aa0a6;
    --fg-dim: #71767c;
    --bg: #17191c;
    --bg-card: #1e2125;
    --border: #2c3036;
    --border-strong: #464c54;
    --accent: #6aa6ff;
    --accent-mute: #1c2c47;
    --good: #4ec46a;
    --bad: #ff6b61;
    /* See the light palette: two reds, because they sit behind different
       text. The pill's is capped by --bad on it (4.74:1 here); the row's is
       capped by --fg-mute and --accent (4.59 and 4.92), which lets it go
       both lighter and considerably redder - a red/green gap of 53 against
       the pill's 37, where the first attempts were 11 and looked grey. */
    --bad-mute: #4a2529;
    --bg-row-culled: #5a2529;
    --warn: #e0a33a;

    --bg-th: #24272c;
    --bg-row-hover: #232a35;
    --bg-soft: rgba(255, 255, 255, 0.06);
    --bg-soft-strong: rgba(255, 255, 255, 0.15);
    /* Dark ON the accent here: the link colour above is lifted for a dark
       page, and white on it reads as glare rather than as text. */
    --on-accent: #10141a;
    --star-on: #f5a623;
    --star-off: #4a4f56;
    --hist-well: #26282b;
    --hist-luma: rgba(255, 255, 255, 0.8);
    --hist-note: rgba(255, 255, 255, 0.5);
    --shadow-pop: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-modal: 0 8px 32px rgba(0, 0, 0, 0.7);
}

/* The scrollbar's room is kept whether or not a page needs one, so a
   filter that makes the page short does not shift everything sideways. */
html {
    box-sizing: border-box;
    scrollbar-gutter: stable;
}
*, *::before, *::after { box-sizing: inherit; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
}

/* ---- top nav --------------------------------------------------------- */

.nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.75em 0;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25em;
    display: flex;
    align-items: center;
    gap: 1.5em;
    flex-wrap: wrap;
}
.nav h1 {
    font-size: 1em;
    font-weight: 600;
    margin: 0;
    margin-right: 0.5em;
}

/* The icon and the name in the nav. The icon sets the bar's height, and
   has no ground of its own, so it sits on the bar in either theme. */
.nav-brand {
    display: flex;
    align-items: center;
}
.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--fg);
    font-size: 1.15em;
    font-weight: 600;
    text-decoration: none;
}
.nav-brand img {
    display: block;
    width: 26px;
    height: 26px;
}
.nav-brand a:hover { color: var(--accent); }
/* The main nav links only - DIRECT children, so these do not reach inside
   the account menu's panel. A descendant selector did, and menu links came
   out semibold and muted while the logout button beside them did not:
   three rows, three treatments, from rules that were never about them. */
/* Clickable to the bar's top and bottom and halfway across each gap, with
   the margin taking the padding back so every link sits where its text
   alone would put it. */
.nav-inner > a {
    --nav-pad-y: 0.9em;
    --nav-pad-x: 0.75em;
    position: relative;
    color: var(--fg);
    font-weight: 500;
    padding: var(--nav-pad-y) var(--nav-pad-x);
    margin: calc(-1 * var(--nav-pad-y)) calc(-1 * var(--nav-pad-x));
}
.nav-inner > a.active { color: var(--accent); }
/* The underline, drawn outside the layout: a border or padding would make an
   underlined link's box taller than the rest, and the nav centres its items
   by their boxes, so its text would sit off the others' line. In the text's
   own colour - the accent on the current page, the plain text colour on a
   hovered one - and in place of the site's hover underline, which would put
   a second line under the first. */
.nav-inner > a:hover { text-decoration: none; }
.nav-inner > a.active::after,
.nav-inner > a:hover::after {
    content: "";
    position: absolute;
    left: var(--nav-pad-x);
    right: var(--nav-pad-x);
    bottom: calc(var(--nav-pad-y) - 4px);
    height: 2px;
    background: currentColor;
}
.nav .nav-end {
    margin-left: auto;
    color: var(--fg-dim);
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.nav-end > a { color: var(--fg-mute); }

/* The theme control: three buttons in one pill.

   A segmented control rather than a slide switch because a switch is a
   BOOLEAN affordance, and this has three states - offering three in a
   switch would be a lie it tells. Sites that use a switch have dropped
   "follow the system"; the ones that keep it use this shape.

   Sized to sit inside the nav's existing height, which is set by the 26px
   icon, so it can grow a little without moving the bar. */
.theme-seg {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    overflow: hidden;
}
.theme-seg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2em 0.45em;
    border: 0;
    background: none;
    color: var(--fg-mute);
    cursor: pointer;
    line-height: 0; /* the icon is the content; no descender space */
}
.theme-seg-btn + .theme-seg-btn { border-left: 1px solid var(--border); }
.theme-seg-btn svg {
    width: 1.05em;
    height: 1.05em;
}
.theme-seg-btn:hover { color: var(--fg); background: var(--bg-soft); }
/* aria-pressed is the state, so the highlight reads from it rather than
   from a class beside it that could disagree. */
.theme-seg-btn[aria-pressed="true"] {
    color: var(--on-accent);
    background: var(--accent);
}
.theme-seg-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

/* Visible to a screen reader, not to the eye. The segmented buttons are
   icons; this is what says which is which out loud. */
/* A title shown on a tap, on a touch screen (app.js, attachTouchTips). */
.touch-tip {
    position: absolute;
    z-index: 30;
    max-width: min(22em, calc(100vw - 16px));
    padding: 0.35em 0.6em;
    background: var(--bg-card);
    color: var(--fg);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    box-shadow: var(--shadow-pop);
    font-size: 0.85em;
    pointer-events: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--fg-dim);
    transition: background 0.3s;
}
.dot.live { background: var(--good); animation: pulse 2s infinite; }
.dot.stale { background: var(--bad); }
.dot.online { background: var(--good); margin-right: 0.4em; }
.dot.offline { background: var(--fg-dim); margin-right: 0.4em; }
/* Between the two: a device whose heartbeat is still fresh but which has no
   relay WebSocket. It cannot serve a photo, so it must not read as green. */
.dot.waning { background: var(--warn); margin-right: 0.4em; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- main column ----------------------------------------------------- */

main {
    max-width: 1200px;
    margin: 1.5em auto 4em;
    padding: 0 1.25em;
}

h2 {
    font-size: 1.15em;
    font-weight: 600;
    margin: 1.5em 0 0.5em;
}
h2:first-of-type { margin-top: 0; }

.muted { color: var(--fg-mute); }
.dim { color: var(--fg-dim); }

/* An age app.js ticks ("12s ago") holds the room of its longest wording,
   under 1000 days, so a tick never re-fits the table or line around it. */
span[data-age-s] { display: inline-grid; }
span[data-age-s]::after {
    content: "000m ago";
    visibility: hidden;
    height: 0;
}

/* Per-camera capture number, leading the File cell in the photo table. It is
   the row's real identity (the camera's filename repeats), but the filename is
   what a photographer recognises - so seq is set in tabular monospace to keep
   the numbers aligned down the column, and muted so the eye still lands on the
   name. */
.seq {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    font-variant-numeric: tabular-nums;
    color: var(--fg-mute);
}

/* ---- stat strip ------------------------------------------------------ */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75em;
    margin-bottom: 1.5em;
}
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.75em 1em;
}
.stat .label {
    font-size: 0.8em;
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.stat .value {
    font-size: 1.6em;
    font-weight: 600;
    margin-top: 0.15em;
}
.stat .sub {
    font-size: 0.85em;
    color: var(--fg-dim);
    margin-top: 0.15em;
}

/* ---- the filter (docs/design/part_filter.md) ------------------------ */

/* The box, and the presets to its right. */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em 1em;
    margin: 0.5em 0 0.4em;
}
.filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4em;
    position: relative;
}
.filter-form input[type="search"] {
    width: 260px;
    max-width: 100%;
    padding: 0.5em 0.75em;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font: inherit;
    background: var(--bg-card);
}
.filter-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-mute);
}
/* Directly above the table: the count, then what is narrowing it. Tall
   enough for a pill even with none on, so the first one does not move the
   table. */
.filter-pills {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4em 0.5em;
    min-height: 1.9em;
    margin: 0 0 0.4em;
}
.filter-pills .counts {
    margin-right: 0.25em;
    color: var(--fg-mute);
    font-size: 0.9em;
}
.filter-clear { font-size: 0.9em; }

/* A photo table's order and view, at the far end of the count line. */
.table-view {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-left: auto;
    font-size: 0.85em;
}
.table-sort {
    display: flex;
    align-items: center;
    gap: 0.4em;
    color: var(--fg-mute);
}
.table-sort select {
    padding: 0.2em 0.4em;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--fg);
    font: inherit;
}
.view-switch {
    display: inline-flex;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    overflow: hidden;
}
.view-switch a,
.view-switch button {
    padding: 0.2em 0.7em;
    color: var(--fg-mute);
    text-decoration: none;
}
.view-switch button {
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}
.view-switch a + a,
.view-switch button + button { border-left: 1px solid var(--border-strong); }
.view-switch a:hover,
.view-switch button:hover { color: var(--fg); text-decoration: none; }
.view-switch a.is-on,
.view-switch button[aria-pressed="true"] {
    background: var(--accent-mute);
    color: var(--fg);
}

/* The grid view of a photo table: tiles of the thumbnail, the stored name and
   the verdict, filling the width. Marked and selected the way rows are. */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.6em;
}
.photo-tile {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
    min-width: 0;
    padding: 0.4em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
}
.photo-tile:hover { border-color: var(--border-strong); }
.photo-tile.culled { background: var(--bg-row-culled); }
.photo-tile.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}
.photo-tile-picture {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    border-radius: 4px;
    background: var(--bg);
    overflow: hidden;
}
.photo-tile-picture img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.photo-tile-note {
    color: var(--fg-mute);
    font-size: 0.8em;
}
.photo-tile-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.photo-tile-verdict {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.photo-grid-empty { grid-column: 1 / -1; }

/* One thing narrowing the table, with the × that takes it off: the pill
   every pill is (docs/design/part_pill.md), the card's when plain. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.15em;
    padding: 0.1em 0.2em 0.1em 0.6em;
    line-height: 1.4;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    font-size: 0.85em;
    white-space: nowrap;
}
.pill:hover { border-color: var(--accent); }
/* A tag pill wears the tag chip's colour, so it reads as the tag it keeps. */
.pill-tag { background: var(--accent-mute); }
/* The mark's colour, in place of its glyph: the pill already ends in a ×. */
.pill-marked,
.pill-marked:hover {
    border-color: var(--bad);
    background: var(--bad-mute);
    color: var(--bad);
}
.pill-star-glyphs { color: var(--star-on); }
.pill-client-glyphs { color: var(--accent); }

/* The × at the end of a pill that takes it off - a filter's or a tag's.
   Under the pointer it is washed in a circle and goes to full strength, so
   it reads as the part of the pill that is pressed. */
.pill-remove,
.tag-remove-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2em;
    height: 1.2em;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--fg-mute);
    font: inherit;
    font-size: 1.1em;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}
.pill-remove:hover,
.pill-remove:focus-visible,
.tag-remove-button:hover,
.tag-remove-button:focus-visible {
    background: var(--bg-soft-strong);
    color: var(--fg);
    text-decoration: none;
    outline: none;
}

/* The presets: one click each. Dashed while off, so they read as offers
   rather than as pills already narrowing the table. */
.filter-presets {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4em;
    font-size: 0.85em;
}
.filter-presets-label { color: var(--fg-mute); }
.preset {
    padding: 0.15em 0.65em;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    color: var(--fg-mute);
    text-decoration: none;
    white-space: nowrap;
}
a.preset:hover {
    border-style: solid;
    color: var(--fg);
    text-decoration: none;
}
.preset.is-on {
    border-style: solid;
    border-color: var(--accent);
    background: var(--accent-mute);
    color: var(--fg);
}
.preset-marked.is-on {
    border-color: var(--bad);
    background: var(--bad-mute);
    color: var(--bad);
}
.preset-at-least {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}
/* Highest first in the markup and reversed here, so the star under the
   pointer and every one after it in the markup - before it on screen -
   light together, as the Rating column's stars preview. */
.preset-stars {
    display: inline-flex;
    flex-direction: row-reverse;
}
.preset-stars a {
    padding: 0 0.05em;
    color: var(--star-off);
    font-size: 1.15em;
    line-height: 1;
    text-decoration: none;
}
.preset-stars a.lit { color: var(--star-on); }
.preset-stars:hover a { color: var(--star-off); }
.preset-stars a:hover,
.preset-stars a:hover ~ a { color: var(--star-on); }
/* A client's, in the accent their stars are shown in. */
.preset-client-stars a.lit { color: var(--accent); }
.preset-client-stars:hover a { color: var(--star-off); }
.preset-client-stars a:hover,
.preset-client-stars a:hover ~ a { color: var(--accent); }

/* ---- tables ---------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    /* Rounded at the corner cells below rather than with `overflow:
     * hidden`, which would also clip anything a cell positions outside
     * itself. */
}
/* Round the corners of the first/last cells in the first/last rows so a
 * hover background or selected-row tint doesn't paint square over the
 * table's rounded outer corners (replaces the dropped `overflow: hidden`
 * trick on the table). */
tr:first-child > :first-child { border-top-left-radius: 4px; }
tr:first-child > :last-child { border-top-right-radius: 4px; }
tr:last-child > :first-child { border-bottom-left-radius: 4px; }
tr:last-child > :last-child { border-bottom-right-radius: 4px; }
th, td {
    padding: 0.5em 0.75em;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
th {
    background: var(--bg-th);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-mute);
    border-bottom: 2px solid var(--border-strong);
    user-select: none;
}
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { color: var(--fg); }
th.sort-asc::after { content: " ▲"; color: var(--accent); }
th.sort-desc::after { content: " ▼"; color: var(--accent); }
/* A photo table's sortable headers are links to the order they set, drawn as
   the header text rather than as links. */
th a.sort-link {
    color: inherit;
    text-decoration: none;
}
th a.sort-link:hover { color: var(--fg); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-row-hover); }
/* A frame marked for culling, in a list of frames that are not. The wash is
   the same --bad-mute the marked pill sits on, so the row and the control in
   it say one thing.

   Hover is layered ON TOP as a background-image rather than replacing the
   background, which is what --bg-soft exists for - a plain hover rule would
   win on specificity and the row would lose its state exactly while being
   pointed at. */
tbody tr.culled { background: var(--bg-row-culled); }
tbody tr.culled:hover {
    background-image: linear-gradient(var(--bg-soft), var(--bg-soft));
}
/* The row the photo preview holds. An outline rather than a fill, so a
   marked row keeps its tint; and no hover wash under it, which would read as
   a second state on the same row. */
tbody tr.selected > td {
    box-shadow: inset 0 1px var(--accent), inset 0 -1px var(--accent);
}
tbody tr.selected > td:first-child {
    box-shadow: inset 0 1px var(--accent), inset 0 -1px var(--accent),
        inset 3px 0 var(--accent);
}
tbody tr.selected:not(.culled):hover { background: none; }
tbody tr.selected.culled:hover { background-image: none; }
td.numeric, th.numeric { text-align: right; }
.empty {
    padding: 2em;
    text-align: center;
    color: var(--fg-mute);
}

/* Photo thumbnail column. The camera-supplied embedded thumbnail is
 * 160x120 baseline JPEG (lifted from EXIF / TIFF-IFD). Inline display
 * is sized to roughly match the row's text height (30px) so the
 * thumbnail column doesn't stretch every row. The box is that 4:3 before
 * the picture arrives and whatever its shape, so a thumbnail loading never
 * re-fits the table's columns; another shape is fitted inside it, uncropped.
 * The larger look is the photo preview above the table. */
td.thumb-cell {
    width: 1px;     /* shrink-wrap to the image */
    padding: 0.15em 0.5em;
    position: relative;
}
img.photo-thumb {
    display: block;
    height: 30px;
    width: auto;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: 2px;
    background: var(--bg);
}
/* ---- star rating ----------------------------------------------------- */

/* Inline 5-star widget. Each star is a <button> so it's keyboard-focusable
 * and clearly interactive; styled to look like text with a tight cluster.
 * Hover previews higher ratings; the current rating is the .filled state. */
.stars {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    line-height: 1;
}
.stars .star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 1px;
    font-size: 1.1em;
    color: var(--star-off);
    line-height: 1;
    transition: color 0.08s;
}
.stars .star.filled { color: var(--star-on); }
/* The client's rating, where the owner has given none: the same stars in
   the accent. Hovering previews the owner's own, as on any stars. */
.stars.is-client .star.filled { color: var(--accent); }
.stars:hover .star { color: var(--star-off); }
.stars .star:hover,
.stars .star:hover ~ .star,
.stars:hover .star.filled { color: var(--star-off); } /* reset on hover */
.stars .star:hover { color: var(--star-on); }
.stars .star:hover ~ .star { color: var(--star-off); }
/* Highlight the hovered star + all earlier siblings - achieved with the
 * inverted markup approach below would need flex-direction:row-reverse;
 * keep the natural order and use :has() so older Safari doesn't break. */
.stars:has(.star:hover) .star { color: var(--star-off); }
.stars:has(.star:nth-child(1):hover) .star:nth-child(-n+1) { color: var(--star-on); }
.stars:has(.star:nth-child(2):hover) .star:nth-child(-n+2) { color: var(--star-on); }
.stars:has(.star:nth-child(3):hover) .star:nth-child(-n+3) { color: var(--star-on); }
.stars:has(.star:nth-child(4):hover) .star:nth-child(-n+4) { color: var(--star-on); }
.stars:has(.star:nth-child(5):hover) .star:nth-child(-n+5) { color: var(--star-on); }
.stars.pending { opacity: 0.5; }

/* ---- photo detail page ---------------------------------------------- */

:root {
    /* The detail pages' left column of cards: a photo's thumbnail, Fetch
       and Manage, a session's sharing and Manage. Named so the two stay one
       width. */
    --detail-col: 320px;
}
.photo-detail {
    display: grid;
    grid-template-columns: minmax(0, var(--detail-col)) 1fr;
    gap: 2em;
    align-items: start;
}
.photo-detail-preview {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    align-items: stretch;
}
img.photo-detail-thumb,
.photo-detail-thumb-empty {
    display: block;
    width: 100%;
    /* The 4:3 EXIF thumbnail is 160x120; CSS scales it up to fill the
     * column without distorting (object-fit isn't needed - the source
     * is already 4:3). image-rendering: pixelated isn't ideal for a
     * photo, but the 2x-ish upscale here keeps the source recognisable
     * without a blurry blow-up. */
    aspect-ratio: 4 / 3;
    border-radius: 4px;
    border: 1px solid var(--border-strong);
    background: var(--bg-card);
}
.photo-detail-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--fg-mute);
    font-size: 0.9em;
}
/* The photo page's histogram, the column's width and a little taller than
   the preview's, framed like the picture above it. */
.photo-detail-histogram .photo-histogram-plot {
    height: 88px;
    border: 1px solid var(--border);
    font-size: 0.85em;
}
.photo-detail-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
}
.photo-detail-actions-note {
    font-size: 0.85em;
    margin-top: 0.25em;
}
/* ---- fetch block (photo detail) -------------------------------------
 *
 * The relay-backed actions, presented as availability rather than as two
 * bare links: what each one would move, where those bytes live, and
 * whether the machine holding them is reachable. An action whose holder
 * is offline renders as a <span> instead of an <a> - it is deliberately
 * NOT styled as a disabled button, because it isn't a control that has
 * been switched off, it is a statement about where the file is. */
.fetch,
.manage {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
}
.fetch-head,
.manage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5em;
    padding: 0.45em 0.6em;
    border-bottom: 1px solid var(--border);
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-mute);
}
.fetch-where {
    display: flex;
    align-items: center;
    gap: 0.4em;
    /* The device name is content, not a label - undo the header's casing. */
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.1em;
}
.fetch-where.is-off { color: var(--fg-dim); }
.fetch-body,
.manage-body {
    display: flex;
    flex-direction: column;
    padding: 0.3em;
    gap: 0.15em;
}
a.fetch-action,
span.fetch-action {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    padding: 0.4em 0.5em;
    border-radius: 4px;
}
a.fetch-action:hover { background: var(--accent-mute); text-decoration: none; }
.fetch-action-name { font-weight: 600; }
a.fetch-action .fetch-action-name { color: var(--accent); }
.fetch-action-meta { font-size: 0.85em; color: var(--fg-mute); }
span.fetch-action .fetch-action-name,
span.fetch-action .fetch-action-meta { color: var(--fg-dim); }
/* Manage: the same card as .fetch, because it is the same kind of thing - a
   short list of what you can DO to whatever the page is about. The shape is
   the point. A bordered panel whose every row states an action and its
   consequence reads as an operation; the same words as an underlined phrase
   in a paragraph read as a link, and people click links to see where they
   go. One of these erases files off every machine the photographer owns.
   Buttons, not anchors, for the same reason: a POST that destroys something
   should not look like navigation. */
/* Capped for the pages with no left column to sit in - a panel of two short
   rows stretched across a wide screen reads as a banner, not a control. In
   the grid it is already narrower than this, so the cap does nothing there. */
.manage { max-width: var(--detail-col); }
.manage-body form { display: contents; }
.manage-action {
    display: flex;
    flex-direction: column;
    gap: 0.1em;
    width: 100%;
    padding: 0.4em 0.5em;
    border: 0;
    border-radius: 4px;
    background: none;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.manage-action:hover { background: var(--accent-mute); }
.manage-action-name { font-weight: 600; color: var(--accent); }
.manage-action-meta { font-size: 0.85em; color: var(--fg-mute); }
/* Marked at rest, unlike the old text link that was red for no reason: here
   the colour says which ROW is the irreversible one, in a panel where the
   others are not. It is a category, not a hover state. */
.manage-action.is-destructive .manage-action-name { color: var(--bad); }

.fetch-foot {
    padding: 0.45em 0.6em;
    border-top: 1px solid var(--border);
    font-size: 0.85em;
    color: var(--fg-mute);
}
.photo-detail-rating {
    display: flex;
    justify-content: center;
    padding: 0.25em 0;
}
.photo-detail-rating .star { font-size: 1.6em; }
/* Sized with the stars beside it - the verdict is one control, and a mark at
   row size next to 1.6em stars reads as an afterthought. */

/* The previous / next bar, above the heading on both detail pages. It sits
   there rather than at the foot of the page because the pages differ in
   length - a photo with four renditions is taller than one with none - so at
   the bottom the link moved every time you followed it, and walking a
   session meant re-finding it on each capture. Above the heading it is at
   the same place on every page.

   Small and quiet: it is a way through, not the point of the page. The
   dimmed ends keep their space so the row does not reflow at the first and
   last item. */
.detail-nav {
    margin: 0 0 0.85em;
    font-size: 0.85em;
}

.photo-detail-heading {
    margin: 0 0 1em;
    font-size: 1.15em;
    font-weight: 600;
}
.photo-detail-meta h3 {
    margin: 1.75em 0 0.5em;
    font-size: 1em;
    font-weight: 600;
}

/* Terms sized to the longest one present, with 7em as the floor so pages whose
   terms are all short keep the alignment they had. A fixed 7em wrapped the
   13-character terms - "ORIGINAL NAME" here, "FIRST CAPTURE" on the camera page
   - and a wrapped two-line term against a one-line definition pulls the whole
   list out of alignment. max-content rather than a bigger fixed width so the
   next term added can't quietly reintroduce this. */
dl.kv-list {
    display: grid;
    grid-template-columns: minmax(7em, max-content) minmax(0, 1fr);
    column-gap: 1em;
    row-gap: 0.4em;
    margin: 0 0 1em;
}
dl.kv-list dt {
    color: var(--fg-mute);
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: center;
}
/* A value as wide as the column at most, so a phone wraps a uuid rather than
   widening the page. */
dl.kv-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}
/* A row whose value is several lines tall - a thing's tags and the field
   that puts one on: its term level with the value's first line rather than
   centred on the whole. The term is 0.85em, so the line it is centred in is
   the value's 1.8em - where a tag pill's middle is - divided by that. */
dl.kv-list .kv-top { align-self: start; }
dl.kv-list dt.kv-top { line-height: calc(1.8em / 0.85); }
/* The tags alone on that first line, the field under them, as wide as the
   field so the list under it is too. */
dl.kv-list dd.kv-top .tag-add { display: flex; width: fit-content; }

.rendition-table {
    width: auto;
    min-width: 460px;
}
.rendition-table th,
.rendition-table td {
    padding: 0.4em 0.75em;
}
.rendition-yes {
    color: var(--good);
    font-weight: 500;
}

/* A session's page: its cards in the detail column at the left, its
   details at the right, as a photo's page is. The details come first in
   the page, so a phone shows them first. */
.session-detail {
    display: grid;
    grid-template-columns: minmax(0, var(--detail-col)) minmax(0, 1fr);
    gap: 2em;
    align-items: start;
    margin-bottom: 1em;
}
.session-detail-meta { grid-column: 2; grid-row: 1; min-width: 0; }
.session-detail-meta h2 { margin: 0 0 1em; }
.session-detail-meta .kv-list { margin: 0; }
.session-detail-side {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}
.session-detail-side .share-card { margin-bottom: 0; }
.session-detail-side .manage { max-width: none; }

/* Rename beside a session's heading, quieter than the name; renaming, the
   heading is its number and the name in a field, at the heading's size. */
.session-rename-link {
    margin-left: 0.5em;
    font-size: 0.75em;
    font-weight: 400;
}
.session-rename {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    margin: 0 0 1em;
    font-size: 1.15em;
    font-weight: 600;
}
.session-rename input {
    flex: 1 1 14em;
    max-width: 28em;
    padding: 0.2em 0.45em;
    font: inherit;
    color: var(--fg);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}
.session-rename input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-mute);
}
.session-rename .btn-primary,
.session-rename .btn-secondary { font-size: 0.87em; font-weight: 400; }

/* What a session's default tags are for, and the offer to put the one just
   added on the photos already taken. */
.tag-defaults-note { margin: 0.4em 0 0; font-size: 0.9em; }
.tag-earlier {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    margin: 0.5em 0 0;
}

/* Stack the preview above the metadata on narrow screens, and a session's
   cards under its details. */
@media (max-width: 720px) {
    .photo-detail,
    .session-detail {
        grid-template-columns: 1fr;
    }
    .session-detail-meta,
    .session-detail-side { grid-column: auto; grid-row: auto; }
}

/* ---- error card (e.g. /photos/<uuid>/original on relay failure) ----- */

.error-card {
    max-width: 640px;
    margin: 2em auto;
    padding: 1.5em 1.75em;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-soft, transparent);
}
.error-card h2 {
    margin-top: 0;
}
.error-card .error-summary {
    font-size: 1.05em;
    margin: 0.5em 0 1em;
}
.error-card .error-suggestions {
    margin: 0.25em 0 1em 1.25em;
    line-height: 1.55;
}

/* ---- in-page original viewer (lightbox) ----------------------------- */
/*
 * Used by app.js attachOriginalViewer: clicking "View original" or the
 * thumbnail spins up an overlay that fetches the bytes async. Success
 * paints the image inside; failure paints an inline message + retry.
 * Either way the user stays on the photo detail page.
 */

.original-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}
.original-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;
}
.original-overlay-card {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75em 0.75em 0.6em;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
}
.original-overlay-close {
    position: absolute;
    top: 0.25em;
    right: 0.5em;
    background: transparent;
    border: 0;
    color: var(--fg-mute);
    font-size: 1.6em;
    line-height: 1;
    cursor: pointer;
    padding: 0.1em 0.4em;
}
.original-overlay-close:hover {
    color: var(--fg);
}
.original-overlay-caption {
    font-size: 0.85em;
    color: var(--fg-mute);
    margin: 0 1.75em 0.5em 0.25em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.original-overlay-body {
    flex: 1 1 auto;
    min-width: 280px;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.original-overlay-body img {
    max-width: 100%;
    max-height: 84vh;
    object-fit: contain;
    display: block;
}
.original-overlay-status {
    color: var(--fg-mute);
    font-size: 0.95em;
}

/* Transfer state for a relay fetch. The bar is INDETERMINATE on
   purpose: the browser can't see the device -> server leg, so a
   percentage would be invented (see the note in app.js). Its job is to
   show liveness; the elapsed counter next to it is the honest number. */
.original-overlay-loading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55em;
    min-width: 260px;
    max-width: 340px;
    padding: 0.5em 0.25em;
}
.original-overlay-progress {
    position: relative;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    overflow: hidden;
}
.original-overlay-progress-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    /* Narrower than the track, sliding the full width - reads as
       "working, position unknown" rather than "38% done". */
    width: 38%;
    border-radius: 2px;
    background: var(--fg-mute);
    animation: kv-indeterminate 1.4s ease-in-out infinite;
}
@keyframes kv-indeterminate {
    0%   { left: -40%; }
    100% { left: 100%; }
}
.original-overlay-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 1em;
    font-size: 0.82em;
    color: var(--fg-mute);
    font-variant-numeric: tabular-nums;
}
.original-overlay-progress-size {
    color: var(--fg-mute);
}
.original-overlay-hint {
    font-size: 0.82em;
    color: var(--fg-mute);
    line-height: 1.35;
    /* Reserve the line so the card doesn't jump when the hint appears
       partway through a long transfer. */
    min-height: 1.35em;
}

/* Motion is decoration here - the elapsed counter carries the same
   information, so honour a reduced-motion preference by holding the bar
   still. */
@media (prefers-reduced-motion: reduce) {
    .original-overlay-progress-fill {
        animation: none;
        left: 0;
        width: 100%;
        opacity: 0.4;
    }
}

.original-overlay-error {
    max-width: 460px;
    text-align: center;
    padding: 1em 0.5em;
}
.original-overlay-error-label {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 0.4em;
}
.original-overlay-error-detail {
    color: var(--fg-mute);
    margin: 0.25em 0 0.75em;
    line-height: 1.45;
}
.original-overlay-error-meta {
    color: var(--fg-mute);
    font-size: 0.8em;
    font-family: var(--mono, monospace);
    margin-bottom: 1em;
}
.original-overlay-error-actions {
    display: flex;
    gap: 0.6em;
    justify-content: center;
}
.original-overlay-error-actions .btn-retry,
.original-overlay-error-actions .btn-secondary {
    display: inline-block;
    padding: 0.45em 1em;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: transparent;
    color: var(--fg);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95em;
}
.original-overlay-error-actions .btn-retry {
    border-color: var(--fg);
}
.original-overlay-error-actions .btn-retry:hover,
.original-overlay-error-actions .btn-secondary:hover {
    background: var(--bg-soft);
}

/* ---- pairing, on the devices page ------------------------------------ */

.pair-card {
    display: grid;
    grid-template-columns: minmax(0, 240px) 1fr;
    gap: 2em;
    align-items: start;
    margin-top: 1em;
}

/* The typeable pair code: the thing the user came for, so it gets the size.
   nowrap + scroll rather than wrapping - a code broken across lines is one
   you can misread. text-indent offsets the trailing letter-space so the
   glyphs sit optically centred rather than a touch left. */
.pair-code-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 2.5em;
    letter-spacing: 0.2em;
    text-indent: 0.2em;
    padding: 0.6em 0.5em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    user-select: all;
    white-space: nowrap;
    overflow-x: auto;
}

/* Code + its copy button on one line, the code taking the space. */
.pair-code-block {
    display: flex;
    align-items: stretch;
    gap: 0.5em;
}
.pair-code-block .pair-code-display {
    flex: 1;
    min-width: 0;
}

/* How long the code has left, under it. Tabular figures, so the line does
   not shuffle as the seconds change. */
.pair-countdown {
    margin-top: 0.5em;
    font-size: 0.9em;
    color: var(--fg-mute);
    font-variant-numeric: tabular-nums;
}

/* The card once its code has run out: one message across its width. */
.pair-card.is-expired { display: block; }
.pair-expired {
    padding: 2em 0;
    text-align: center;
}
.pair-expired-text {
    margin: 0 0 1em;
    font-size: 1.2em;
    color: var(--fg-mute);
}

/* Controls that only work with JS. Hidden until app.js sets .js on <html>,
   so a button that cannot function never renders. */
.js-only { display: none; }
.js .js-only { display: inline-flex; }

.copy-btn {
    align-items: center;
    justify-content: center;
    padding: 0 1em;
    min-width: 6.5em;
    font: inherit;
    font-size: 0.9em;
    color: var(--fg-mute);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    /* The label swaps to "Copied" / "Press Ctrl+C" on click; a min-width
       stops the button resizing under the pointer as it does. */
    white-space: nowrap;
}
.copy-btn:hover { border-color: var(--border-strong); color: var(--fg); }
.copy-btn.copied { color: var(--good); border-color: var(--good); }
.copy-btn.copy-failed { color: var(--warn); border-color: var(--warn); }

/* Secondary prose - the "what is this" explanation that sits under the thing
   you actually came for. */
.pair-note { font-size: 0.9em; }

/* The devices table's heading, under the pair card rather than at the top of
   a page of its own. Needs the space a second <h2> on one page wants and an
   <h2> that opens one does not. */
.devices-heading { margin-top: 2em; }

/* Vertical rhythm between the pair card's stacked blocks. Named by size
   rather than by what follows, so reordering doesn't strand them. */
.pair-gap-lg { margin-top: 1.5em; }
.pair-qr {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
    /* The qrcode lib emits a viewBox-sized SVG; let it scale to the
     * column width and stay square. */
    line-height: 0;
}
.pair-qr svg {
    display: block;
    width: 100%;
    height: auto;
}
.pair-info dd.mono { word-break: break-all; }

@media (max-width: 720px) {
    .pair-card { grid-template-columns: 1fr; }
}

/* ---- live feed ---------------------------------------------------------
   A session watched as it happens: one capture PRESENTED at size, every
   capture a row in the table beneath it - including the presented one,
   marked, so the table is a complete record and not "the ones that are not
   on screen".

   Everything here uses the site's own variables. An earlier version reached
   for --surface-2 / --muted / --ok, which do not exist, so every fallback
   was a dark literal and the page rendered as dark boxes dropped onto a
   light site. The palette is in :root at the top of this file; nothing below
   should invent one. */

.live-hero { margin-top: 1em; }

/* Sized off the VIEWPORT, not the width: at 3:2 a full-width hero on a wide
   screen would be taller than the screen, and the point is to see the whole
   frame without scrolling to it. */
.live-hero-frame {
    height: min(56vh, 38vw);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Fills the frame and lets object-fit scale the CONTENT, rather than being
   sized by the content. max-width/max-height only limit: a 160x120 thumbnail
   is smaller than the frame either way, so it drew at its natural size in the
   middle and then jumped to a full-size display copy - two different
   pictures in two different places, when it is one photograph arriving.
   width/height 100% makes both occupy the same box.

   Contained, not covered: this is the photograph being reviewed, so it is
   shown whole even when its shape does not match the box. */
.live-hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* The stand-in is a 160px thumbnail stretched over most of a screen, which
   without this reads as a broken image rather than a placeholder. Blurred,
   it reads as the photograph resolving - and it is only ever on screen until
   the display copy lands. Cleared by .is-display, so a capture whose display
   copy never arrives keeps a soft picture rather than a blocky one. */
.live-hero-image:not(.is-display) {
    filter: blur(8px);
    transform: scale(1.02); /* hides the blur's soft edge at the frame */
}

/* The hero shows its thumbnail until the display copy has loaded (app.js
   holds that out of the document until then, so the frame is never emptied).
   The fade is on the ARRIVING image, so the sharpening reads as the photo
   landing rather than as a flicker. */
.live-hero-image.is-display {
    filter: none;
    transform: none;
    animation: live-sharpen 220ms ease-out;
}

@keyframes live-sharpen {
    from { opacity: 0.35; }
    to   { opacity: 1; }
}

/* Name left, rating centre, facts right. The flanks are equal flexible
   columns and the rating is not, which is what centres it on the FRAME
   rather than between whatever the two ends happen to contain -
   space-between would drift as a filename or a camera name changed length,
   and the rating would never sit still while a session ran. */
.live-hero-meta {
    display: flex;
    align-items: center;
    gap: 1em;
    margin-top: 0.5em;
}

.live-hero-name {
    flex: 1 1 0;
    min-width: 0;
    font-size: 1.05em;
    /* Truncates rather than pushing the rating off centre. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-hero-stars,
.live-hero-cull { flex: 0 0 auto; }

/* Bigger than the strip's: this is the capture being reviewed, and rating it
   is the one thing this page asks of the person watching. */
.live-hero-stars .star { font-size: 1.35em; }

.live-hero-facts {
    flex: 1 1 0;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- the filmstrip ---- */

/* Horizontal, because screens are wide and not tall: a vertical list of
   full-width rows spent the height this page needs for the picture it is
   presenting. The strip costs one thumbnail's height and scrolls along the
   axis there is room on.

   It is the scroll container AND the swap target. Captures are appended, so
   a new one moves nothing already in the strip: somebody looking further
   back keeps their place without app.js having to restore it. */
.live-strip {
    display: flex;
    gap: 0.6em;
    margin-top: 1.25em;
    padding: 0.5em;
    overflow-x: auto;
    overflow-y: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    /* Snap so a flick lands on a frame rather than between two. Proximity,
       not mandatory: dragging the bar should still go where it was put. */
    scroll-snap-type: x proximity;
}

.live-cell {
    flex: 0 0 auto;
    /* Sized by the NAME, not by the picture. A stored name is 26 characters
       (LP_ + six digits + a twelve-hex tail + an extension), which in this
       mono face at 0.75em wants about 170px - below that the ellipsis ate
       the extension, and the extension is how you tell a CR3 from its HEIF.
       The thumbnail then follows the width rather than setting it. */
    width: 190px;
    display: flex;
    flex-direction: column;
    /* Laid out as a grid tile on Photos is: the name and time from the
       start, the stars at the start of their line and the mark at its end. */
    align-items: stretch;
    gap: 0.2em;
    padding: 0.35em 0.3em 0.25em;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    scroll-snap-align: start;
}

.live-cell:hover { background: var(--bg); }

/* Which capture is on screen. Tinted with the site's accent wash and
   outlined, so it is findable after scrolling along the strip. */
.live-cell.is-presented,
.live-cell.is-presented:hover {
    background: var(--accent-mute);
    border-color: var(--accent);
}

.live-cell-pick {
    display: block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    line-height: 0;
    border-radius: 3px;
}

/* A cell cannot take focus, so the button inside it is the keyboard's way
   in - without it the strip would be selectable by mouse only. */
.live-cell-pick:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Fixed box, so a cell keeps its shape while its thumbnail is still being
   retried - otherwise a capture landing would resize the strip and shift
   every cell in it. Covered rather than contained: at this size a letterbox
   would leave more frame than picture. */
.live-cell-thumb {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 2px;
    background: var(--bg);
}

/* Clipped to the cell, with the whole name in the title. The useful end is
   the front - LP_ then the capture number - which is what survives the
   ellipsis; the uuid tail that disambiguates it is what gets cut, and that
   is the right way round for reading a session. */
.live-cell-name {
    display: block;
    font-size: 0.75em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Direct, so it does not compete with the picture above it. */
    text-decoration: none;
}

.live-cell-name:hover { text-decoration: underline; }

.live-cell-caption {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
    font-size: 0.78em;
    color: var(--fg-mute);
}

.live-cell-when { white-space: nowrap; }
.live-cell-stars .star { font-size: 0.95em; }
.live-cell-verdict {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* The status line under the heading. Deliberately small: it is reassurance,
   not content - but it is on every page state, because between captures it
   is the only thing that says the page is working.

   Two halves pushed apart: WHO is connected on the left, WHAT is happening
   on the right. They update on different cadences and from different
   sources, and reading as one run-on sentence made them look like one fact
   that kept contradicting itself. */
/* The page heading and the one control that belongs beside it. The h2's own
   margins move out here so the flex row centres the button against the text
   rather than against the text plus its gap to what follows. */
.live-head {
    display: flex;
    align-items: center;
    gap: 0.75em;
    margin-bottom: 0.5em;
}
.live-head h2 { margin: 0; }

.live-status {
    display: flex;
    align-items: center;
    gap: 0.75em;
    font-size: 0.85em;
    color: var(--fg-mute);
    margin-top: 0.5em;
}

.live-status-devices {
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.live-activity {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

/* Busy is shown by movement, not by a spinner: the eye catches a pulse
   without being pulled to it, which matters on a page somebody is watching
   photographs on. */
.live-activity.is-busy {
    color: var(--fg);
    animation: live-busy 1.1s ease-in-out infinite;
}

@keyframes live-busy {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.45; }
}

.live-status-dot {
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: var(--fg-dim);
    flex: 0 0 auto;
}

.live-status-dot.live { background: var(--good); }
.live-status-dot.offline { background: var(--warn); }

/* The hero swaps from its thumbnail to the display rendition once that has
   loaded (app.js holds it out of the document until then, so the thumbnail
   is never replaced by nothing). The fade is on the ARRIVING image so the
   sharpening reads as the photo landing rather than as a flicker. */
.live-card-image.is-display {
    animation: live-sharpen 220ms ease-out;
}

@keyframes live-sharpen {
    from { opacity: 0.35; }
    to   { opacity: 1; }
}

/* Back to auto-advance. Shown only while paused, so its presence IS the
   signal that the hero has stopped following - a control that is always
   there would have to be read to know which state you are in. */
/* Lives on the HEADING line, right-aligned against "Live feed" - see
   .live-head. It appears and disappears as auto-advance is paused and
   resumed, and a control that toggles cannot share a row with anything it
   might be taller than: the status line beneath is an auto-height flex row
   of small text, so a button in there sets that row's height while it shows
   and steps the hero and the filmstrip down the page every time.

   INVARIANT: this button's box stays at or under the heading's line box.
   At the 14px/1.5 base that is 1.5 x 0.95 x 14 + 2 x 0.15 x 0.95 x 14 =
   23.9px against the h2's 1.5 x 1.15 x 14 = 24.1px. It holds, but by two
   tenths of a pixel - so it is a sum to redo rather than a rule to assume
   if the font-size or padding here, or the h2's size, ever changes. Give
   .live-head a min-height if the margin is ever wanted rather than
   computed. */
.live-resume {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0.15em 0.6em;
    font: inherit;
    font-size: 0.95em;
    color: var(--on-accent);
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 3px;
    cursor: pointer;
}

.live-resume:hover { filter: brightness(1.1); }

.live-resume:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- account menu ---------------------------------------------------- */

/* A <details> dropdown. The browser owns open/closed, focus and Escape, so
   there is no script here and nothing to be missing before app.js loads. */
.account-menu {
    position: relative;
}
/* Has to READ as a control. The button it replaced was a native <button>
   and looked like one for free; a <summary> gets no affordance at all, so
   with a transparent border and muted text this was text with a hairline
   round it and nothing said it could be clicked.

   So: a real border, a surface it sits on, and a caret big enough to be a
   caret. Stronger than the theme select beside it on purpose - this is the
   way in to everything else up here, and it should be the first thing the
   eye finds in the strip. */
.account-menu > summary {
    cursor: pointer;
    list-style: none; /* Firefox's default triangle - ours is in the markup */
    display: flex;
    align-items: center;
    gap: 0.45em;
    color: var(--on-accent);
    padding: 0.25em 0.55em;
    border: 1px solid transparent;
    border-radius: 4px;
    background: var(--accent);
    font-weight: 500;
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover { filter: brightness(1.1); }
/* Open reads as pressed rather than merely hovered - dimmed, not lifted,
   so the two states cannot be confused while the panel is down. */
.account-menu[open] > summary { filter: brightness(0.92); }
.account-menu[open] .account-menu-caret { transform: rotate(180deg); }
.account-menu > summary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}
/* The email can be long; the menu must not stretch the nav to fit it. */
.account-menu-name {
    max-width: 18ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* Sized in its own right rather than by a font's idea of a glyph: the
   viewBox scales to whatever this is set to, and stroke-width in the markup
   sets the weight, independently. The ceiling is about 1.4em: past that
   the chevron passes the label's line box and starts setting the
   trigger's height itself.

   No colour rule: the SVG strokes in currentColor, so it takes the label's
   and cannot go invisible against the fill it sits on. */
.account-menu-caret {
    width: 1.15em;
    height: 1.15em;
    flex: 0 0 auto;
    transition: transform 0.12s ease;
}

/* Anchored to the summary and pulled OUT of the nav's flow, so opening it
   cannot change the height of the bar it hangs from. */
.account-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35em);
    z-index: 20;
    min-width: 12em;
    /* Items run edge to edge, the way a menu does - so the hover highlight
       spans the full row rather than stopping short of the border with a
       margin of panel showing through. The rounding is clipped from the
       panel instead, which is why the rows need none of their own. */
    padding: 0.25em 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: var(--shadow-pop);
    display: flex;
    flex-direction: column;
}
/* One row of the menu, whether it is a link or a button - so the two look
   the same, which they did not when the nav's own link rules still reached
   in here.

   Left-aligned and plain: space-between and a gap were left over from the
   theme row, which held a label AND a control. Every row now holds one
   label, and space-between with a single item just meant the rule did
   nothing while implying it did. */
.account-menu-row {
    display: block;
    width: 100%;
    padding: 0.4em 0.9em;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 400;
    color: var(--fg);
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}
/* Full-bleed, because a menu highlights the ROW. Underline off: a menu
   item is not prose, and the global a:hover would put one there. */
.account-menu-row:hover {
    background: var(--bg-soft);
    text-decoration: none;
}
.account-menu-row:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}
.account-menu-logout { color: var(--bad); }

/* ---- settings page --------------------------------------------------- */

/* A column of cards, the apps' Settings card for card (docs/design/
   website.md, Settings): a heading, what the card does in small muted
   words, then its controls. */
.settings {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
    max-width: 44em;
}
.settings-card {
    padding: 1em 1.25em;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.settings-card h3 {
    font-size: 1em;
    font-weight: 600;
    margin: 0;
}
.settings-card p { margin: 0.35em 0 0; }
.settings-what {
    font-size: 0.85em;
    color: var(--fg-mute);
}
.settings-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em;
    margin-top: 0.75em;
}
.settings-controls form { margin: 0; }
.settings-saved {
    color: var(--good);
    font-weight: 500;
}
/* A card of several settings: each its own words over its control, ruled
   apart. */
.settings-setting > .settings-what {
    display: block;
    margin: 0.35em 0 0.5em;
}
.settings-setting + .settings-setting {
    margin-top: 0.75em;
    padding-top: 0.4em;
    border-top: 1px solid var(--border);
}
.settings-number {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.4em;
}
.settings-number input {
    width: 5em;
    padding: 0.4em 0.5em;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font: inherit;
    text-align: right;
    font-variant-numeric: tabular-nums;
    background: var(--bg-card);
    color: var(--fg);
}
.settings-controls select {
    padding: 0.35em 0.45em;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    font: inherit;
    background: var(--bg-card);
    color: var(--fg);
}
.settings-number input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-mute);
}
/* Says whether the number in the box is a decision or an inheritance -
   without it a default reads as something somebody chose. */
.settings-origin {
    margin-left: 0.6em;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--fg-mute);
}
.plan-warning { color: var(--warn); }
.settings-refused {
    font-size: 0.85em;
    color: var(--bad);
}
/* Staging's and development's plan test panel: dashed, so it never reads
   as part of the page a customer sees. */
.settings-testing {
    background: transparent;
    border: 1px dashed var(--border-strong);
}
.btn-primary {
    padding: 0.45em 1.1em;
    font: inherit;
    color: var(--on-accent);
    background: var(--accent);
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.1); }
a.btn-primary {
    display: inline-block;
    text-decoration: none;
}

/* Said above every page while the plan changes what the account can do. */
.plan-banner {
    margin: 0 0 1em;
    padding: 0.6em 0.9em;
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--warn);
    border-radius: 4px;
    background: var(--bg-card);
}
.plan-banner-bad { border-left-color: var(--bad); }

/* The pair card with no code, once the account has paired all it may. */
.pair-card.pair-full { display: block; max-width: 40em; }

/* ---- the introduction, at / ------------------------------------------ */

.landing-hero {
    display: flex;
    align-items: center;
    gap: 1.75em;
    max-width: 56em;
    margin: 1em 0 2em;
}
/* Taller than the headline, lead and button beside it at every width they
   share a row - 157 px at the narrowest - so the mark leads the page. */
.landing-hero img { flex: 0 0 auto; width: 176px; height: 176px; }
.landing-hero h2 {
    margin: 0 0 0.4em;
    font-size: 1.6em;
}
.landing-lead {
    margin: 0 0 1em;
    color: var(--fg-mute);
    font-size: 1.05em;
}
.landing-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}
.landing-closed {
    max-width: 56em;
    margin: 0 0 1.5em;
    padding: 0.9em 1.1em;
    background: var(--bad-mute);
    border: 1px solid var(--bad);
    border-left-width: 5px;
    border-radius: 4px;
    font-size: 1.05em;
}
.landing-closed strong {
    display: flex;
    align-items: center;
    gap: 0.45em;
    margin-bottom: 0.3em;
    color: var(--bad);
    font-size: 1.15em;
    font-weight: 600;
}
.landing-closed strong svg {
    width: 1.2em;
    height: 1.2em;
    flex: 0 0 auto;
}
.landing-closed p { margin: 0; color: var(--fg); }
/* How it works: the steps one under another, each beside its number, with
   a line down from one number to the next to say they come in order. */
.landing-steps {
    display: grid;
    gap: 1.25em;
    max-width: 44em;
    margin: 0.75em 0 2em;
    padding: 0;
    list-style: none;
}
.landing-steps li {
    position: relative;
    display: grid;
    grid-template-columns: 2.25em minmax(0, 1fr);
    column-gap: 0.9em;
    row-gap: 0.2em;
}
.landing-step-n {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 2.25em;
    height: 2.25em;
    border-radius: 50%;
    background: var(--accent-mute);
    color: var(--accent);
    font-weight: 600;
}
.landing-steps li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(2.25em + 0.35em);
    bottom: calc(-1.25em + 0.35em);
    left: calc(1.125em - 1px);
    border-left: 2px solid var(--border);
}
.landing-steps h4 { margin: 0; padding-top: 0.3em; font-size: 1.1em; }
.landing-steps p { margin: 0; color: var(--fg-mute); }

/* The landing page's rows of four cards - the apps to download and what the
   site does - on one grid, so the two rows line up: four across, two on a
   tablet and one on a phone, counts four cards fill, so none sits alone on
   a row. */
.downloads,
.landing-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1em;
}
@media (max-width: 900px) {
    .downloads,
    .landing-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .downloads,
    .landing-features { grid-template-columns: minmax(0, 1fr); }
}
.downloads { margin: 0.75em 0 2em; }
.download-card {
    display: flex;
    flex-direction: column;
    gap: 0.35em;
    padding: 1em 1.1em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
}
.download-card h4 { margin: 0; font-size: 1.15em; }
.download-card p { margin: 0; }
.download-card .download-version { margin-bottom: 0.6em; }
.download-card a { align-self: flex-start; margin-top: auto; }
.download-card.is-coming { border-style: dashed; background: transparent; }
.btn-secondary {
    display: inline-block;
    /* Less the border, so it stands as tall as .btn-primary, which has none. */
    padding: calc(0.45em - 1px) calc(1.1em - 1px);
    color: var(--fg);
    text-decoration: none;
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}
.btn-secondary:hover { border-color: var(--fg-mute); }
.landing-features > div {
    padding: 1em 1.1em;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-card);
}
.landing-features h4 { margin: 0 0 0.35em; }
.landing-features p {
    margin: 0;
    color: var(--fg-mute);
}
/* Stacked where the lead would wrap taller than the mark beside it. */
@media (max-width: 680px) {
    .landing-hero { flex-direction: column; align-items: flex-start; }
    .landing-hero img { width: 96px; height: 96px; }
}
.btn-primary:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* A destructive-ish action offered inline in running text, where a real
   button would outweigh the value beside it. Styled as a link because that
   is its weight; a <form>/<button> because it POSTs, and a GET that changes
   data is one the browser may follow on its own. */
.inline-form {
    display: inline;
}

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 0.85rem;
    color: var(--fg-dim);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-button:hover {
    color: var(--bad);
}

/* A tag: one word someone chose for a frame, and a link to every other frame
   carrying it. Pill-shaped so a row of them reads as a set rather than as
   prose, and small enough that a frame with several does not push the row
   taller than one without. */
.tag {
    display: inline-block;
    padding: 0.1em 0.6em;
    line-height: 1.4;
    margin: 0 0.25em 0 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--accent-mute);
    color: var(--fg);
    font-size: 0.85em;
    text-decoration: none;
    white-space: nowrap;
}
.tag:hover { border-color: var(--accent); }

/* Keeps a frame with four tags from making its row twice the height of one
   with none - the column is a glance, and the photo's own page is where the
   full set is read. */
.tags-cell {
    max-width: 16em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Says a list is showing part of the library rather than all of it. A
   filtered table is indistinguishable from a short one otherwise. */
.filter-note {
    margin: 0 0 0.75em;
    color: var(--fg-mute);
}

/* The tag currently narrowing the list, so a row shows which of its tags is
   doing the filtering. */
.tag.tag-on {
    border-color: var(--accent);
    font-weight: 600;
}

/* Drops one term from a multi-tag filter. Sits against its tag rather than
   at the end of the line: with three tags on, a single "clear" is too blunt
   and the usual next step is removing one. */
.tag-drop {
    margin: 0 0.35em 0 -0.15em;
    color: var(--fg-mute);
    text-decoration: none;
}
.tag-drop:hover { color: var(--accent); }



/* A tag that can be taken off: the tag's pill, holding the tag's link and,
   at its end, the × that takes it off. */
.tag-holder {
    display: inline-flex;
    align-items: center;
    gap: 0.15em;
    margin: 0 0.25em 0 0;
    padding: 0.1em 0.2em 0.1em 0.6em;
    line-height: 1.4;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--accent-mute);
    font-size: 0.85em;
    white-space: nowrap;
}
.tag-holder:hover { border-color: var(--accent); }
/* The tag inside is the holder's words, not a second pill. */
.tag-holder .tag {
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    font-size: 1em;
}
.tag-remove { display: inline-flex; }

/* Putting a tag on: a field, Enter to add, with the tags it can be given in
   a list under it as the filter box's (.tag-suggest). */
.tag-add {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    max-width: 100%;
    margin: 0.35em 0 0;
}
.tag-add input {
    flex: 0 1 auto;
    width: 16em;
    min-width: 0;
    padding: 0.4em 0.65em;
    font: inherit;
    color: var(--fg);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}
.tag-add .tag-suggest-item { cursor: pointer; }
.tag-add input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-mute);
}

/* The tags used last, under the field, each put on with one click. Drawn as
   the tag it would become, but hollow until it is on the frame. */
.tag-offers {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
    margin: 0.4em 0 0;
}
.tag-offer { display: inline; }
.tag-offer-button {
    margin: 0;
    font-family: inherit;
    cursor: pointer;
    color: var(--fg-mute);
    background: none;
    border-style: dashed;
    border-color: var(--border-strong);
}
.tag-offer-button:hover,
.tag-offer-button:focus-visible {
    color: var(--fg);
    border-style: solid;
    border-color: var(--accent);
    outline: none;
}

/* The table's tags, offered under the filter box as it is used. Each reads
   as the tag it would add, with the rows it would leave beside it. */
.tag-suggest {
    position: absolute;
    top: calc(100% + 0.25em);
    left: 0;
    z-index: 20;
    min-width: 100%;
    max-width: min(24em, calc(100vw - 32px));
    padding: 0.3em 0;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    box-shadow: var(--shadow-pop);
}
.tag-suggest-head {
    padding: 0.15em 0.75em 0.3em;
    font-size: 0.75em;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-mute);
}
.tag-suggest-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
    padding: 0.25em 0.75em;
    color: var(--fg);
    text-decoration: none;
}
.tag-suggest-item[hidden] { display: none; }
.tag-suggest-item .tag {
    overflow: hidden;
    text-overflow: ellipsis;
}
.tag-suggest-item:hover,
.tag-suggest-item.is-active { background: var(--accent-mute); }
.tag-suggest-item.is-active .tag { border-color: var(--accent); }
.tag-suggest-count {
    font-size: 0.85em;
    color: var(--fg-mute);
    font-variant-numeric: tabular-nums;
}

/* The cull mark, beside the stars in the verdict cell. Quiet until it is set,
   because an unmarked library is most of the library and a column of visible
   crosses would compete with the ratings for the same glance. Marked, it is
   the one thing in the row that is not grey. */
.cull-mark {
    background: none;
    border: 0;
    padding: 0 0.3em;
    margin-left: 0.4em;
    font: inherit;
    line-height: 1;
    color: var(--fg-dim);
    opacity: 0.45;
    cursor: pointer;
    transition: opacity 0.1s ease-in, color 0.1s ease-in;
}
/* Findable at rest, not shouting. A quarter opacity was too far: in a row of
   greys it read as a rendering artefact rather than a control, and on a page
   with no row to hover it never came up at all. */
tr:hover .cull-mark,
.live-cell:hover .cull-mark { opacity: 0.85; }
/* Hover EMPHASISES the state; it does not preview the other one. Previewing
   was tried and is wrong for a toggle: the pointer stays put after a click,
   so the preview immediately shows the opposite of what just happened, and
   every click looks like it failed - mark then unmark went red again and read
   as broken. A hovered control is a firmer version of what it already is, and
   its colour never contradicts its label. */
.cull-mark:hover,
.cull-mark:focus { opacity: 1; color: var(--fg); }
.cull-mark.marked:hover,
.cull-mark.marked:focus { opacity: 1; color: var(--bad); }
.cull-mark.marked {
    opacity: 1;
    color: var(--bad);
}

/* The same control on a photo's own page, where it says what it is. There is
   room for words here and only one frame to decide about, so the glyph alone
   would be a puzzle - and this is the surface where a cull is actually made,
   walking captures one at a time. */
.cull-mark-labelled {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    margin-left: 0.9em;
    padding: 0.3em 0.7em;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    opacity: 1;
    /* --fg-mute, not --fg-dim: this is a button with words on it, where dim
       is for the em-dash standing in for an empty cell. Dim reads 2.73:1 on
       a light page, which is fine for a placeholder and not for a label
       someone is meant to find and press. */
    color: var(--fg-mute);
}
/* The same rule on the pill, with the emphasis as a WASH LAID OVER whatever
   is already there rather than a different colour. --bg-soft is translucent,
   so one rule lifts the empty pill and the red one alike and neither loses
   its identity under the pointer. */
.cull-mark-labelled:hover {
    background-image: linear-gradient(var(--bg-soft), var(--bg-soft));
    border-color: var(--border-strong);
    color: var(--fg);
}
.cull-mark-labelled.marked:hover {
    border-color: var(--bad);
    color: var(--bad);
}
.cull-mark-labelled.marked {
    border-color: var(--bad);
    /* background-COLOR, not the shorthand: the shorthand resets
       background-image, and this rule sits after the hover one that lifts the
       pill with a --bg-soft wash. A marked pill would have had no hover at
       all - the one state where the feedback matters most, since it is the
       one you are about to undo. */
    background-color: var(--bad-mute);
}
.cull-mark-glyph { font-size: 1.1em; line-height: 1; }

/* The top of a photo table: the preview, and on Photos the cull panel
   beside it - the marked set and what can be done with it. With nothing
   marked the panel is one line saying how to fill it. The two are one
   height, whichever is taller. */
.photos-top {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0.75em;
    margin: 0 0 0.75em;
}
.photos-top > #cull-panel {
    flex: 0 1 var(--detail-col);
    min-width: 0;
}
.photos-top > #cull-panel > .manage { height: 100%; }

/* The photo preview: the frame under the pointer, or the selected one, with
   a column of its record's facts to the right. It takes the width the cull
   panel leaves, so the panel ends at the table's right edge. Every fact is
   one line, so the card is one height whatever it shows and the page never
   moves as the pointer runs down the table. */
.photo-preview {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}
.photo-preview-body {
    display: flex;
    align-items: flex-start;
    gap: 0.9em;
    padding: 0.5em 0.6em 0.6em;
}
.photo-preview-side {
    flex: 1 1 auto;
    min-width: 0;
}
.photo-preview-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.3em 0.75em;
    min-width: 0;
    margin: 0;
    font-size: 0.85em;
}
.photo-preview-facts dt { color: var(--fg-mute); }
/* The column is already set small, and .mono's own reduction on top of it
   left the names smaller than the values beside them. */
.photo-preview-facts .mono { font-size: inherit; }
/* A fact's line is one height whatever font it is in: a monospaced name's
   own line height differs from the text's by a fraction of a pixel, and that
   fraction would move everything under the card. */
.photo-preview-facts dt,
.photo-preview-facts dd {
    height: 1.4em;
    line-height: 1.4em;
}
.photo-preview-facts dd {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.photo-preview-lead {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 6px;
    width: 200px;
}
.photo-preview-picture {
    display: flex;
    width: 200px;
    align-items: center;
    justify-content: center;
    height: 150px;
    border-radius: 4px;
    background: var(--bg);
    overflow: hidden;
}
/* Filling the box enlarges the stored thumbnail (~160x120) a little: soft,
   but always there, where a sharper copy would need a device online. */
.photo-preview-picture img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.photo-preview-note {
    padding: 0 0.8em;
    color: var(--fg-mute);
    font-size: 0.85em;
    text-align: center;
}
/* The histogram (docs/design/part_histogram.md): a strip under the picture,
   at its width, while the Histogram row under the facts is open. One height
   whatever it holds - drawn, waiting, or none - so the card does not move as
   the pointer runs down the table. Red, green and blue add as light where
   they overlap, inside the SVG's own group, so where all three agree the
   fill is white. */
.photo-histogram {
    margin-top: 0.45em;
    font-size: 0.85em;
}
.photo-histogram > summary {
    width: max-content;
    color: var(--fg-mute);
    cursor: pointer;
}
.photo-histogram-plot {
    position: relative;
    height: 52px;
    border-radius: 4px;
    background: var(--hist-well);
    overflow: hidden;
    font-size: 0.8em;
}
.photo-preview:not(:has(.photo-histogram[open])) .photo-histogram-plot {
    display: none;
}
.photo-histogram-plot svg {
    display: block;
    width: 100%;
    height: 100%;
    isolation: isolate;
}
.hist-r, .hist-g, .hist-b { mix-blend-mode: plus-lighter; }
.hist-r { fill: var(--hist-r); }
.hist-g { fill: var(--hist-g); }
.hist-b { fill: var(--hist-b); }
.hist-luma {
    fill: none;
    stroke: var(--hist-luma);
    stroke-width: 1.25;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}
/* Clipping: a triangle over the end that clips, in the colour of the
   channels that do - near-white when all three do. */
.hist-clip {
    position: absolute;
    top: 3px;
    width: 10px;
    height: 8px;
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.hist-clip-low { left: 3px; }
.hist-clip-high { right: 3px; }
.hist-clip-r { background: var(--hist-clip-r); }
.hist-clip-g { background: var(--hist-clip-g); }
.hist-clip-b { background: var(--hist-clip-b); }
.hist-clip-rg { background: var(--hist-clip-rg); }
.hist-clip-rb { background: var(--hist-clip-rb); }
.hist-clip-gb { background: var(--hist-clip-gb); }
.hist-clip-all { background: var(--hist-clip-all); }
.photo-histogram-none {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hist-note);
}
/* Without hover there is no preview to follow, and a tap that selects a row
   is a tap made well below this, scrolled out of sight. */
@media (hover: none) {
    .photo-preview { display: none; }
    /* A fingertip's worth around a pill's ×. */
    .pill-remove,
    .tag-remove-button {
        width: 1.8em;
        height: 1.8em;
    }
    .cull-mark { opacity: 0.85; }
    /* The nav's own controls, a fingertip tall - set as a height, since the
       engines disagree about the theme icon's line box. */
    .theme-seg-btn { min-height: 44px; }
    .account-menu > summary {
        min-height: 44px;
        padding-top: 0;
        padding-bottom: 0;
    }
    /* A fingertip's worth around the same glyph, in the same place. */
    .original-overlay-close {
        top: 0;
        right: 0.25em;
        padding: 0.35em 0.65em;
    }
}
.cull-show {
    /* A link in the panel's head, not part of its label. */
    text-transform: none;
    letter-spacing: 0;
    font-size: 1.2em;
    /* The head's own line height at this size (1.5 / 1.2), so the head is
       as tall with the link as without it, and the page does not move when
       it comes and goes. */
    line-height: 1.25;
}
.cull-panel.is-empty .manage-head {
    border-bottom: 0;
    padding-bottom: 0;
}
.cull-hint {
    margin: 0;
    padding: 0.2em 0.6em 0.45em;
    font-size: 0.85em;
    color: var(--fg-mute);
}
.cull-hint-glyph { color: var(--bad); }

/* ---- phone ---------------------------------------------------------------
   Everything a phone needs that a desktop window does not, in one place and
   behind one width: phones are 360-430px upright, and no desktop window is
   this narrow in normal use, so nothing here reaches the desktop site. */
@media (max-width: 600px) {
    /* A phone's reading size. The nav keeps the desktop's 14px: six pages
       have to fit one row on a 360px screen. */
    body { font-size: 16px; }
    .nav { font-size: 14px; }

    main {
        margin-top: 1em;
        padding: 0 1em;
    }

    /* The icon and the account's controls on the first row, the library's
       pages on the second - two rows, where wrapping as they come took
       three. The zero-height item is what breaks the row. */
    .nav { padding: 0.5em 0 0; }
    .nav-inner {
        padding: 0 1em;
        gap: 0;
    }
    .nav h1 { margin-right: 0; }
    .nav .nav-end { order: 1; }
    .nav-inner::after {
        content: "";
        order: 2;
        flex-basis: 100%;
    }
    /* Each page's link is a fingertip tall and meets the next, so a tap
       between two still lands on one. In flow here, a row of their own;
       the first gives back its padding to stay in line with the icon. */
    .nav-inner > a {
        --nav-pad-y: 0.75em;
        --nav-pad-x: 0.35em;
        order: 3;
        margin: 0;
    }
    .nav-inner > a:first-of-type { margin-left: -0.35em; }
    .account-menu-name { max-width: 6ch; }

    /* The columns a phone does without, marked in the templates; what is
       left is what finds a row and what is done to it. */
    .phone-hide { display: none; }
    th, td { padding: 0.5em 0.45em; }
    td.numeric { white-space: nowrap; }

    /* One column that never grows past the screen: 1fr alone would widen
       to the renditions table, which then has nothing to scroll inside. */
    .photo-detail { grid-template-columns: minmax(0, 1fr); }
    .rendition-table { min-width: 0; }

    /* The code first: a phone cannot scan its own screen, so its QR is for
       another phone held up to it, and comes second at a size that still
       scans. */
    .pair-card { grid-template-columns: minmax(0, 1fr); }
    /* Sized so the nine characters of S-ABC-DEF fit beside Copy at 320px. */
    .pair-code-display {
        font-size: 1.6em;
        letter-spacing: 0.1em;
        text-indent: 0.1em;
    }
    .pair-info { order: -1; }
    .pair-qr { max-width: 200px; }

    /* Sized for a fingertip. */
    .stars .star {
        font-size: 1.4em;
        padding: 0.15em 0.05em;
    }
    .cull-mark:not(.cull-mark-labelled) {
        font-size: 1.2em;
        padding: 0.2em 0.4em;
    }

    /* The whole frame at the screen's width - sized off the height, it
       would be a strip. */
    .live-hero-frame {
        height: auto;
        aspect-ratio: 3 / 2;
    }
    /* The name and the facts each take a row, with the verdict between. */
    .live-hero-meta {
        flex-wrap: wrap;
        gap: 0.35em 1em;
    }
    .live-hero-name,
    .live-hero-facts {
        flex-basis: 100%;
        text-align: left;
    }
    .live-hero-stars { order: 1; }
    .live-hero-cull { order: 2; }
    .live-hero-facts { order: 3; }
}

/* A table wider than the screen scrolls inside its own border, rather than
   taking the whole page sideways with it: on a phone, and on a touch screen
   that can be narrower than the widest table - the photos table's nine
   columns need about 760px before any tags, past a phone held sideways and
   a tablet held upright. */
@media (max-width: 600px), (hover: none) and (max-width: 1000px) {
    table {
        display: block;
        width: max-content;
        max-width: 100%;
        overflow-x: auto;
    }
}

/* The site's own pages (site_*.html): one readable column. */
.site-page { max-width: 44em; }
.site-page h2 { font-size: 1.5em; margin-bottom: 0.6em; }
.site-page h3 { margin: 1.6em 0 0.4em; }
.site-page p,
.site-page li { line-height: 1.55; }
.site-page ul { padding-left: 1.2em; }
.site-page li + li { margin-top: 0.5em; }
.site-page address { font-style: normal; line-height: 1.55; }
.site-lead { font-size: 1.1em; }
.site-unwritten { color: var(--fg-mute); }
/* The download cards in the column: two across, which four cards fill, as a
   row of four would leave each too narrow to read. */
.site-page .downloads { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 600px) {
    .site-page .downloads { grid-template-columns: minmax(0, 1fr); }
}
.release-notes h4 { margin: 1.2em 0 0.3em; }

/* The footer: every site page, grouped, on every page. */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 1.75em 0 2.25em;
}
.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25em;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.5em 3.5em;
}
.site-footer nav {
    display: flex;
    flex-direction: column;
    gap: 0.4em;
}
.site-footer h2 {
    margin: 0 0 0.15em;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-mute);
}
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer-copy {
    margin: 0 0 0 auto;
    align-self: flex-end;
    color: var(--fg-mute);
    font-size: 0.9em;
}
@media (max-width: 600px) {
    .site-footer-copy { margin-left: 0; flex-basis: 100%; }
}

/* A phone held sideways: wide enough for the desktop nav, but at 740-750px
   it wrapped to two rows - a quarter of a screen 342px tall. One row fits
   with the account's name cut as a phone cuts it and the pages a little
   closer, each still clickable up to the next. */
@media (hover: none) and (max-height: 500px) and (min-width: 601px) {
    .nav-inner { column-gap: 1em; }
    .nav-inner > a { --nav-pad-x: 0.5em; }
    .account-menu-name { max-width: 6ch; }
}

/* The narrowest phones, 320px: the icon alone stands for the name - which
   stays the link's name to a screen reader - and the pages are a size
   smaller and closer, so the nav is two rows here as everywhere else. */
@media (max-width: 359px) {
    .nav-brand span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }
    .nav { font-size: 13px; }
    .nav-inner > a { --nav-pad-x: 0.2em; }
    .nav-inner > a:first-of-type { margin-left: -0.2em; }
}

/* ---- a guest's page (docs/design/page_share.md) ----------------------- */

/* Laid out for a phone first: the page is the screen, the picture takes
   what the heading and the strip leave, and nothing scrolls but the strip.
   It keeps Live's classes for the parts Live's script drives, and narrows
   them here. */
body.guest { margin: 0; }
.guest-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
}
.guest-head {
    display: flex;
    align-items: center;
    gap: 0.6em;
    padding: 0.55em 0.75em 0.35em;
}
.guest-mark { line-height: 0; }
.guest-title { flex: 1 1 auto; min-width: 0; }
.guest-title h2 {
    margin: 0;
    font-size: 1.05em;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.guest-whose {
    margin: 0;
    font-size: 0.8em;
    color: var(--fg-mute);
}
.guest-full {
    flex: 0 0 auto;
    width: 2.4em;
    height: 2.4em;
    padding: 0.5em;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--fg-mute);
    cursor: pointer;
}
.guest-full svg { width: 100%; height: 100%; display: block; }
.guest-status {
    padding: 0 0.75em 0.35em;
    font-size: 0.8em;
}
.guest-scope { display: inline-flex; align-items: center; gap: 0.4em; }
.guest .live-hero {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.guest .live-hero[hidden] { display: none; }
/* The picture takes the height the rest leaves, edge to edge on a phone. */
.guest .live-hero-frame {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    border: 0;
    border-radius: 0;
}
.guest-hero-meta {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.35em 0.75em;
    gap: 0.6em;
}
.guest-hero-facts { text-align: left; }
.guest-your {
    flex: 0 0 auto;
    font-size: 0.8em;
    color: var(--fg-mute);
}
/* Over the picture's foot, a thumb's reach, while not following. */
.guest-resume {
    position: absolute;
    left: 50%;
    bottom: 0.75em;
    transform: translateX(-50%);
    margin: 0;
    padding: 0.5em 1.1em;
    border-radius: 999px;
    box-shadow: var(--shadow-pop);
}
.guest .live-strip {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.4em 0.5em calc(0.4em + env(safe-area-inset-bottom));
    gap: 0.35em;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
}
.guest .live-cell {
    width: 76px;
    padding: 0.15em;
    gap: 0.1em;
}
/* Live's cells are a fixed height for a name and a time under the picture;
   a guest's hold the picture alone, so it keeps a photograph's shape. */
.guest .live-cell-thumb { height: auto; aspect-ratio: 3 / 2; }
.guest .live-cell-when { display: none; }
.guest-empty { flex: 1 1 auto; }

/* The client's rating: the guest's own stars, in the accent so they are
   never read as the photographer's amber verdict. */
.client-stars { display: inline-flex; white-space: nowrap; }
.client-stars .star {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 1px;
    font-size: 1.1em;
    line-height: 1;
    color: var(--star-off);
}
.client-stars .star.filled { color: var(--accent); }
.guest-hero-stars .star { font-size: 1.6em; padding: 0 0.12em; }
.guest .live-cell .client-stars { justify-content: center; }
.guest .live-cell .client-stars .star { font-size: 0.8em; padding: 0; }

/* Tapped: the picture alone, on black, as full screen would have it. */
.guest-bare .guest-head,
.guest-bare .guest-status,
.guest-bare .guest-hero-meta,
.guest-bare .live-strip { display: none; }
.guest-bare .live-hero-frame { background: var(--picture-ground); }

/* A tablet, or a phone on its side: more room for the strip's cells. */
@media (min-width: 700px) {
    .guest .live-cell { width: 110px; }
    .guest .live-cell-when { display: block; text-align: center; font-size: 0.75em; }
}

/* A computer: the page in a column, as Live is. */
@media (min-width: 1100px) and (hover: hover) {
    .guest-page { max-width: 1200px; margin: 0 auto; }
    .guest .live-hero-frame {
        border: 1px solid var(--border);
        border-radius: 4px;
        margin: 0 0.75em;
    }
    .guest .live-strip {
        margin: 0.6em 0.75em 0.75em;
        border: 1px solid var(--border);
        border-radius: 4px;
    }
}

.guest-ended {
    max-width: 30em;
    margin: 20vh auto 0;
    padding: 0 1.25em;
    text-align: center;
}
.guest-ended h2 { margin: 0.75em 0 0.25em; }

/* ---- sharing with a guest: the owner's side --------------------------- */

/* Share sits at the heading's far end, after Show latest when that is up. */
/* The pair at the heading's end, one size: Share as Show latest is drawn,
   in the secondary colours. */
.live-head .share-open {
    margin-left: auto;
    padding: 0.15em 0.6em;
    font: inherit;
    font-size: 0.95em;
    border-radius: 3px;
    cursor: pointer;
}
.live-head .live-resume:not([hidden]) + .share-open { margin-left: 0; }

/* The share dialog: a card over the page, a sheet the screen's width on a
   phone. */
.share-dialog {
    width: min(30em, calc(100vw - 2em));
    padding: 1.1em 1.25em;
    color: var(--fg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow-pop);
}
.share-dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.share-dialog h3 { margin: 0 0 0.25em; font-size: 1.05em; font-weight: 600; }
.share-form p { margin: 0.25em 0 0; }
.share-what {
    margin: 0.9em 0 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45em;
}
.share-what legend { font-weight: 500; margin-bottom: 0.35em; padding: 0; }
.share-what label { display: flex; align-items: center; gap: 0.45em; flex-wrap: wrap; }
.share-session select { max-width: 100%; }
.share-row {
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-top: 0.9em;
}
.share-row > span { flex: 0 0 6.5em; font-weight: 500; }
.share-row input,
.share-row select,
.share-session select {
    font: inherit;
    padding: 0.3em 0.45em;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}
.share-row input { flex: 1 1 auto; min-width: 0; }
.share-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6em;
    margin-top: 1.1em;
}
.share-actions button { font: inherit; cursor: pointer; }
@media (max-width: 600px) {
    .share-dialog {
        width: 100vw;
        max-width: 100vw;
        margin: auto 0 0;
        border-radius: 8px 8px 0 0;
    }
}

/* A link as its owner is shown it: the address to copy, and its QR. */
.guest-link-shown { margin-top: 0.75em; }
.guest-link-address { display: flex; gap: 0.5em; }
.guest-link-address input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.9em;
    padding: 0.35em 0.45em;
    color: var(--fg);
    background: var(--bg);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
}
.guest-link-address .copy-btn { font: inherit; cursor: pointer; }
.guest-link-qr { margin-top: 0.6em; line-height: 0; }
.guest-link-qr svg {
    width: 11em;
    height: 11em;
    background: var(--qr-ground);
    border-radius: 4px;
}

/* The client's rating beside the verdict: the link's name and its stars,
   smaller, in the accent - never the verdict's amber. */
.client-verdicts { display: flex; flex-wrap: wrap; gap: 0.15em 0.75em; }
.client-verdicts:empty { display: none; }
.client-verdict { font-size: 0.8em; color: var(--fg-mute); white-space: nowrap; }
.client-verdict-stars { color: var(--accent); letter-spacing: 0.05em; }
.client-verdict-off { color: var(--star-off); }
/* Among a photo's facts, at their size. */
dl.kv-list .client-verdict { font-size: 1em; }

/* The dashboard's guest links: the two actions together at the row's end. */
.dashboard-link-actions { white-space: nowrap; text-align: right; }
.dashboard-link-actions form { display: inline; margin: 0; }
.dashboard-link-actions button,
.dashboard-link-actions a { font: inherit; cursor: pointer; padding: 0.15em 0.6em; }
.dashboard-link-shown td { background: var(--bg-card); }

/* A session a guest link is running to, beside its name in the sessions
   table: the accent's outline, small, so it reads as a state, not a tag. */
.shared-mark {
    margin-left: 0.4em;
    padding: 0 0.4em;
    font-size: 0.75em;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    text-decoration: none;
    vertical-align: 0.1em;
}
.shared-mark:hover { background: var(--accent-mute); text-decoration: none; }

/* A session's sharing card, built as Manage is: a row per link running -
   what it is, its two actions - then the row that makes another. */
.share-card { margin-bottom: 0.75em; }
.share-card-link {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.4em 0.75em;
    padding: 0.4em 0.5em;
    border-bottom: 1px solid var(--border);
}
.share-card-what { display: flex; flex-direction: column; gap: 0.1em; min-width: 0; }
.share-card-name { font-weight: 600; }
.share-card-actions { display: inline-flex; gap: 0.4em; }
.share-card-actions form { display: inline; margin: 0; }
.share-card-actions button { font: inherit; cursor: pointer; padding: 0.1em 0.6em; }
.share-card-shown { flex-basis: 100%; }
.share-card .js-only { display: none; }
.js .share-card .js-only { display: flex; }
