/* Periodic Museums — the look of the Piccolo Museo: a dark vitrine, lit by the specimens
   and by the colour of each element family. Syne for words, Fira Code for numbers and symbols. */

:root {
  --bg: #03030A;
  --bg2: #07071A;
  --card: #06060E;
  --glass: rgba(6, 6, 16, 0.92);
  --ink: #E8E8F0;
  --muted: #8A8AA2;
  --alert: #FF3B4E;
  --faint: #4A4A64;
  --stroke: #2A2A44;
  --stroke-soft: rgba(255, 255, 255, 0.07);
  --accent: #FFA500;
  --accent-deep: #CC8400;
  --focus: #82B4FF;
  --radius: 10px;
  --gutter: clamp(16px, 3vw, 40px);
  --mono: "Fira Code", ui-monospace, monospace;
  --sans: "Syne", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 0.9375rem/1.6 var(--sans);
  color: var(--ink);
  background: var(--bg);
}
body.locked { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }
.noscript { padding: 40px var(--gutter); }

/* The room: two soft lamps in the dark. */
.bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg);
}

/* ── Bar ──────────────────────────────────────────────────────────────── */

.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(var(--gutter), env(safe-area-inset-right)) 12px max(var(--gutter), env(safe-area-inset-left));
  background: rgba(3, 3, 10, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke-soft);
}
.brand { display: flex; align-items: center; min-height: 44px; }

.nav { display: flex; align-items: center; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px;
  background: none; border: 0; padding: 0 3px; min-width: 44px; justify-content: center; cursor: pointer;
  font: 500 0.8125rem/1 var(--mono); color: var(--muted); text-decoration: none;
}
.nav-link:hover, .nav-link[aria-current="page"] { color: var(--ink); }
.nav-link[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); }
.nav-user { display: flex; align-items: center; gap: 14px; }
.nav-me { display: flex; align-items: center; gap: 8px; min-height: 44px; text-decoration: none; font: 500 0.8125rem/1 var(--mono); }
.nav-me[aria-current="page"] span { color: var(--accent); }

/* ── Buttons, chips, small things ─────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, 0.03);
  font: 600 0.8125rem/1.1 var(--mono); text-decoration: none; color: var(--ink);
  transition: border-color .15s, background .15s, transform .15s;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: wait; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #12040A; }
.btn-primary:hover { background: #FFB733; border-color: #FFB733; }
.btn-small { padding: 7px 14px; font-size: 0.75rem; }
.btn { min-height: 40px; }
.btn-small { min-height: 34px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  font: 500 0.8125rem/1 var(--sans);
}
.chip-sym {
  display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 25%, transparent); font: 700 0.8125rem/1 var(--mono);
}
.chip:hover { border-color: var(--c); }

.badge {
  display: inline-block; padding: 3px 8px; border-radius: 6px;
  background: rgba(140, 92, 255, 0.25); border: 1px solid rgba(140, 92, 255, 0.6);
  font: 600 0.6875rem/1.2 var(--mono); letter-spacing: .5px; text-transform: uppercase;
}
.score, .count { display: inline-flex; align-items: center; gap: 4px; font: 500 0.75rem/1 var(--mono); }
.score .icon { fill: currentColor; stroke: none; }
.icon { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.avatar {
  width: var(--s); height: var(--s); border-radius: 50%; object-fit: cover; flex: none;
  border: 1px solid var(--stroke); background: var(--bg2);
}
.avatar-initial {
  display: grid; place-items: center; font: 700 calc(var(--s) * .42)/1 var(--sans);
  background: #2A2140;
}

.loading { display: grid; place-items: center; min-height: 30vh; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--stroke); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-title { font-size: 1.375rem; font-weight: 700; color: var(--ink); }
.empty {
  display: grid; gap: 16px; justify-items: center; text-align: center;
  padding: 48px 16px; border: 1px dashed var(--stroke); border-radius: var(--radius); color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.prose { display: grid; gap: .8em; line-height: 1.65; }
.prose a { color: var(--accent); }

/* ── Page frames ──────────────────────────────────────────────────────── */

#page { flex: 1; outline: none; }
.page-table, .page-wide { padding: 28px var(--gutter) 56px; margin: 0 auto; width: 100%; }
.page-narrow { padding: 48px var(--gutter); max-width: 560px; margin: 0 auto; width: 100%; }
.page-head { display: grid; gap: 8px; margin-bottom: 28px; }
.page-head h1, .table-head h1 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); font-weight: 700; letter-spacing: -.3px; }
.lede { color: var(--muted); max-width: 60ch; }

.table-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 24px; }
.table-head > div { display: grid; gap: 8px; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font: 400 0.8125rem/1.2 var(--mono); color: var(--muted); }
.stats b { color: var(--ink); font-weight: 600; }

.section { margin-top: 56px; }
.section-title { font: 700 0.8125rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 18px; }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 24px max(var(--gutter), env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  border-top: 1px solid var(--stroke-soft);
  font: 400 0.75rem/1.5 var(--mono); color: var(--muted);
}

/* ── The table ────────────────────────────────────────────────────────── */

.ptable-wrap { position: relative; }
.ptable-scroll { overflow-x: auto; padding: 12px 4px 16px; margin: -12px -4px 0; scrollbar-width: thin; overscroll-behavior-x: contain; }
.ptable-scroll.more-right { mask-image: linear-gradient(90deg, #000 calc(100% - 48px), transparent); }
.ptable-scroll.more-left { mask-image: linear-gradient(90deg, transparent, #000 48px); }
.ptable-scroll.more-left.more-right { mask-image: linear-gradient(90deg, transparent, #000 48px calc(100% - 48px), transparent); }

/* The whole table in miniature, with a frame on the part in view. */
.minimap { display: none; position: relative; margin: 0 0 14px; padding: 6px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--card); touch-action: none; cursor: pointer; }
.minimap.on { display: block; }
.mm-grid { display: grid; grid-template-columns: repeat(18, 1fr); grid-template-rows: repeat(7, 6px) 2px 0 repeat(2, 6px); gap: 2px; }
.mm-cell { border-radius: 1.5px; background: color-mix(in srgb, var(--c) 22%, transparent); }
.mm-cell.has { background: color-mix(in srgb, var(--c) 75%, transparent); }
.mm-frame {
  position: absolute; top: 2px; bottom: 2px; border-radius: 5px; pointer-events: none;
  border: 2px solid var(--ink); box-shadow: 0 0 0 999px rgba(3, 3, 10, .35);
  clip-path: inset(-2px round 5px);
}
.ptable {
  display: grid;
  grid-template-columns: repeat(18, minmax(0, 1fr));
  grid-template-rows: repeat(7, auto) 14px repeat(2, auto);
  gap: clamp(3px, .4vw, 6px);
}
/* Phones and small windows scroll the table sideways at a size a finger can hit. */
@media (max-width: 900px) { .ptable { min-width: 860px; } }
.ptable-ref {
  display: grid; place-items: center; aspect-ratio: 1;
  font: 500 0.625rem/1 var(--mono); color: var(--muted);
}

.tile {
  --c: #888;
  position: relative; aspect-ratio: 1; overflow: hidden; container-type: inline-size;
  border-radius: 6px; border: 2px solid color-mix(in srgb, var(--c) 40%, transparent);
  background: var(--card);
  text-decoration: none; color: var(--ink);
  transition: transform .18s, border-color .18s, box-shadow .18s, opacity .18s;
  animation: tileIn .4s cubic-bezier(.34, 1.4, .64, 1) backwards;
  animation-delay: calc(var(--i) * 3ms);
}
.tile::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 1px; z-index: 3;
  background: rgba(255, 255, 255, .06);
}
.tile-cover {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s;
}
.tile.has::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: radial-gradient(circle at 0 0, rgba(3, 3, 10, .7), transparent 38%), radial-gradient(circle at 100% 100%, rgba(3, 3, 10, .75), transparent 45%);
}
.tile-z, .tile-sym, .tile-n { position: absolute; z-index: 2; font-family: var(--mono); text-shadow: 0 1px 6px #000; line-height: 1; }
.tile-z { top: 7%; left: 8%; font-size: clamp(0.5rem, 15cqw, 0.8125rem); font-weight: 700; }
.tile-sym { right: 8%; bottom: 8%; font-size: clamp(0.6875rem, 27cqw, 1.5rem); font-weight: 500; }
.tile-n {
  left: 7%; bottom: 9%; font-size: clamp(0.4375rem, 13cqw, 0.6875rem); font-weight: 600;
  padding: 2px 4px; border-radius: 4px; background: color-mix(in srgb, var(--c) 35%, rgba(0, 0, 0, .5));
}
.tile.none { border-color: color-mix(in srgb, var(--c) 20%, transparent); background: color-mix(in srgb, var(--c) 4%, var(--card)); }
.tile.none .tile-z, .tile.none .tile-sym { color: var(--muted); text-shadow: none; }
.tile:focus-visible {
  transform: scale(1.18) translateY(-1px); z-index: 5; border-color: var(--c);
  outline: none; box-shadow: 0 0 0 3px var(--focus), 0 16px 40px rgba(0, 0, 0, .85);
}
.tile:focus-visible .tile-cover { opacity: .9; filter: none; }
.tile:active { border-color: var(--c); }
@media (hover: hover) {
  .tile:hover {
    transform: scale(1.18) translateY(-1px); z-index: 5; border-color: var(--c);
    box-shadow: 0 0 30px color-mix(in srgb, var(--c) 30%, transparent), 0 16px 40px rgba(0, 0, 0, .85);
  }
  .tile:hover .tile-cover { opacity: .9; filter: none; }
}
@keyframes tileIn { from { opacity: 0; transform: scale(.85); } }


.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 0; margin: 18px 0 0; font: 400 0.75rem/1.3 var(--mono); color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 60%, transparent); flex: none; }

/* ── Specimen cards ───────────────────────────────────────────────────── */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 16px; }
.card {
  --c: #888;
  display: flex; flex-direction: column; text-decoration: none; overflow: hidden;
  border-radius: var(--radius); border: 1px solid var(--stroke); background: var(--card);
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.card:focus-visible { border-color: color-mix(in srgb, var(--c) 70%, transparent); }
@media (hover: hover) { .card:hover { border-color: color-mix(in srgb, var(--c) 70%, transparent); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, .6); } }
.card-photo { position: relative; aspect-ratio: 1; background: color-mix(in srgb, var(--c) 8%, var(--bg2)); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .badge { position: absolute; top: 8px; left: 8px; }
.card-nophoto { display: grid; place-items: center; height: 100%; font: 800 2.75rem/1 var(--sans); color: color-mix(in srgb, var(--c) 50%, transparent); }
.card-sym {
  position: absolute; top: 8px; right: 8px; padding: 3px 7px; border-radius: 6px;
  font: 700 0.75rem/1 var(--mono); background: rgba(3, 3, 10, .7); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.card-body { display: grid; gap: 8px; padding: 12px 14px 14px; }
.card-title { font: 600 0.875rem/1.3 var(--sans); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; justify-content: space-between; gap: 8px; font: 400 0.75rem/1.2 var(--mono); color: var(--muted); }
.card-owner { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-stats { display: flex; gap: 10px; flex: none; }

/* ── Museums ──────────────────────────────────────────────────────────── */

.museums { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.museum-card { text-decoration: none; border: 1px solid var(--stroke); border-radius: var(--radius); overflow: hidden; background: var(--card); transition: border-color .18s, transform .18s; }
@media (hover: hover) { .museum-card:hover { border-color: rgba(255, 165, 0, .6); transform: translateY(-2px); } }
.museum-card:focus-visible { border-color: rgba(255, 165, 0, .6); }
.museum-cover { aspect-ratio: 16 / 9; background: var(--bg2); }
.museum-cover img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.museum-body { display: grid; gap: 14px; padding: 16px; }
.museum-who { display: flex; gap: 12px; align-items: center; }
.museum-who h2 { font-size: 1rem; font-weight: 700; }
.museum-who p { font: 400 0.75rem/1.4 var(--mono); }
.museum-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font: 400 0.75rem/1.2 var(--mono); color: var(--muted); }
.museum-stats b { color: var(--ink); }

/* ── Profile ──────────────────────────────────────────────────────────── */

.profile {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: start;
  padding-bottom: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--stroke-soft);
}
.profile-main { display: grid; gap: 10px; min-width: 0; }
.profile h1 { font-size: clamp(1.5rem, 2.8vw, 2.375rem); font-weight: 700; letter-spacing: -.5px; overflow-wrap: anywhere; }
.profile-line { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 400 0.8125rem/1.3 var(--mono); color: var(--muted); }
.profile-line > * { display: inline-flex; align-items: center; gap: 6px; }
.profile-line a:hover { color: var(--accent); }
.profile-bio { max-width: 70ch; }
.profile-stats { display: flex; gap: 28px; margin: 0; }
.profile-stats dt { font: 500 0.6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.profile-stats dd { margin: 6px 0 0; font: 600 1.625rem/1 var(--mono); }
.profile-stats small { font-size: 0.8125rem; color: var(--muted); }
.museum-intro { max-width: 80ch; margin: -4px 0 28px; color: #C8C8D8; }
/* Bio and museum introduction: a few lines, the rest in a popup ("Read more"). */
.read-more-wrap { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.clampable.is-clamped { mask-image: linear-gradient(#000 55%, transparent); }
.read-more { padding: 4px 0; border: 0; background: none; color: var(--accent); font: 600 .8125rem/1.2 var(--mono); cursor: pointer; }
.read-more:hover { text-decoration: underline; }
.read-more[hidden] { display: none; }
.text-dialog { width: min(640px, calc(100vw - 32px)); }
.text-dialog .prose { overflow-wrap: anywhere; }
.page-table > .empty { margin-bottom: 24px; }

/* ── Layers (element panel, specimen) ─────────────────────────────────── */

.layer { position: fixed; inset: 0; z-index: 40; display: grid; padding: clamp(0px, 2vw, 16px); animation: layerIn .2s ease-out; }
.layer.closing { animation: layerOut .18s ease-in forwards; }
.layer-specimen { z-index: 50; }
.layer-backdrop { position: absolute; inset: 0; background: rgba(2, 2, 8, .72); backdrop-filter: blur(6px); }
.layer-box {
  position: relative; min-height: 0; max-width: 1600px; width: 100%; margin: auto; height: 100%;
  border: 1px solid var(--stroke); border-radius: clamp(0px, 2vw, 18px); overflow: hidden;
  background: var(--glass); box-shadow: 0 30px 80px rgba(0, 0, 0, .8);
}
.layer-content { height: 100%; overflow: auto; overscroll-behavior: contain; }
.layer-close {
  position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 5;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(3, 3, 10, .8); color: var(--ink);
}
.layer-close:hover { border-color: var(--ink); }
@keyframes layerIn { from { opacity: 0; } }
@keyframes layerOut { to { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px) scale(.99); } }
.layer-box { animation: rise .25s cubic-bezier(.2, .8, .2, 1); }

/* Element panel: the museum card, symbol on the left, specimens on the right. */
.panel-inner { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; min-height: 100%; }
.panel-side {
  display: grid; align-content: start; gap: 14px; padding: 40px 32px;
  border-right: 1px solid var(--stroke-soft);
  background: color-mix(in srgb, var(--c) 5%, transparent);
}
.big-sym {
  font: 800 clamp(4.5rem, 9vw, 8rem)/.9 var(--sans); letter-spacing: -4px;
  text-shadow: 0 0 50px color-mix(in srgb, var(--c) 55%, transparent);
}
.panel-name { font-size: 1.375rem; font-weight: 700; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.panel-z { font: 400 0.8125rem/1 var(--mono); color: var(--muted); }
.panel-cat { display: flex; align-items: center; gap: 8px; font: 400 0.8125rem/1 var(--mono); color: var(--muted); }
.panel-owner { display: grid; gap: 14px; justify-items: start; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--stroke-soft); }
.owner { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; }
.owner span { display: grid; gap: 2px; }
.owner b { font-weight: 700; }
.owner small { font: 400 0.75rem/1 var(--mono); color: var(--muted); }
.owner:hover b { color: var(--accent); }
.panel-main { padding: 28px clamp(16px, 3vw, 36px) 40px; min-width: 0; }
/* The community page of an element: its discussion under the symbol, in the same column. */
.panel-inner.with-talk { grid-template-columns: minmax(300px, 420px) 1fr; grid-template-rows: auto 1fr; }
.with-talk > .panel-side { grid-column: 1; grid-row: 1; padding-bottom: 24px; }
.with-talk > .panel-main { grid-column: 2; grid-row: 1 / span 2; }
.panel-talk {
  grid-column: 1; grid-row: 2; min-width: 0; padding: 0 24px 40px 32px;
  border-right: 1px solid var(--stroke-soft); background: color-mix(in srgb, var(--c) 5%, transparent);
}
.panel-talk .discussion { margin-top: 0; }

/* A museum's column: its chat and a private message, each with what it is. */
.talk-links { display: grid; gap: 8px; }
.talk-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: 12px;
  background: var(--card); color: var(--ink); text-decoration: none;
}
.talk-link:hover, .talk-link:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.talk-link > .icon { flex: none; color: var(--muted); }
.talk-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 165, 0, .12); color: var(--accent); }
.talk-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.talk-text b { font-weight: 700; font-size: .9375rem; }
.talk-text small { font-size: .8125rem; line-height: 1.35; color: var(--muted); }
.panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 56px 20px 0; font: 400 0.8125rem/1 var(--mono); }
.tabs { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--stroke); border-radius: 999px; }
.tab { border: 0; background: none; cursor: pointer; padding: 8px 14px; min-height: 34px; border-radius: 999px; font: 500 0.75rem/1 var(--mono); color: var(--muted); }
.tab[aria-selected="true"] { background: rgba(255, 255, 255, .1); color: var(--ink); }

/* Specimen: the photo large, the facts beside it. */
.specimen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); height: 100%; min-height: 0; }
.viewer { position: relative; display: grid; grid-template-rows: 1fr auto auto; min-height: 0; background: #010104; }
.viewer-stage { position: relative; min-height: 0; overflow: hidden; cursor: zoom-in; display: grid; place-items: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.viewer-img { -webkit-user-drag: none; pointer-events: none; }
.viewer-img {
  /* Pinned to the stage: object-fit: contain then always shows the whole photo, whatever the window. */
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transform-origin: center; transition: transform .25s cubic-bezier(.2, .8, .2, 1); will-change: auto;
}
.viewer-stage.zoomed { cursor: zoom-out; }
.viewer-none { cursor: default; font: 800 7.5rem/1 var(--sans); color: color-mix(in srgb, var(--c) 40%, transparent); }
.viewer-arrow {
  position: absolute; top: 45%; z-index: 2; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(3, 3, 10, .7); color: var(--ink);
}
.viewer-arrow.prev { left: 14px; }
.viewer-arrow.next { right: 14px; }
.viewer-arrow:hover { border-color: var(--ink); }
.viewer-foot { display: flex; justify-content: space-between; gap: 16px; padding: 10px 18px; font: 400 0.75rem/1.4 var(--mono); color: var(--muted); min-height: 36px; }
.viewer-thumbs { display: flex; gap: 8px; padding: 0 18px 16px; overflow-x: auto; scrollbar-width: thin; }
.thumb { flex: none; width: 60px; height: 60px; padding: 0; border-radius: 6px; overflow: hidden; cursor: pointer; border: 2px solid var(--stroke); background: none; opacity: .75; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb[aria-current="true"] { border-color: var(--c); opacity: 1; }
.thumb:hover { opacity: 1; }
.specimen-info {
  display: grid; align-content: start; gap: 18px; padding: 64px 28px 40px; overflow: auto; min-height: 0; min-width: 0;
  border-left: 1px solid var(--stroke-soft);
  background: none;
}
.specimen-info .chip { justify-self: start; }
.specimen-title { font-size: clamp(1.375rem, 2vw, 1.75rem); font-weight: 700; letter-spacing: -.3px; overflow-wrap: anywhere; }
.specimen-stats { display: flex; gap: 18px; color: var(--muted); }
.details { display: grid; gap: 12px; margin: 0; padding-top: 16px; border-top: 1px solid var(--stroke-soft); }
.details div { display: grid; grid-template-columns: 90px 1fr; gap: 12px; }
.details dt { font: 500 0.6875rem/1.6 var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.details dd { margin: 0; }

/* ── Forms ────────────────────────────────────────────────────────────── */

.auth { display: grid; gap: 14px; padding: 36px clamp(20px, 4vw, 40px); border: 1px solid var(--stroke); border-radius: 16px; background: var(--glass); }
.auth h1 { font-size: 1.75rem; font-weight: 800; }
.form { display: grid; gap: 16px; margin-top: 12px; }
.field { display: grid; gap: 6px; }
.field span { font: 500 0.75rem/1 var(--mono); color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 13px; border-radius: 8px;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(130, 180, 255, .2); }
.hint { font: 400 0.75rem/1.5 var(--mono); color: var(--muted); }
.form-error { color: #FF8A8A; font-size: 0.875rem; }
.form-error:empty { display: none; }
.auth-switch { color: var(--muted); font-size: 0.875rem; }
.auth-switch a { color: var(--accent); }
.auth-sso { display: grid; gap: 10px; margin-top: 12px; }
.auth-sso:empty { display: none; }
.btn-google { gap: 10px; width: 100%; padding: 11px 16px;
  background: #FFFFFF; color: #1F1F1F; border: 1px solid #DADCE0; font-weight: 600; }
.btn-google:hover { background: #F1F3F4; }
.btn-google svg { flex: none; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 0.75rem/1 var(--mono); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid var(--stroke); }
.turnstile:empty { display: none; }

/* ── Small screens ────────────────────────────────────────────────────── */

/* Touch screens: every control at least 44 px; the table at a size a finger can hit. */
@media (pointer: coarse) {
  .btn, .tab, .chip { min-height: 44px; }
  .chip { padding-right: 16px; }
  .ptable { min-width: 900px; }
}

@media (max-width: 900px) {
  .panel-inner { grid-template-columns: minmax(0, 1fr); }
  .panel-inner.with-talk { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .with-talk > .panel-side, .with-talk > .panel-main, .panel-talk { grid-column: 1; grid-row: auto; }
  .panel-talk { padding: 0 20px 40px; border-right: 0; background: none; }
  .panel-talk .discussion { max-width: 820px; }
  .panel-side {
    padding: 68px 20px 20px; border-right: 0; border-bottom: 1px solid var(--stroke-soft);
    grid-template-columns: auto minmax(0, 1fr); align-items: end; column-gap: 18px;
  }
  .panel-side > * { min-width: 0; }
  .panel-side .big-sym { grid-row: span 2; font-size: clamp(3rem, 16vw, 4.5rem); }
  .panel-name { font-size: 1.25rem; overflow-wrap: anywhere; }
  .panel-owner { grid-column: 1 / -1; }
  .panel-toolbar { margin-right: 0; }
  .specimen { grid-template-columns: minmax(0, 1fr); height: auto; }
  .specimen > * { min-width: 0; }
  .viewer { grid-template-rows: auto auto auto; }
  .viewer-stage { aspect-ratio: 1; max-height: 72dvh; }
  .specimen-info { padding: 24px 20px 40px; border-left: 0; overflow: visible; }
  .profile { grid-template-columns: auto minmax(0, 1fr); }
  .profile-stats { grid-column: 1 / -1; }
}

/* Phones on their side: photo on the left, facts on the right, both full height. */
@media (max-width: 960px) and (orientation: landscape) and (max-height: 560px) {
  .specimen { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); height: 100%; }
  .viewer { grid-template-rows: minmax(0, 1fr) auto auto; height: 100%; }
  .viewer-stage { aspect-ratio: auto; max-height: none; }
  .viewer-foot { min-height: 0; padding: 6px 14px; }
  .viewer-thumbs { padding: 0 14px 8px; }
  .thumb { width: 44px; height: 44px; }
  .specimen-info { overflow: auto; padding: 64px 20px 24px; border-left: 1px solid var(--stroke-soft); }
  .panel-side { padding-top: 20px; padding-right: 72px; }
}

@media (max-width: 560px) {

  .nav { gap: 0 16px; flex-wrap: nowrap; }
  .nav-user { gap: 16px; }
  .nav .btn-primary { display: none; }
  .nav-me > span:not(.avatar) { display: none; }
  .nav-user > button.nav-link { display: none; } /* Sign out lives in Settings on phones */
  .profile { gap: 16px; }
  .profile .avatar { --s: 56px !important; }
  .profile-stats { gap: 22px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .layer { padding: 0; }
  .stats .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tile, .layer, .layer.closing, .layer-box { animation: none; }
  .tile, .card, .museum-card, .btn, .viewer-img, .tile-cover { transition: none; }
  .spinner { animation-duration: 2s; }
}

/* ── My museum: owner actions, editor, settings ───────────────────────── */

.owner-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: -8px 0 24px; }
.stats-block { position: relative; grid-column: 1 / -1; }
.profile-stats .stat { cursor: help; border-radius: 6px; outline-offset: 4px; }
.profile-stats .stat:hover dt, .profile-stats .stat:focus-visible dt { color: var(--accent); }
/* What a number means: a box over what follows, as wide as the numbers (never cut, nothing moves). */
.stats-help { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 6; margin: 0; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--stroke); background: #0B0B1C; box-shadow: 0 14px 34px rgba(0, 0, 0, .7);
  font: 400 .75rem/1.4 var(--mono); color: var(--ink); pointer-events: none; }
.stats-help:empty { display: none; }
.panel-add { justify-self: start; margin-top: 6px; }
.specimen-edit { justify-self: start; }
.nav-icon { color: var(--muted); }
.nav-icon:hover, .nav-icon[aria-current="page"] { color: var(--ink); }

.btn .icon { margin-left: -2px; }
.btn-danger { background: #E0435A; border-color: #E0435A; color: #fff; }
.btn-danger:hover { background: #F2566C; border-color: #F2566C; }
.btn-quiet-danger { border-color: rgba(224, 67, 90, .45); color: #FF8A98; }
.btn-quiet-danger:hover { border-color: #E0435A; background: rgba(224, 67, 90, .1); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(3, 3, 10, .55); color: var(--ink);
}
.icon-btn:hover:not(:disabled) { border-color: rgba(255, 255, 255, .4); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.danger:hover { border-color: #E0435A; color: #FF8A98; }
.actions-left { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.form-msg { font-size: .875rem; color: var(--muted); }
.form-msg:empty { display: none; }
.form-msg.ok { color: #7FE0A6; }
.form-msg.error { color: #FF8A8A; }
.field textarea { resize: vertical; min-height: 5.5em; line-height: 1.55; }
.field select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: var(--bg2); color: var(--ink); }
.field small.hint { display: block; }
::placeholder { color: #6A6A84; }

/* Editor */
.page-editor { --c: #888; max-width: 1240px; margin: 0 auto; width: 100%; padding: 28px var(--gutter) 0; }
.editor-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.editor-head h1 { font-size: clamp(1.375rem, 2.4vw, 1.875rem); font-weight: 700; overflow-wrap: anywhere; }
.editor-head p { font: 500 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 8px; }
.editor-sym {
  display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 10px;
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 12%, var(--card));
  font: 600 1.5rem/1 var(--mono);
}
.editor { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 28px 40px; align-items: start; }
.editor-photos, .editor-details { display: grid; gap: 14px; min-width: 0; }
.editor-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.editor-section-head h2 { font-size: 1.125rem; font-weight: 700; }
.editor-details { padding: 22px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--card); }

.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 14px; }
.ph-grid:empty { display: none; }
.ph-tile { margin: 0; display: grid; border: 1px solid var(--stroke); border-radius: 10px; overflow: hidden; background: var(--card); transition: box-shadow .15s, opacity .15s; }
.ph-tile.dragging { opacity: .55; box-shadow: 0 0 0 2px var(--focus); }
.ph-tile.is-error { border-color: rgba(224, 67, 90, .6); }
.ph-img { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: var(--bg2); }
.ph-img img { width: 100%; height: 100%; object-fit: cover; }
.ph-tile.is-uploading .ph-img img { opacity: .5; }
.ph-cover { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 6px; background: var(--accent); color: #12040A; font: 700 .6875rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .5px; }
.ph-progress { position: absolute; left: 10px; right: 10px; bottom: 10px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .15); overflow: hidden; }
.ph-progress span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.ph-error { position: absolute; inset: auto 8px 8px; font-size: .75rem; line-height: 1.35; color: #FFB3BD; background: rgba(3, 3, 10, .85); padding: 6px 8px; border-radius: 6px; }
.ph-grip {
  position: absolute; right: 6px; top: 6px; display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 8px; background: rgba(3, 3, 10, .7); color: var(--ink); cursor: grab; touch-action: none;
}
.ph-grip .icon { stroke-width: 3.2; }
.ph-grip:active { cursor: grabbing; }
.ph-bar { display: grid; gap: 8px; padding: 10px; }
.ph-caption { width: 100%; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); font-size: .8125rem; }
.ph-caption:focus { outline: none; border-color: var(--focus); }
.ph-actions { display: flex; gap: 6px; }
.ph-actions .danger { margin-left: auto; }
.ph-drop {
  display: grid; justify-items: center; gap: 6px; padding: 34px 16px; cursor: pointer; text-align: center;
  border: 1.5px dashed color-mix(in srgb, var(--c) 45%, var(--stroke)); border-radius: 12px;
  background: color-mix(in srgb, var(--c) 5%, transparent); color: var(--ink);
}
.ph-drop b { font-size: 1rem; }
.ph-drop span { font: 400 .75rem/1.4 var(--mono); color: var(--muted); }
.ph-drop:hover, .ph-drop.over { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.ph-drop[hidden] { display: none; }

.editor-bar {
  grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px;
  margin: 8px calc(-1 * var(--gutter)) 0; padding: 14px var(--gutter) max(14px, env(safe-area-inset-bottom));
  background: rgba(3, 3, 10, .96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--stroke);
}
.editor-bar .form-error { flex: 1 1 260px; margin: 0; }
.editor-details .segmented { justify-self: start; }
.editor-buttons { display: flex; gap: 10px; margin-left: auto; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--stroke); border-radius: 999px; }
.segmented button {
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  font: 600 .8125rem/1 var(--mono); color: var(--muted);
}
.segmented button[aria-checked="true"] { background: rgba(255, 255, 255, .12); color: var(--ink); }
.segmented button[data-value="published"][aria-checked="true"] { background: color-mix(in srgb, var(--c) 30%, transparent); }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 16px; border-top: 1px solid var(--stroke-soft); color: #FFB3BD; font-size: .875rem; }

/* Settings */
.page-settings { max-width: 680px; }
.settings-section { display: grid; gap: 18px; padding: 26px 0; border-top: 1px solid var(--stroke-soft); }
.settings-section h2 { font-size: 1.125rem; font-weight: 700; }
.settings-section.danger h2 { color: #FF8A98; }
.settings-section.danger > form > p { color: var(--muted); max-width: 60ch; }
.settings-form { display: grid; gap: 16px; }
.settings-avatar-row { display: flex; align-items: center; gap: 18px; }
.settings-avatar { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; overflow: hidden; flex: none;
  border: 1px solid var(--stroke); background: #2A2140; font: 700 2rem/1 var(--sans); }
.settings-avatar img { width: 100%; height: 100%; object-fit: cover; }

@media (pointer: coarse) {
  .icon-btn { width: 44px; height: 44px; }
  .ph-actions .move { display: none; } /* dragging the grip does it */
  .segmented button { min-height: 44px; }
  .ph-caption { min-height: 44px; font-size: 1rem; }
  .field input, .field textarea, .field select { font-size: 1rem; } /* no zoom-in on iOS */
}
@media (max-width: 900px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-details { padding: 18px; }
}
@media (max-width: 560px) {
  .ph-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .editor-sym { width: 52px; height: 52px; font-size: 1.25rem; }
  .editor-bar { gap: 10px; }
  .editor-buttons { width: 100%; }
  .editor-buttons .btn { flex: 1; }
  .ph-actions { gap: 6px; }
}

/* ── Social: likes, votes, discussion, notifications ──────────────────── */

.like {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); color: var(--ink); font: 600 .875rem/1 var(--mono);
  transition: border-color .15s, background .15s, color .15s;
}
.like .icon { transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.like:hover:not(:disabled) { border-color: rgba(255, 165, 0, .6); }
.like.on { color: var(--accent); border-color: rgba(255, 165, 0, .55); background: rgba(255, 165, 0, .1); }
.like.on .icon { fill: currentColor; }
.like.pop .icon { transform: scale(1.3); }
.like:disabled { cursor: default; opacity: .7; }
.like-small { min-height: 34px; padding: 0 11px; font-size: .75rem; }
.viewer-foot-end { display: flex; align-items: center; gap: 14px; flex: none; }
.specimen-stats { align-items: center; flex-wrap: wrap; }
.specimen-stats a.count { text-decoration: none; }
.specimen-stats a.count:hover { color: var(--ink); }
.card-stats .count .icon { opacity: .8; }

.discussion { display: grid; gap: 16px; padding-top: 22px; margin-top: 6px; border-top: 1px solid var(--stroke-soft); scroll-margin-top: 20px; }
.discussion-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.discussion-head h2 { font-size: 1.0625rem; font-weight: 700; }
.tabs-small .tab { padding: 6px 12px; min-height: 30px; }
.discussion-empty, .discussion-login { font-size: .875rem; color: var(--muted); }
.discussion-login a { color: var(--accent); }

.composer { display: grid; gap: 8px; }
.composer-box { position: relative; }
.composer-text {
  width: 100%; min-height: 76px; resize: none; padding: 11px 13px; border-radius: 10px; line-height: 1.5;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); font: inherit; font-size: .9375rem;
}
.composer-text:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(130, 180, 255, .18); }
.composer-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 10px; }
.composer-count { font: 400 .75rem/1 var(--mono); color: var(--muted); }
.about-photo { display: inline-flex; align-items: center; gap: 6px; font-size: .8125rem; color: var(--muted); margin-right: auto; cursor: pointer; min-height: 32px; }
.about-photo input { accent-color: var(--accent); width: 16px; height: 16px; }
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; list-style: none; margin: 0; padding: 4px;
  border: 1px solid var(--stroke); border-radius: 10px; background: #0B0B1C; box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
}
.suggest[hidden] { display: none; }
.suggest li { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: .875rem; }
.suggest li span:last-child { color: var(--muted); font: 400 .75rem/1 var(--mono); margin-left: auto; }
.suggest li b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest li[aria-selected="true"], .suggest li:hover { background: rgba(255, 255, 255, .08); }
.suggest-sym { display: grid; place-items: center; min-width: 30px; height: 24px; border-radius: 5px; background: rgba(255, 255, 255, .08); font: 700 .75rem/1 var(--mono); }

.comments { display: grid; gap: 4px; }
.comment { display: grid; gap: 6px; padding: 12px 0 6px; border-radius: 8px; transition: background .6s; }
.comment.focus > .comment-body { background: rgba(255, 165, 0, .1); box-shadow: 0 0 0 6px rgba(255, 165, 0, .1); border-radius: 6px; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; }
.comment-who { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.comment-who b { font-weight: 700; }
.comment-who .muted { font: 400 .75rem/1 var(--mono); }
.comment-who:hover b { color: var(--accent); }
.comment-head time, .comment-head > .muted { font: 400 .75rem/1 var(--mono); }
.op, .on-photo { padding: 2px 7px; border-radius: 5px; font: 600 .6875rem/1.3 var(--mono); }
.op { background: rgba(255, 165, 0, .16); color: var(--accent); }
.on-photo { background: rgba(255, 255, 255, .07); color: var(--muted); }
.comment-body { padding-left: 34px; display: grid; gap: .6em; line-height: 1.6; font-size: .9375rem; overflow-wrap: anywhere; }
.comment-body a { color: var(--accent); }
.comment-body .composer { margin-left: -34px; }
.mention { text-decoration: none; font-weight: 600; }
.spec-ref {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%;
  padding: 2px 9px 2px 2px; border-radius: 7px; text-decoration: none; color: var(--ink) !important;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 10%, transparent);
  font-size: .8125rem;
}
.spec-ref img, .spec-ref-sym { width: 24px; height: 24px; border-radius: 5px; object-fit: cover; flex: none; }
.spec-ref-sym { display: grid; place-items: center; font: 700 .6875rem/1 var(--mono); background: color-mix(in srgb, var(--c) 25%, transparent); }
.spec-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; padding-left: 28px; }
.comment-slot:not(:empty) { padding-left: 34px; padding-top: 4px; }
.link-btn { min-height: 32px; padding: 0 2px; border: 0; background: none; cursor: pointer; text-decoration: none; font: 500 .75rem/1 var(--mono); color: var(--muted); display: inline-flex; align-items: center; }
.link-btn:hover { color: var(--ink); }
.votes { display: inline-flex; align-items: center; gap: 2px; }
.vote-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.vote-btn .icon { fill: currentColor; stroke: none; }
.vote-btn.down .icon { transform: rotate(180deg); }
.vote-btn:hover:not(:disabled) { background: rgba(255, 255, 255, .07); color: var(--ink); }
.vote-btn.up[aria-pressed="true"] { color: var(--accent); }
.vote-btn.down[aria-pressed="true"] { color: var(--focus); }
.vote-btn:disabled { opacity: .35; cursor: default; }
.vote-n { min-width: 22px; text-align: center; font: 600 .75rem/1 var(--mono); }
.replies { display: grid; gap: 2px; margin-left: 12px; padding-left: 20px; border-left: 2px solid var(--stroke-soft); }
.replies.flat { margin-left: 0; padding-left: 0; border-left: 0; }
.comment.deleted > .comment-head { opacity: .6; }
.report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }
.report select { padding: 6px 10px; border-radius: 7px; border: 1px solid var(--stroke); background: var(--bg2); }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%);
  max-width: min(92vw, 480px); padding: 11px 16px; border-radius: 10px; font-size: .875rem;
  background: #1A1A30; border: 1px solid var(--stroke); box-shadow: 0 16px 40px rgba(0, 0, 0, .7);
  transition: opacity .3s, transform .3s;
}
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

.bell { position: relative; }
.bell-n {
  position: absolute; top: 6px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  display: grid; place-items: center; background: var(--alert); color: #fff; font: 700 .625rem/1 var(--mono);
  box-shadow: 0 0 0 2px var(--bg);
}
.bell-n[hidden] { display: none; }
/* Something new in the chat: a red dot on its icon. */
.nav-dot { position: absolute; top: 8px; right: -9px; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 899px) { .nav-main .nav-dot { display: block; right: auto; left: calc(50% + 5px); top: 7px; } }
.page-notifications { max-width: 720px; }
.notifications { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.notification { display: flex; gap: 14px; align-items: flex-start; padding: 14px 12px; border-radius: 10px; text-decoration: none; }
.notification:hover { background: rgba(255, 255, 255, .04); }
.notifications .unread .notification { background: rgba(255, 165, 0, .07); }
.notification p { line-height: 1.45; }
.notification-quote { margin: 6px 0; padding-left: 10px; border-left: 2px solid var(--stroke); color: #C8C8D8; font-size: .875rem; }
.notification time { font: 400 .75rem/1 var(--mono); }

@media (pointer: coarse) {
  .vote-btn { width: 44px; height: 44px; }
  .link-btn { min-height: 44px; padding: 0 6px; }
  .like, .like-small { min-height: 44px; }
  .tabs-small .tab { min-height: 44px; }
  .comment-who, .specimen-stats a.count { min-height: 44px; }
  .specimen-stats a.count { display: inline-flex; align-items: center; }
  .composer-text { font-size: 1rem; }
}
@media (max-width: 560px) {
  .comment-body, .comment-slot:not(:empty) { padding-left: 0; }
  .comment-body .composer { margin-left: 0; }
  .comment-actions { padding-left: 0; }
  .replies { margin-left: 4px; padding-left: 12px; }
}

/* ── Moderation, reports, documents ───────────────────────────────────── */

.report-museum { margin: -12px 0 18px; }
.specimen-report { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.report-box { display: contents; }
.link-btn .icon { margin-right: 5px; }
.mod-hide { color: #FFB3BD; }
.report { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8125rem; color: var(--muted); }
.report .form-error { flex-basis: 100%; }
.page-moderation { max-width: 860px; }
.page-moderation .tabs { justify-self: start; margin-bottom: 14px; display: inline-flex; }
.mod-list { display: grid; gap: 12px; margin-top: 12px; }
.mod-item { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--stroke); border-radius: 12px; background: var(--card); }
.mod-head { display: flex; align-items: center; gap: 10px; font-size: .8125rem; }
.mod-head .badge { text-transform: uppercase; }
.badge.kind-comment { background: rgba(56, 161, 255, .18); border-color: rgba(56, 161, 255, .5); }
.badge.kind-user { background: rgba(224, 67, 90, .18); border-color: rgba(224, 67, 90, .5); }
.mod-preview a { color: var(--accent); }
.mod-specimen { display: flex; gap: 14px; align-items: center; }
.mod-specimen img, .mod-specimen .card-nophoto { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: none; font-size: 1.5rem; }
.mod-quote { margin: 0 0 6px; padding: 8px 12px; border-left: 3px solid var(--stroke); background: rgba(255, 255, 255, .03); border-radius: 0 8px 8px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mod-reports { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: .875rem; }
.mod-section { display: grid; gap: 10px; margin-bottom: 18px; }
.mod-section h2 { font-size: 1rem; font-weight: 700; }

.page-doc { max-width: 720px; }
.page-doc section { display: grid; gap: 10px; padding: 22px 0; border-top: 1px solid var(--stroke-soft); }
.page-doc h2 { font-size: 1.125rem; font-weight: 700; }
.page-doc h3 { font: 600 .75rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-top: 8px; }
.page-doc p, .page-doc li { line-height: 1.65; color: #D4D4E0; }
.page-doc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.page-doc a { color: var(--accent); }
.page-doc code { font: 400 .8125rem/1 var(--mono); padding: 2px 5px; border-radius: 4px; background: rgba(255, 255, 255, .07); }
.foot a { color: inherit; }

/* ── Chat ─────────────────────────────────────────────────────────────── */

.nav-chat { gap: 6px; }
.museum-ref {
  display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; max-width: 100%;
  padding: 2px 9px 2px 2px; border-radius: 999px; text-decoration: none; color: var(--ink) !important;
  border: 1px solid rgba(255, 165, 0, .4); background: rgba(255, 165, 0, .08); font-size: .8125rem; font-weight: 600;
}
.museum-ref .avatar { --s: 20px; }
.museum-ref span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-day { display: flex; align-items: center; gap: 12px; margin: 18px 0 6px; font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.chat-day::before, .chat-day::after { content: ''; flex: 1; height: 1px; background: var(--stroke-soft); }
.msg { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; }
.msg.grouped { padding-top: 0; }
.msg:hover { background: rgba(255, 255, 255, .025); }
.msg.focus { animation: msgFocus 2.4s ease-out; }
@keyframes msgFocus { 0%, 40% { background: rgba(255, 165, 0, .16); } 100% { background: transparent; } }
.msg-gutter { display: grid; justify-items: center; padding-top: 3px; }
.msg-gutter time { font: 400 .625rem/1 var(--mono); color: transparent; }
.msg:hover .msg-gutter time { color: var(--muted); }
.msg-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; min-width: 0; }
.msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .8125rem; }
.msg-who { display: inline-flex; gap: 6px; align-items: baseline; text-decoration: none; }
.msg-who b { font-weight: 700; }
.msg-who .muted { font: 400 .75rem/1 var(--mono); }
.msg-who:hover b { color: var(--accent); }
.msg-head time { font: 400 .75rem/1 var(--mono); }
.chat-where {
  --c: #888; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 2px 8px 2px 2px; border-radius: 6px;
  text-decoration: none; font-size: .75rem; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent);
}
.chat-where span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.msg-head > * { min-width: 0; }
.chat-where-sym { display: grid; place-items: center; min-width: 22px; height: 18px; border-radius: 4px; font: 700 .625rem/1 var(--mono); background: color-mix(in srgb, var(--c) 28%, transparent); }
.msg-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5em; line-height: 1.55; font-size: .9375rem; overflow-wrap: anywhere; }
.msg-body a:not(.museum-ref):not(.spec-ref) { color: var(--accent); }
.chat-pill {
  position: fixed; left: 50%; bottom: 110px; z-index: 15; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  border: 0; background: var(--accent); color: #12040A; font: 700 .75rem/1 var(--mono); box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}
.chat-pill[hidden] { display: none; }


@media (hover: none) {
  .msg-gutter time { color: var(--muted); }
}
@media (pointer: coarse) {
  .msg-who { min-height: 36px; align-items: center; }
  .side-more { padding: 14px 6px; margin: -14px -6px; }
}
@media (max-width: 560px) {
  .msg { grid-template-columns: 28px minmax(0, 1fr); gap: 10px; }
  .msg-avatar .avatar { --s: 28px !important; }
}

/* ── Chat: channels, the channel, its threads (Slack/Discord) ─────────── */

.cx-app { --side-w: 264px; --thread-w: 400px; position: relative; display: grid; min-height: 0; }
.page-chat {
  grid-template-columns: var(--side-w) minmax(0, 1fr); height: calc(100dvh - var(--bar-h, 69px));
  overflow: hidden; border-top: 0;
}
.page-chat.with-thread { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--thread-w); }
body:has(.page-chat) .foot { display: none; }

/* Channels */
.cx-side { display: flex; flex-direction: column; min-height: 0; background: var(--card); border-right: 1px solid var(--stroke-soft); }
.cx-side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; font: 700 1.125rem/1 var(--sans, inherit); }
.cx-side-close { display: none; }
.cx-side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 20px; scrollbar-width: thin; }
.cx-section { padding-top: 14px; }
.cx-section ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; }
.cx-side { min-width: 0; overflow: hidden; }
.cx-side-scroll { overflow-x: hidden; }
.cx-section-title { margin: 0 8px 6px; font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.cx-chan {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 8px; border-radius: 8px;
  text-decoration: none; color: var(--muted); font-size: .9375rem;
}
.cx-chan:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.cx-chan[aria-current="page"] { background: rgba(255, 165, 0, .12); color: var(--ink); }
.cx-chan.unread { color: var(--ink); font-weight: 700; }
.cx-chan-mark { display: grid; place-items: center; width: 22px; flex: none; }
.cx-chan-mark .avatar { --s: 20px; }
.cx-chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.cx-hash { font: 700 1rem/1 var(--mono); color: var(--muted); }
.cx-sym { display: grid; place-items: center; min-width: 22px; height: 20px; padding: 0 3px; border-radius: 5px; font: 700 .625rem/1 var(--mono); color: var(--ink);
  background: color-mix(in srgb, var(--c) 30%, transparent); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); }
.cx-jump { display: flex; align-items: center; gap: 8px; margin: 0 4px; padding: 0 10px; border: 1px solid var(--stroke); border-radius: 8px; background: var(--bg); color: var(--muted); }
.cx-jump:focus-within { border-color: var(--accent); }
.cx-at { font: 600 .875rem/1 var(--mono); color: var(--muted); }
.cx-jump input { flex: 1; min-width: 0; min-height: 36px; border: 0; background: none; color: var(--ink); font: inherit; font-size: .875rem; outline: none; }
.cx-scrim { display: none; }
.cx-count {
  flex: none; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--accent); color: #111; font: 700 .6875rem/1 var(--mono);
}
.cx-chan-n { flex: none; font: 400 .6875rem/1 var(--mono); color: var(--muted); opacity: .8; }
.cx-side-find { padding: 0 10px 4px; }
.cx-side-find .cx-jump { margin: 0; }
.cx-section-hint { margin: 0 8px; font-size: .8125rem; line-height: 1.4; color: var(--muted); }
.cx-signin { margin-top: 18px; }
.cx-signin a { color: var(--accent); }
.cx-result { display: flex; align-items: center; gap: 2px; }
.cx-result .cx-chan { flex: 1; min-width: 0; }
.cx-result-dm { flex: none; width: 36px; height: 36px; color: var(--muted); }
.cx-result-dm:hover, .cx-result-dm:focus-visible { color: var(--ink); }
.cx-pin-slot:empty { display: none; }
.cx-pin[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }

/* All channels */
.cx-browse-scroll { gap: 14px; padding-top: 16px; }
.cx-browse-scroll > * { width: 100%; max-width: 920px; }
.cx-browse-tools { display: grid; gap: 10px; }
.cx-browse-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx-browse-search { flex: none; max-width: none; margin: 0; }
.cx-sort { min-height: 34px; padding: 0 10px; border: 1px solid var(--stroke); border-radius: 999px; background: var(--bg); color: var(--ink); font: 500 .75rem/1 var(--mono); }
.cx-browse-count { font: 400 .75rem/1 var(--mono); }
.cx-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cx-row { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding-right: 8px; }
.cx-row:hover { background: rgba(255, 255, 255, .035); }
.cx-row-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px; text-decoration: none; color: var(--ink); }
.cx-row-mark { display: grid; place-items: center; width: 30px; flex: none; }
.cx-row-mark .avatar { --s: 28px !important; }
.cx-row-mark .cx-sym { min-width: 30px; height: 28px; font-size: .75rem; }
.cx-row-mark .cx-hash { font-size: 1.25rem; }
.cx-row-text { flex: 1; min-width: 0; display: grid; gap: 3px; }
.cx-row-text b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-row.unread .cx-row-text b { font-weight: 700; }
.cx-row-text small { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-row-meta { flex: none; display: grid; justify-items: end; gap: 4px; font: 400 .75rem/1 var(--mono); }
.cx-rows-empty { padding: 24px 10px; font-size: .9375rem; }
.cx-pin-small { min-height: 32px; padding: 0 10px; }
@media (max-width: 560px) {
  .cx-row-meta { display: none; }
  .cx-pin-small span { display: none; }
}

/* The channel */
.cx-main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.cx-head { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--stroke-soft); min-height: 64px; }
.cx-menu { display: none; position: relative; }
.cx-menu.unread::after { content: ''; position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cx-head-mark { display: grid; place-items: center; flex: none; }
.cx-head-mark .cx-hash { font-size: 1.25rem; }
.cx-head-mark .avatar { --s: 28px !important; }
.cx-head-mark .cx-sym { min-width: 30px; height: 28px; font-size: .75rem; }
.cx-head-text { flex: 1; min-width: 0; }
.cx-head-text h1, .cx-head-text h2 { display: flex; align-items: center; gap: 10px; font-size: 1.0625rem; font-weight: 700; }
.cx-head-text p { font-size: .8125rem; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-head-link { flex: none; }
.cx-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 8px 20px 12px; scrollbar-width: thin; }
.cx-scroll > .cx-list { margin-top: auto; }
.cx-earlier { align-self: center; margin: 8px 0; }
.cx-earlier[hidden] { display: none; }
.cx-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.cx-list .msg-avatar { align-self: start; display: block; }
.cx-list .spec-ref, .cx-list .museum-ref { max-width: 100%; }
.cx-empty { display: grid; gap: 6px; justify-items: start; padding: 32px 0 12px; }
.cx-empty b { font-size: 1.25rem; }
.cx-empty-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; background: var(--bg2); border: 1px solid var(--stroke); margin-bottom: 6px; }
.cx-empty-mark .cx-hash { font-size: 1.75rem; }
.cx-empty-mark .avatar { --s: 40px !important; }
.cx-compose { padding: 10px 20px max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--stroke-soft); }
.cx-compose .composer-text { min-height: 46px; }
.cx-compose .composer-bar { flex-wrap: nowrap; }
.cx-readonly { font-size: .875rem; padding: 12px 0; }
.cx-main .chat-pill { position: absolute; bottom: 86px; }

/* Messages */
.cx-list .msg { grid-template-columns: 36px minmax(0, 1fr); margin: 0 -12px; padding: 6px 12px; border-radius: 6px; }
.cx-list .msg.grouped { padding-top: 1px; padding-bottom: 1px; }
.cx-list .msg.threaded { background: rgba(255, 165, 0, .07); }
.msg.gone .msg-body { font-style: italic; }
.msg-avatar-gone { width: 36px; height: 36px; border-radius: 50%; border: 1px dashed var(--stroke); }
.msg-slot:empty { display: none; }
.cx-replies {
  display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin-top: 2px; padding: 4px 10px 4px 8px; border-radius: 6px;
  border: 1px solid transparent; background: none; color: var(--accent); font-size: .8125rem; cursor: pointer;
}
.cx-replies .muted { font-size: .75rem; display: none; }
.cx-replies .icon { display: none; }
.cx-replies:hover, .cx-replies:focus-visible { border-color: var(--stroke); background: var(--card); }
.cx-replies:hover :is(.muted, .icon), .cx-replies:focus-visible :is(.muted, .icon) { display: inline; }
.cx-tools {
  position: absolute; top: -14px; right: 12px; z-index: 2; display: flex; gap: 2px; padding: 2px; border-radius: 8px;
  border: 1px solid var(--stroke); background: #0E0E20; box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.cx-tools button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; }
.cx-tools button:hover, .cx-tools button:focus-visible { background: rgba(255, 255, 255, .07); color: var(--ink); }
.cx-tools .mod-hide:hover { color: #FF8A8A; }
.cx-list .msg:first-child .cx-tools { top: 2px; }
@media (hover: hover) {
  .msg:hover .cx-tools, .msg:focus-within .cx-tools { opacity: 1; pointer-events: auto; }
}
@media (hover: none) {
  .msg.open { background: rgba(255, 255, 255, .035); }
  .msg.open .cx-tools { opacity: 1; pointer-events: auto; }
  .cx-tools button { width: 44px; height: 44px; }
  .cx-tools { top: -24px; }
  .cx-replies { min-height: 40px; }
}

/* Threads */
.cx-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--card); border-left: 1px solid var(--stroke-soft); }
.cx-thread[hidden] { display: none; }
.cx-thread-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--stroke-soft); min-height: 64px; }
.cx-thread-title { flex: 1; display: grid; gap: 2px; min-width: 0; }
.cx-thread-title small { font: 400 .75rem/1.2 var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-back { display: none; }
.cx-thread-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px; scrollbar-width: thin; }
.cx-thread-sep { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.cx-thread-sep::after { content: ''; flex: 1; height: 1px; background: var(--stroke-soft); }

/* Not enough room for three columns: the thread over the channel. */
@media (max-width: 1180px) {
  .page-chat.with-thread { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .page-chat .cx-thread { position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--thread-w), 100%); z-index: 6; box-shadow: -18px 0 40px rgba(0, 0, 0, .55); }
}
/* Phones and small tablets, like Discord: the channel full screen, channels in a drawer, the thread over it. */
@media (max-width: 820px) {
  .page-chat, .page-chat.with-thread { grid-template-columns: minmax(0, 1fr); }
  .cx-menu { display: grid; margin-left: -8px; }
  .cx-head { padding: 8px 12px; gap: 8px; min-height: 56px; }
  .cx-head-text p { display: none; }
  .cx-head-link { display: none; }
  .cx-scroll { padding: 8px 14px 10px; }
  .cx-compose { padding: 8px 12px max(10px, env(safe-area-inset-bottom)); }
  .page-chat .cx-side {
    position: absolute; inset: 0 auto 0 0; z-index: 8; width: min(320px, 86vw);
    transform: translateX(-100%); transition: transform .22s ease; visibility: hidden;
  }
  .page-chat.show-side .cx-side { transform: none; visibility: visible; box-shadow: 18px 0 40px rgba(0, 0, 0, .6); }
  .cx-side-close { display: grid; }
  .page-chat.show-side .cx-scrim { display: block; position: absolute; inset: 0; z-index: 7; background: rgba(0, 0, 0, .55); }
  .cx-chan { min-height: 44px; }
  .page-chat .cx-thread { width: 100%; box-shadow: none; border-left: 0; }
  .cx-back { display: grid; margin-left: -8px; }
  .page-chat .cx-close { display: none; }
  .cx-thread-head { padding: 8px 12px; min-height: 56px; }
  .cx-thread-scroll { padding: 12px 14px; }
}
@media (max-width: 560px) {
  .cx-list .msg { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; margin: 0 -8px; padding: 6px 8px; }
  .cx-list .msg-avatar .avatar { --s: 30px !important; }
  .msg-avatar-gone { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) { .page-chat .cx-side { transition: none; } }

/* The live chat inside the home and the feed: one channel, threads inside the box. */
.chat-embed { height: min(640px, 78dvh); grid-template-rows: minmax(0, 1fr); border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); overflow: hidden; }
.chat-embed .cx-head { padding: 14px 18px 12px; }
.chat-embed .cx-head-text p { white-space: normal; }
.chat-embed .cx-scroll, .chat-embed .cx-compose { padding-left: 18px; padding-right: 18px; }
.chat-embed .cx-compose { background: rgba(3, 3, 10, .5); }
.chat-embed .chat-day { margin: 12px 0 4px; }
.chat-embed .cx-thread { position: absolute; inset: 0; z-index: 4; border-left: 0; }
.chat-embed .cx-close { display: none; }
.chat-embed .cx-back { display: grid; margin-left: -8px; }
.chat-embed .cx-thread-head { padding-left: 14px; }
@media (max-width: 560px) {
  .chat-embed { height: 72dvh; border-radius: 12px; margin: 0 -4px; }
  .chat-embed .cx-scroll, .chat-embed .cx-compose { padding-left: 14px; padding-right: 14px; }
}

/* Pins, topic channels, asking for a channel */
.cx-section-hint { margin: -2px 8px 8px; font-size: .75rem; line-height: 1.4; color: var(--muted); }
.cx-topic { color: var(--accent); }
.cx-ask { color: var(--accent); }
.cx-ask:hover { color: var(--ink); }
.cx-pin { flex: none; gap: 6px; }
.cx-pin[aria-pressed="true"] { border-color: rgba(255, 165, 0, .55); color: var(--accent); background: rgba(255, 165, 0, .08); }
.cx-pin[aria-pressed="true"] .icon { fill: currentColor; }
.cx-request-body { display: grid; gap: 18px; max-width: 560px; padding: 20px 0 32px; }
.cx-request-body > p { color: #C8C8D8; line-height: 1.55; }
.cx-request-form { display: grid; gap: 14px; }
.cx-request-form .field { display: grid; gap: 6px; }
.cx-request-form .field > span { font-size: .875rem; font-weight: 600; }
.cx-request-form input, .cx-request-form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--stroke); background: var(--bg); color: var(--ink); font: inherit;
}
.cx-request-form input:focus, .cx-request-form textarea:focus { outline: none; border-color: var(--accent); }
.cx-requests { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cx-requests li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--stroke-soft); border-radius: 10px; }
.cx-status { font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.cx-status.is-open { color: #5BE08F; }
.cx-status.is-requested { color: var(--accent); }
.cx-request .cx-scroll > .cx-request-body { margin: 0; }
@media (max-width: 820px) { .cx-pin span { display: none; } .cx-pin { padding-inline: 10px; } }
.mod-channel-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mod-channel-fields .wide { grid-column: 1 / -1; }
.mod-channel-fields .field { display: grid; gap: 4px; font-size: .8125rem; }
.mod-channel-fields input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--stroke); background: var(--bg); color: var(--ink); font: inherit; }
@media (max-width: 560px) { .mod-channel-fields { grid-template-columns: 1fr; } }
.notification-mark { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: rgba(255, 165, 0, .14); color: var(--accent); font: 700 1.125rem/1 var(--mono); }
/* The periodica.me ID of a specimen: one click copies it. */
.pid { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 4px 10px 4px 6px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--stroke); background: var(--bg2); color: var(--muted); font: 500 .75rem/1 var(--mono); }
.pid code { padding: 3px 6px; border-radius: 5px; background: rgba(255, 165, 0, .12); color: var(--accent); font: 700 .875rem/1 var(--mono); }
.pid:hover { border-color: var(--accent); color: var(--ink); }
@media (pointer: coarse) { .pid { min-height: 44px; } }

/* Under the table: just added and hot right now, side by side. */
.home-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 44px; align-items: start; scroll-margin-top: 84px; }
.home-join { margin-top: 24px; max-width: 640px; }
.hot-block .side-head { flex-wrap: wrap; gap: 10px; align-items: center; }
.tabs-small .tab { min-height: 32px; padding: 0 12px; font-size: .75rem; }
.hot-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: none; }
.hot-list[aria-busy="true"] { opacity: .5; }
.hot-row { display: grid; grid-template-columns: 22px 68px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; min-height: 60px; }
.hot-row:hover { background: rgba(255, 255, 255, .04); }
.hot-rank { font: 700 .875rem/1 var(--mono); color: var(--muted); text-align: center; }
.hot-list li:nth-child(-n+3) .hot-rank { color: var(--accent); font-size: 1rem; }
.hot-row img, .hot-row .side-sym { width: 68px; height: 68px; border-radius: 10px; object-fit: cover; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.hot-text { display: grid; gap: 4px; min-width: 0; }
.hot-text b { font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-text small { display: flex; align-items: center; gap: 4px; font: 400 .6875rem/1.3 var(--mono); color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hot-sym { display: inline-grid; place-items: center; min-width: 20px; height: 16px; padding: 0 3px; border-radius: 4px; font-weight: 700; color: var(--ink); background: color-mix(in srgb, var(--c) 30%, transparent); }
.hot-stats { display: grid; gap: 4px; justify-items: end; font: 600 .75rem/1 var(--mono); color: var(--muted); }
.hot-stats span { display: inline-flex; align-items: center; gap: 4px; }
.hot-stats span:first-child { color: var(--accent); }
.hot-stats span:first-child .icon { fill: currentColor; }
.hot-empty { padding: 16px 0; }
@media (max-width: 900px) { .home-pair { grid-template-columns: minmax(0, 1fr); } }

/* ── Help ─────────────────────────────────────────────────────────────── */
.page-help { max-width: 920px; margin: 0 auto; width: 100%; padding: 40px var(--gutter) 72px; display: grid; gap: 8px; }
.help-hero { display: grid; gap: 14px; padding-bottom: 28px; }
.help-hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; letter-spacing: -1px; line-height: 1.05; }
.help-lede { max-width: 62ch; color: #C8C8D8; font-size: 1.0625rem; line-height: 1.6; }
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.help-toc a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--stroke);
  text-decoration: none; font: 500 .75rem/1 var(--mono); color: #C8C8D8; }
.help-toc a:hover { border-color: var(--accent); color: var(--ink); }
.help-section { display: grid; gap: 16px; padding: 36px 0; border-top: 1px solid var(--stroke-soft); scroll-margin-top: 90px; }
.help-section h2 { font-size: 1.625rem; font-weight: 700; letter-spacing: -.3px; }
.help-intro { color: var(--muted); margin-top: -6px; }
.help-section p, .help-list li { color: #D4D4E0; line-height: 1.65; }
.help-section a:not(.btn) { color: var(--accent); }
.help-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; counter-reset: none; }
.help-steps li { display: flex; gap: 16px; padding: 20px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); }
.help-step-n { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  border: 2px solid var(--accent); color: var(--accent); font: 700 1.125rem/1 var(--mono); }
.help-steps h3, .help-card h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: 6px; }
.help-steps p { font-size: .9375rem; }
.help-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.help-card { padding: 18px 20px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); }
.help-card p { font-size: .9375rem; }
.help-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.help-list li { position: relative; padding-left: 22px; }
.help-list li::before { content: ''; position: absolute; left: 0; top: .62em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.help-tok { padding: 2px 7px; border-radius: 6px; background: rgba(255, 165, 0, .1); border: 1px solid rgba(255, 165, 0, .3); color: var(--accent); font: 600 .875em/1.4 var(--mono); white-space: nowrap; }
.help-tags { display: grid; gap: 10px; padding: 18px 20px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); }
.help-tags > div { display: flex; align-items: baseline; gap: 14px; color: #D4D4E0; }
.help-tags > div > .help-tok:first-child { min-width: 36px; text-align: center; font-size: 1rem; }
.help-faq { border-bottom: 1px solid var(--stroke-soft); }
.help-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.0625rem; }
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary .icon { flex: none; color: var(--muted); transition: transform .2s; }
.help-faq[open] summary .icon { transform: rotate(180deg); color: var(--accent); }
.help-faq summary:hover { color: var(--accent); }
.help-faq > div { padding: 0 0 18px; max-width: 70ch; }
@media (max-width: 700px) { .help-steps { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .help-faq summary .icon { transition: none; } }

/* ── Home: the social row ─────────────────────────────────────────────── */

.home-social { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 24px; margin-top: 44px; align-items: start; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #5BE08F; box-shadow: 0 0 0 4px rgba(91, 224, 143, .15); animation: live 2.4s ease-in-out infinite; }
@keyframes live { 50% { box-shadow: 0 0 0 7px rgba(91, 224, 143, .04); } }

.home-side { display: grid; gap: 18px; }
.side-block { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); }
.side-head { display: flex; align-items: baseline; justify-content: space-between; }
.side-head .section-title { margin: 0; }
.side-more { font: 500 .75rem/1 var(--mono); color: var(--muted); text-decoration: none; }
.side-more:hover { color: var(--ink); }
.side-museums, .side-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.side-museums a, .side-recent a { display: flex; align-items: center; gap: 12px; padding: 6px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; min-height: 48px; }
.side-museums a:hover, .side-recent a:hover { background: rgba(255, 255, 255, .04); }
.side-rank { width: 16px; font: 600 .75rem/1 var(--mono); color: var(--muted); text-align: center; flex: none; }
.side-name { display: grid; gap: 2px; min-width: 0; flex: 1; }
.side-name b { font-weight: 600; font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-name small { font: 400 .6875rem/1.3 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-karma { display: inline-flex; align-items: center; gap: 4px; font: 600 .75rem/1 var(--mono); color: var(--accent); flex: none; }
.side-karma .icon { fill: currentColor; }
.side-recent img, .side-sym { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.side-sym { display: grid; place-items: center; font: 700 .875rem/1 var(--mono); background: color-mix(in srgb, var(--c) 15%, var(--bg2)); }
.side-join p { color: #C8C8D8; font-size: .9375rem; line-height: 1.55; }
.side-join .btn { justify-self: start; }

@media (max-width: 1000px) {
  .home-social { grid-template-columns: minmax(0, 1fr); }
  .home-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
}
@media (max-width: 560px) {
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.live-pill {
  display: flex; align-items: center; gap: 10px; max-width: 100%; margin: -6px 0 18px; padding: 8px 14px; cursor: pointer;
  border: 1px solid rgba(91, 224, 143, .35); border-radius: 999px; background: rgba(91, 224, 143, .06); color: var(--ink);
  font-size: .875rem; text-align: left; min-height: 44px;
}
.live-pill:hover { border-color: rgba(91, 224, 143, .7); }
.live-pill > b { flex: none; }
.live-last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #C8C8D8; }
.live-last b { color: var(--ink); font-weight: 600; }
.live-pill .icon { flex: none; margin-left: auto; color: var(--muted); }
.chat-embed { scroll-margin-top: 84px; }

/* ── Scroll: a cue on big screens, gentle snapping on phones ──────────── */

.scroll-cue {
  position: fixed; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); z-index: 15; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(91, 224, 143, .45); background: rgba(6, 6, 16, .92); backdrop-filter: blur(8px); color: var(--ink);
  font: 600 .8125rem/1 var(--mono); box-shadow: 0 14px 34px rgba(0, 0, 0, .6);
  transition: opacity .25s, transform .25s; animation: cueIn .5s .8s backwards;
}
.scroll-cue .icon { animation: cueBob 1.8s ease-in-out infinite; }
.scroll-cue:hover { border-color: rgba(91, 224, 143, .8); }
.scroll-cue.gone { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
body.locked .scroll-cue { display: none; }
@keyframes cueIn { from { opacity: 0; transform: translate(-50%, 12px); } }
@keyframes cueBob { 50% { transform: translateY(3px); } }

/* Proximity snapping: it only takes over near a stop, so free scrolling still works. Not on the table
   sideways: it fought with keyboard focus (a focused tile was snapped out of view); the minimap does that job. */
@media (max-width: 760px) {
  html:has(.home-social) { scroll-snap-type: y proximity; }
  .ptable-wrap, .home-social > .chat-embed, .home-side > .side-block, .page-table > .section { scroll-snap-align: start; scroll-margin-top: 76px; }
  .viewer-thumbs { scroll-snap-type: x mandatory; scroll-padding: 0 18px; }
  .thumb { scroll-snap-align: start; }
  .scroll-cue { display: none; } /* phones scroll naturally; the Live chat strip says it already */
}
@media (prefers-reduced-motion: reduce) { .scroll-cue, .scroll-cue .icon { animation: none; } }

/* ── Bar: links on the left, the person on the right ──────────────────── */

.nav { flex-wrap: nowrap; gap: 4px 20px; }
.nav-links, .nav-user { display: flex; align-items: center; gap: 4px 18px; }
.nav-me-wrap { position: relative; }
.nav-avatar { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.nav-avatar .avatar { transition: box-shadow .15s; }
.nav-avatar:hover .avatar, .nav-avatar[aria-expanded="true"] .avatar, .nav-avatar.current .avatar { box-shadow: 0 0 0 2px var(--accent); }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; min-width: 240px; display: grid; padding: 6px;
  border: 1px solid var(--stroke); border-radius: 12px; background: #0B0B1C; box-shadow: 0 18px 44px rgba(0, 0, 0, .7);
}
.user-menu[hidden] { display: none; }
.user-menu-who { display: flex; align-items: center; gap: 10px; padding: 8px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--stroke-soft); }
.user-menu-who span { display: grid; gap: 2px; min-width: 0; }
.user-menu-who b { font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-who small { font: 400 .75rem/1 var(--mono); color: var(--muted); }
.user-menu a, .user-menu button {
  display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border: 0; border-radius: 8px; background: none;
  text-decoration: none; text-align: left; cursor: pointer; font: 500 .875rem/1 var(--sans); color: var(--ink);
}
.user-menu a:hover, .user-menu button:hover, .user-menu a:focus-visible, .user-menu button:focus-visible { background: rgba(255, 255, 255, .06); }
.user-menu .icon { color: var(--muted); }
.user-menu button { border-top: 1px solid var(--stroke-soft); border-radius: 0 0 8px 8px; margin-top: 4px; }

@media (max-width: 560px) {
  .nav { gap: 0 10px; }
  .nav-links { gap: 0 14px; }
  .nav-user { gap: 0 6px; }
  .user-menu { position: fixed; left: 12px; right: 12px; top: 64px; min-width: 0; }
}

/* ── Museums: search and sort ─────────────────────────────────────────── */

.museums-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 10px; }
.search { display: flex; align-items: center; gap: 8px; flex: 1 1 420px; max-width: 620px; padding: 0 6px 0 14px; min-height: 46px;
  border: 1px solid var(--stroke); border-radius: 999px; background: rgba(255, 255, 255, .03); color: var(--muted); }
.search:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(130, 180, 255, .18); }
.search-input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: .9375rem; padding: 10px 0; }
.search-input::-webkit-search-cancel-button { filter: invert(.7); }
.search-scope { border: 0; border-left: 1px solid var(--stroke); background: none; padding: 8px 10px; font: 500 .8125rem/1 var(--mono); color: var(--muted); cursor: pointer; }
.search-scope option { background: var(--bg2); color: var(--ink); }
.museums-count { font: 400 .8125rem/1 var(--mono); margin: 6px 0 16px; }
.museum-cover { position: relative; }
.museum-rank { position: absolute; left: 10px; top: 10px; padding: 3px 8px; border-radius: 6px; background: rgba(3, 3, 10, .75); font: 700 .75rem/1.2 var(--mono); }
.museum-about { color: #C8C8D8; font-size: .875rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.museum-stats span { display: inline-flex; align-items: center; gap: 4px; }
.museum-stats .icon { fill: var(--accent); stroke: none; }
mark { background: rgba(255, 165, 0, .3); color: var(--ink); border-radius: 3px; padding: 0 2px; }

/* ── Chat composer on one line ────────────────────────────────────────── */

.composer-row { display: flex; align-items: flex-end; gap: 8px; }
.composer-row .composer-box { flex: 1; min-width: 0; }
.composer-row .composer-text { min-height: 46px; resize: none; }
.send-btn {
  display: grid; place-items: center; flex: none; width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent); color: #12040A; transition: transform .12s, opacity .12s;
}
.send-btn .icon { fill: currentColor; stroke: currentColor; stroke-width: 1.5; margin-left: 2px; }
.send-btn:disabled { opacity: .35; cursor: default; }
.send-btn:not(:disabled):active { transform: scale(.94); }
.composer-bar-compact:empty, .composer-bar-compact:not(:has(*:not(:empty))) { display: none; }
.cx-compose .composer-bar { justify-content: flex-start; }

/* ── Threads that fold ────────────────────────────────────────────────── */

.comment { position: relative; }
.fold { border: 0; background: none; padding: 0 2px; min-height: 24px; cursor: pointer; font: 500 .75rem/1 var(--mono); color: var(--muted); }
.fold:hover { color: var(--ink); }
.fold-note { display: none; font: 400 .75rem/1 var(--mono); }
.comment.folded > .comment-body, .comment.folded > .comment-actions, .comment.folded > .comment-slot,
.comment.folded > .replies { display: none; }
.comment.folded > .comment-head .fold-note { display: inline; }
.comment.folded > .comment-head { opacity: .75; }
.replies { position: relative; }
.thread-line {
  position: absolute; left: 0; top: 0; bottom: 6px; width: 14px; padding: 0; border: 0; cursor: pointer; background: none;
}
.replies.flat > .thread-line { display: none; }
.thread-line::after { content: ''; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: var(--stroke-soft); border-radius: 1px; }
.thread-line:hover::after { background: var(--accent); }
.replies { border-left: 0; }
@media (pointer: coarse) {
  .fold { min-height: 36px; padding: 0 8px; margin-left: -8px; }
}
@media (max-width: 560px) {
  .search { flex: 1 1 100%; max-width: none; min-width: 0; }
  .search-scope { max-width: 118px; padding: 8px 6px; }
  .museums-toolbar .tabs { max-width: 100%; overflow-x: auto; }
}

/* ── Follow ───────────────────────────────────────────────────────────── */

.follow {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #12040A; font: 700 .8125rem/1 var(--mono);
  transition: background .15s, color .15s, border-color .15s;
}
.follow:hover { background: #FFB733; border-color: #FFB733; }
.follow.on { background: transparent; color: var(--ink); border-color: var(--stroke); }
.follow.on:hover { border-color: #E0435A; color: #FFB3BD; }
.follow-small { min-height: 32px; padding: 0 12px; font-size: .75rem; }
.profile-follow { grid-column: 1 / -1; }
@media (min-width: 901px) { .profile-follow { grid-column: auto; align-self: start; } }
.museum-card { position: relative; }
.museum-card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.museum-card > .follow { position: absolute; right: 12px; top: 12px; z-index: 2; box-shadow: 0 6px 18px rgba(0, 0, 0, .5); }
.museum-card > .follow.on { background: rgba(6, 6, 16, .85); }
.museum-card:focus-within { border-color: rgba(255, 165, 0, .6); }
.museum-card a:not(.museum-card-link) { position: relative; z-index: 2; }
.suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.suggest-list li { display: flex; align-items: center; gap: 10px; }
.suggest-list li > a { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; min-height: 48px; }
.suggest-list li > a:hover b { color: var(--accent); }

/* ── Feed ─────────────────────────────────────────────────────────────── */

.nav-feed { gap: 6px; }
.page-feed {
  display: grid; grid-template-columns: minmax(0, 620px) minmax(300px, 380px); justify-content: center; gap: 32px;
  padding: 24px var(--gutter) 56px; width: 100%; align-items: start;
}
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.feed-head h1 { font-size: clamp(1.375rem, 2.4vw, 1.75rem); font-weight: 700; }
.feed-list { display: grid; gap: 22px; }
.feed-more { display: grid; place-items: center; padding: 30px; }
.feed-more[hidden] { display: none; }
.feed-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 18px;
  max-height: calc(100dvh - 100px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* The chat takes the room the museums to follow leave, never less than a few messages. */
.feed-side .chat-embed { flex: 1 1 auto; height: auto; min-height: 340px; max-height: 720px; }
.feed-side > .side-block { flex: none; }
.feed-empty { display: grid; gap: 14px; padding: 28px; border: 1px dashed var(--stroke); border-radius: 16px; }
.feed-empty h2 { font-size: 1.25rem; font-weight: 700; }

.post { --c: #888; border: 1px solid var(--stroke); border-radius: 16px; background: var(--card); overflow: hidden; }
.post-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; }
.post-who { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.post-who span { display: grid; gap: 2px; min-width: 0; }
.post-who b { font-weight: 700; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-who small { font: 400 .75rem/1 var(--mono); color: var(--muted); }
.post-who:hover b { color: var(--accent); }
.post-head .chip { flex: none; }
.post-media { position: relative; background: #010104; }
.post-photos { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.post-photos::-webkit-scrollbar { display: none; }
.post-photo { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: start; display: block; }
.post-photo img { width: 100%; height: 100%; object-fit: cover; }
.post-nophoto { display: grid; place-items: center; font: 800 5rem/1 var(--sans); color: color-mix(in srgb, var(--c) 45%, transparent); text-decoration: none; }
.post-dots { position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); display: flex; justify-content: center; }
.post-dots button { display: grid; place-items: center; width: 18px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; }
.post-dots button::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .45); transition: background .2s, transform .2s; }
.post-dots button.on::before { background: #fff; transform: scale(1.2); }
.post-dots button:hover::before { background: rgba(255, 255, 255, .8); }
.post-arrow { position: absolute; top: 50%; translate: 0 -50%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(3, 3, 10, .72); color: #fff; opacity: 0; transition: opacity .15s, background .15s; }
.post-arrow.prev { left: 12px; }
.post-arrow.next { right: 12px; }
.post-arrow[hidden] { display: none; }
.post-media:hover .post-arrow, .post-arrow:focus-visible { opacity: 1; }
.post-arrow:hover { background: rgba(3, 3, 10, .92); }
/* Touch screens swipe: no arrows there. */
@media (hover: none) { .post-arrow { display: none; } }
.post-actions { display: flex; align-items: center; gap: 10px; padding: 12px 14px 4px; }
.post-action { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; text-decoration: none; font: 600 .875rem/1 var(--mono); color: var(--ink); border: 1px solid var(--stroke); }
.post-action:hover { border-color: rgba(255, 255, 255, .35); }
.post-actions .follow { margin-left: auto; }
.post-text { display: grid; gap: 8px; padding: 8px 16px 16px; }
.post-text h2 { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.post-text h2 a { text-decoration: none; }
.post-text h2 a:hover { color: var(--accent); }
.post-desc { color: #C8C8D8; font-size: .9375rem; line-height: 1.55; }
.post-desc .more, .post-all { color: var(--muted); text-decoration: none; font-size: .875rem; }
.post-desc .more:hover, .post-all:hover { color: var(--ink); }
.post-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .875rem; line-height: 1.45; }
.post-comments b { font-weight: 600; }
.post-comments a { text-decoration: none; }
.post-comments .museum-ref, .post-comments .spec-ref { font-size: .75rem; }

@media (max-width: 1060px) {
  .page-feed { grid-template-columns: minmax(0, 620px); }
  .feed-side { display: none; } /* the chat has its own page on small screens */
}
@media (max-width: 560px) {
  .page-feed { padding: 14px 0 40px; }
  .feed-head { padding: 0 16px; }
  .feed-list { gap: 14px; }
  .post { border-radius: 0; border-left: 0; border-right: 0; }
}
@media (pointer: coarse) { .follow-small { min-height: 40px; } }

.nav-main { gap: 6px; }
.nav-main .icon { opacity: .85; }
@media (min-width: 900px) { .nav-main .icon { display: none; } }
@media (max-width: 560px) {
  .nav-main span { display: none; }
  .nav-links { gap: 0 2px; }
}

/* ── Editor: modes, guided steps, element picker, kind chips ──────────── */

.editor-head { flex-wrap: wrap; }
.editor-head > div { flex: 1; min-width: 0; }
.mode-switch, .editor-head > .mode-switch { flex: none; }
.btn-quiet { border-color: transparent; background: none; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.editor-body { display: contents; }
.editor.guided { grid-template-columns: minmax(0, 1fr); max-width: 680px; }
.guided { display: grid; gap: 14px; min-height: 52dvh; align-content: start; }
.guided-top { display: flex; align-items: center; gap: 14px; }
.guided-progress { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.guided-progress span { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: 3px; transition: width .3s cubic-bezier(.2, .8, .2, 1); }
.guided-count { font: 500 .75rem/1 var(--mono); }
.guided-q { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; letter-spacing: -.3px; margin-top: 10px; outline: none; }
.guided-hint { font-size: .875rem; margin-top: -4px; }
.guided-body { display: grid; gap: 14px; margin-top: 8px; }
.guided-body > input, .guided-body > textarea { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); font-size: 1.125rem; }
.guided-body > textarea { min-height: 180px; font-size: 1rem; line-height: 1.55; resize: vertical; }
.guided-body > input:focus, .guided-body > textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(130, 180, 255, .18); }
.guided-body .ph-drop { padding: 44px 16px; }
.guided-summary { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid color-mix(in srgb, var(--c) 40%, var(--stroke)); border-radius: 14px; background: var(--card); }
.guided-summary img, .guided-summary .card-nophoto { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; flex: none; font-size: 2rem; }
.guided-summary h3 { font-size: 1.125rem; font-weight: 700; margin: 4px 0; overflow-wrap: anywhere; }
.guided-summary p { font: 400 .8125rem/1.4 var(--mono); }
.editor.guided .editor-buttons .btn-primary { min-width: 120px; }
.editor.guided .editor-bar { margin: 18px 0 0; padding-inline: 0; }

.el-picker { display: flex; align-items: center; gap: 12px; }
.el-picked {
  --c: #888; display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 10px; font: 600 1.25rem/1 var(--mono);
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 14%, var(--card));
}
.el-field { position: relative; flex: 1; min-width: 0; }
.el-input { width: 100%; padding: 13px 14px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); font-size: 1rem; }
.el-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(130, 180, 255, .18); }
.el-options { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 25; list-style: none; margin: 0; padding: 4px;
  border: 1px solid var(--stroke); border-radius: 10px; background: #0B0B1C; box-shadow: 0 16px 40px rgba(0, 0, 0, .7); max-height: 320px; overflow: auto; }
.el-options[hidden] { display: none; }
.el-options li { --c: #888; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.el-options li[aria-selected="true"], .el-options li:hover { background: rgba(255, 255, 255, .08); }
.el-options li .muted { margin-left: auto; font: 500 .75rem/1 var(--mono); }
.el-opt-sym { display: grid; place-items: center; min-width: 36px; height: 30px; border-radius: 6px; font: 700 .8125rem/1 var(--mono);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 18%, transparent); }

.kind-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kind-chip { min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); color: var(--ink); font: 600 .875rem/1 var(--sans); }
.kind-chip:hover { border-color: rgba(255, 255, 255, .35); }
.kind-chip[aria-checked="true"] { background: color-mix(in srgb, var(--c, var(--accent)) 25%, transparent); border-color: var(--c, var(--accent)); }
.guided-body .kind-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.guided-body .kind-chip { min-height: 56px; font-size: 1rem; }

@media (max-width: 560px) {
  .mode-switch { width: 100%; }
  .mode-switch button { flex: 1; }
  .editor.guided .editor-buttons { display: flex; }
  .editor.guided .editor-buttons .btn { flex: 1; }
  .editor.guided .editor-buttons .btn[hidden] { display: none; }
}
@media (max-width: 560px) {
  .editor-head .mode-switch { flex: 1 1 100%; order: 3; }
  .mode-switch button { white-space: nowrap; }
  body:has(.page-editor) .foot { display: none; }
}
.share {
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); color: var(--ink); font: 600 .8125rem/1 var(--mono);
}
.share:hover { border-color: rgba(255, 255, 255, .35); }
.share-small { width: 40px; padding: 0; justify-content: center; }
@media (pointer: coarse) { .share { min-height: 44px; } .share-small { width: 44px; } }

/* ── Explore: global search ───────────────────────────────────────────── */
.element-hits { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 6px; }
.element-hits:empty { display: none; }
.element-hits > .muted { font: 500 .75rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1px; margin-right: 4px; }
.element-hits small { margin-left: 2px; font: 500 .6875rem/1 var(--mono); }
.explore-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 8px 0 4px; }
.kind-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.kind-filter[hidden] { display: none; }
.kind-chip-small { min-height: 34px; padding: 0 12px; font-size: .8125rem; }
.search-scope[hidden] { display: none; }
.card-hit { font-size: .8125rem; line-height: 1.45; color: #C8C8D8; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (pointer: coarse) { .kind-chip-small { min-height: 40px; } }
@media (max-width: 560px) {
  .explore-filters { flex-direction: column; align-items: stretch; }
  .kind-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .kind-filter > * { flex: none; }
}
.cards > .empty, .museums > .empty { grid-column: 1 / -1; }
.post-why { display: flex; align-items: center; gap: 6px; padding: 10px 14px 0; font: 600 .75rem/1 var(--mono); color: var(--accent); }
.post.suggested { border-color: rgba(255, 165, 0, .35); }
.post-reply { padding-top: 6px; border-top: 1px solid var(--stroke-soft); margin-top: 4px; }
.post-reply .composer-text { min-height: 42px; padding: 9px 12px; font-size: .9375rem; }
.post-reply .send-btn { width: 42px; height: 42px; }
.post-comments li.fresh { animation: msgFocus 2.4s ease-out; border-radius: 6px; }

/* ── Goals ──────────────────────────────────────────── */
.specimen-tags { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.goals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.badge-goal { --c: #888; display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--stroke); background: var(--card); }
.badge-goal.earned { border-color: color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 8%, var(--card)); }
.goal-mark { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; font: 700 1.0625rem/1 var(--mono);
  border: 2px solid color-mix(in srgb, var(--c) 30%, transparent); color: color-mix(in srgb, var(--c) 45%, var(--muted)); }
.badge-goal.earned .goal-mark { border-color: var(--c); color: var(--c); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 30%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent); }
.goal-text { display: grid; gap: 3px; min-width: 0; }
.goal-text b { font-size: .9375rem; }
.goal-text small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.badge-goal.locked .goal-text b { color: #C8C8D8; }
.goal-progress { display: grid; gap: 4px; margin-top: 3px; }
.goal-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.goal-bar span { display: block; height: 100%; background: var(--c); }
.goals-mini { display: contents; }
.goals-card { display: grid; gap: 10px; width: 100%; padding: 14px; border-radius: 14px; cursor: pointer; text-align: left;
  border: 1px solid var(--stroke); background: var(--card); color: var(--ink); font: inherit; }
.goals-card:hover, .goals-card:focus-visible { border-color: rgba(255, 165, 0, .55); }
.goals-card-head { display: flex; align-items: center; gap: 8px; }
.goals-card-head b { font-size: .9375rem; }
.goals-card-head .muted { font: 500 .75rem/1 var(--mono); }
.goals-card-head .icon { margin-left: auto; color: var(--muted); }
.goals-card > .goal-bar span { background: var(--accent); }
.goals-marks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.goal-mark.mini { width: 30px; height: 30px; border-radius: 9px; border-width: 1.5px; font-size: .6875rem;
  border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.goals-more { font: 600 .75rem/1 var(--mono); color: var(--muted); }
.goals-next { font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goals-next b { font-weight: 600; }
.goals-dialog { width: min(920px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 1px solid var(--stroke); border-radius: 18px;
  background: var(--bg2); color: var(--ink); }
.goals-dialog::backdrop { background: rgba(0, 0, 0, .7); }
.goals-dialog-box { display: grid; gap: 14px; padding: 22px; }
.goals-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.goals-dialog-head h2 { font-size: 1.375rem; font-weight: 700; }
.goals-dialog h3 { margin: 8px 0 0; }
@media (max-width: 560px) { .goals-dialog-box { padding: 16px; } }

/* ── Several at once ──────────────────────────────────────────────────── */
.editor-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.page-batch { max-width: 1100px; }
.batch-start { margin: 10px 0 30px; }
.batch-start[hidden] { display: none; }
.batch-choose { width: 100%; padding: 56px 20px; gap: 10px; }
.batch-choose b { font-size: 1.25rem; }
.batch-choose span { max-width: 46ch; line-height: 1.5; }
.batch-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.batch-card { --c: var(--stroke); display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: var(--card);
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--stroke)); }
.batch-card.is-saved { opacity: .7; }
.batch-card.is-error { border-color: #E0435A; }
.batch-head { display: flex; align-items: center; gap: 10px; }
.batch-n { font: 600 .75rem/1 var(--mono); color: var(--muted); }
.batch-sym { display: grid; place-items: center; min-width: 38px; height: 32px; padding: 0 6px; border-radius: 8px; font: 700 .875rem/1 var(--mono);
  border: 1px solid color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 15%, transparent); }
.batch-state { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; font: 600 .75rem/1 var(--mono); color: var(--muted); }
.batch-state.ok { color: #7FE0A6; }
.batch-state.bad { color: #FF8A8A; }
.batch-state.todo { color: #F2C94C; }
.spinner-small { width: 12px; height: 12px; border-width: 2px; }
.batch-photos { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.batch-photos::-webkit-scrollbar { display: none; }
.batch-photo { position: relative; flex: none; width: 104px; height: 104px; margin: 0; border-radius: 10px; overflow: hidden; background: var(--bg2); display: grid; place-items: center; }
.batch-photo img { width: 100%; height: 100%; object-fit: cover; }
.batch-photo.is-uploading img { opacity: .55; }
.batch-photo .ph-progress { left: 8px; right: 8px; bottom: 8px; }
.batch-photo .ph-cover { left: 6px; top: 6px; font-size: .5625rem; }
.batch-photo-actions { position: absolute; right: 4px; top: 4px; display: flex; gap: 4px; }
.batch-photo-actions button { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(3, 3, 10, .75); color: var(--ink); }
.batch-add { flex: none; width: 104px; height: 104px; border-radius: 10px; border: 1.5px dashed var(--stroke); background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.batch-add:hover { border-color: var(--c); color: var(--ink); }
.batch-title { width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); font-size: 1rem; }
.batch-title:focus, .batch-desc:focus { outline: none; border-color: var(--focus); }
.batch-desc { width: 100%; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03);
  color: var(--ink); font: inherit; font-size: .875rem; line-height: 1.45; resize: vertical; }
.batch-field small { text-transform: none; letter-spacing: 0; opacity: .7; }
.kind-chips-small { gap: 6px; flex-wrap: wrap; }
.kind-chips-small > * { flex: none; }
.batch-merge { justify-self: start; gap: 6px; }
.batch-saved a { color: var(--accent); font-weight: 600; }
.batch-more { margin: 16px 0 0; }
.batch-more[hidden] { display: none; }
.batch-bar { flex-wrap: wrap; }
.batch-bar[hidden] { display: none; }
.batch-bar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.batch-progress { font: 400 .75rem/1.3 var(--mono); }
.batch-bar > .btn-primary { margin-left: auto; min-width: 180px; }
@media (pointer: coarse) { .batch-photo-actions button { width: 36px; height: 36px; } }
@media (max-width: 560px) {
  .batch-card { padding: 10px; }
  .batch-photo, .batch-add { width: 92px; height: 92px; }
  .batch-bar > .btn-primary { width: 100%; }
  .batch-bar .msg, .batch-bar .form-error, .batch-bar .form-msg { flex-basis: 100%; }
}
.batch-photo .ph-cover { top: auto; bottom: 6px; }

/* ── Brand: the mark and "periodica.me", as tall as the mark ────────────── */
.brand { gap: 10px; text-decoration: none; }
.brand .brand-mark { height: 30px; width: auto; flex: none; }
.wordmark { font: 700 2.05rem/1 var(--sans); letter-spacing: -.6px; color: var(--ink); white-space: nowrap; transform: translateY(-1px); }
.wordmark-dot { color: var(--accent); }
@media (max-width: 560px) {
  .brand .brand-mark { height: 28px; }
  .wordmark { display: none; } /* phones: the mark alone, the bar needs the room */
}
@media (max-width: 560px) {
  .bar:not(:has(.nav-avatar)) .wordmark { display: inline; font-size: 1.3rem; letter-spacing: -.4px; } /* signed out: room for the name */
  .bar:not(:has(.nav-avatar)) .brand { gap: 7px; }
  .bar:not(:has(.nav-avatar)) .brand .brand-mark { height: 24px; }
  .nav-user .nav-link { white-space: nowrap; }
  .profile-stats { flex-wrap: wrap; gap: 14px 22px; }
  .profile-stats dd { white-space: nowrap; font-size: 1.375rem; }
}
@media (max-width: 440px) { .bar:not(:has(.nav-avatar)) .wordmark { display: none; } } /* "periodica.me" needs the room */

/* ── Table page and museum page: the table always whole on a computer ─── */
.table-head { display: grid; gap: 14px; align-items: start; justify-content: stretch; margin-bottom: 18px; }
.table-head-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.table-title { display: grid; gap: 8px; }
.table-title h1 { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.table-kicker { font: 500 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1.6px; color: var(--accent); }
.table-sub { max-width: 62ch; color: #B8B8CC; font-size: .875rem; line-height: 1.5; }
.table-about { display: grid; gap: 8px; }
/* Wide screens: the explanation beside the title, so the table still fits the first view. */
@media (min-width: 1101px) {
  .page-global .table-head { grid-template-columns: auto minmax(0, 520px); justify-content: space-between; align-items: end; gap: 12px 48px; }
  .page-global .table-about { padding-left: 20px; border-left: 2px solid rgba(255, 165, 0, .5); }
}
.table-sub b { color: var(--ink); font-weight: 600; }
.table-head-row .live-pill { margin: 0; flex: 0 1 auto; min-width: 0; }
@media (min-width: 901px) {
  /* The table is about twice as wide as it is tall: its width follows the height there is,
     so it never runs below the screen. */
  /* The title sits inside the table, so the table can take the whole first screen. */
  .page-global .ptable-wrap { width: min(100%, calc((100dvh - var(--bar-h, 69px) - 64px) * 1.95)); margin-inline: auto; }
  .page-museum { display: grid; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .museum-side { position: sticky; top: 86px; display: grid; gap: 16px; max-height: calc(100dvh - 100px); overflow: auto; scrollbar-width: thin; padding-right: 4px; }
  .museum-side .report-museum { margin: 0; }
  .museum-main .ptable-wrap { width: min(100%, calc((100dvh - 130px) * 1.95)); }
}
@media (max-width: 1100px) and (min-width: 901px) {
  .page-museum { grid-template-columns: minmax(0, 1fr); }
  .museum-side { position: static; max-height: none; }
}
/* A museum on a computer: one screen, no page scroll. The table sits whole on the right; the
   column on the left scrolls by itself if it is longer than the screen. */
@media (min-width: 1101px) {
  .page-museum { height: calc(100dvh - var(--bar-h, 69px)); padding-bottom: 20px; overflow: hidden; }
  .page-museum .museum-side { position: static; max-height: 100%; height: 100%; align-content: start; }
  .page-museum .museum-main { min-height: 0; }
  body:has(.page-museum) .foot { display: none; }
}
/* Feed: a wider column for the chat and the museums to follow. */
@media (min-width: 1061px) {
  .page-feed { grid-template-columns: minmax(0, 600px) minmax(400px, 540px); gap: 36px; }
}
.table-head-row .live-pill { max-width: min(620px, 100%); }
/* The table fills the screen: the cue sits bottom left, under Fr and Ra, where the table is empty. */
@media (min-width: 901px) {
  .scroll-cue { left: max(var(--gutter), env(safe-area-inset-left)); transform: none; }
  .scroll-cue.gone { transform: translateY(12px); }
}
@keyframes cueInLeft { from { opacity: 0; transform: translateY(12px); } }
@media (min-width: 901px) { .scroll-cue { animation-name: cueInLeft; } }

.suggest { min-width: min(360px, 90vw); max-height: 300px; overflow: auto; }
.suggest.up { top: auto; bottom: calc(100% + 6px); }
.cx-app .composer-row .suggest { max-height: 240px; }
@media (max-width: 899px) { .nav-mytable { display: none; } }
/* The @/# list of the comment box must not be cut by the post (the photo is not at the corners). */
.post { overflow: visible; }
.post-reply .composer-box { position: relative; z-index: 5; }
.table-head > .table-head-row { display: flex; }

/* $: the specimen finder. Wider than the other suggestions, with photos, scopes and a hint. */
.suggest.suggest-finder { width: min(520px, calc(100vw - 32px)); max-height: min(440px, 60dvh); padding: 0 6px 6px; }
.cx-app .composer-row .suggest.suggest-finder { max-height: min(440px, 60dvh); }
.suggest .suggest-head-row { display: block; position: sticky; top: 0; z-index: 1; min-height: 0; padding: 10px 6px 8px; margin: 0 -6px 4px; border-radius: 0; cursor: default;
  background: var(--bg2); border-bottom: 1px solid var(--stroke-soft); }
.suggest .suggest-head-row:hover { background: var(--bg2); }
.suggest-head { display: grid; gap: 8px; padding: 0 6px; }
.suggest-head p { margin: 0; font-size: .75rem; line-height: 1.4; color: var(--muted); }
.suggest-scopes { display: flex; gap: 6px; }
.suggest-scope { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--stroke); background: none; color: var(--muted); font: 500 .75rem/1 var(--mono); cursor: pointer; }
.suggest-scope[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: rgba(255, 165, 0, .1); }
.suggest-photo { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; }
.suggest-spec { display: grid; gap: 4px; min-width: 0; flex: 1; }
.suggest-spec small { display: flex; align-items: center; gap: 6px; color: var(--muted); font: 400 .75rem/1 var(--mono); }
.suggest .suggest-spec small span { margin-left: 0; font: 700 .6875rem/1 var(--mono); color: var(--ink); }
.suggest-el { display: inline-grid; place-items: center; min-width: 20px; height: 16px; padding: 0 3px; border-radius: 4px; font-weight: 700; color: var(--ink);
  background: color-mix(in srgb, var(--c) 30%, transparent); }
.suggest .suggest-id { margin-left: auto; color: var(--accent); font: 600 .75rem/1 var(--mono); }
.suggest-hash { color: var(--accent); }
.suggest .suggest-sym[style] { background: color-mix(in srgb, var(--c) 30%, transparent); }
/* #channel in a message */
.topic-ref { --c: var(--accent); display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 6px; text-decoration: none; font-weight: 600;
  color: var(--ink) !important; background: color-mix(in srgb, var(--c) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.topic-ref:hover { background: color-mix(in srgb, var(--c) 24%, transparent); }

/* ── /my: one's own specimens ─────────────────────────────────────────── */
.page-my { display: grid; gap: 18px; padding-bottom: 60px; }
.my-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.my-summary { max-width: none; font-family: var(--mono); font-size: .8125rem; }
.my-table { display: grid; gap: 8px; }
.my-elements { display: grid; grid-template-columns: repeat(18, minmax(0, 1fr)); grid-template-rows: repeat(7, auto) 8px repeat(2, auto); gap: 3px; max-width: 760px; }
.my-el { --c: #888; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 0; border-radius: 4px; cursor: pointer;
  font: 600 clamp(.5rem, 1.1vw, .75rem)/1 var(--mono); text-decoration: none;
  border: 1px dashed color-mix(in srgb, var(--c) 35%, transparent); background: none; color: var(--muted); }
.my-el:hover { border-style: solid; border-color: var(--c); color: var(--ink); }
.my-el.has { border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 32%, transparent); color: var(--ink); }
.my-el.has[aria-pressed="true"] { background: var(--c); color: #000; box-shadow: 0 0 0 2px var(--ink); }
.my-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; position: sticky; top: var(--bar-h, 69px); z-index: 5; padding: 10px 0; background: var(--bg); }
.my-search { flex: 1 1 220px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); }
.my-sort { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--stroke); background: var(--bg2); color: var(--ink); font: 500 .75rem/1 var(--mono); }
.my-list { display: grid; gap: 10px; }
.my-row { --c: var(--stroke); display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--stroke); border-left: 3px solid var(--c); background: var(--card); }
.my-row.is-todo { border-color: color-mix(in srgb, #F2C94C 30%, var(--stroke)); border-left-color: var(--c); }
.my-thumb { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; background: var(--bg2); display: grid; place-items: center; color: var(--muted); }
.my-thumb img { width: 100%; height: 100%; object-fit: cover; }
.my-nophoto { display: grid; place-items: center; width: 100%; height: 100%; border: 1px dashed #E0435A; border-radius: 8px; color: #FF8A8A; }
.my-count { position: absolute; right: 4px; bottom: 4px; padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, .7); font: 600 .6875rem/1 var(--mono); }
.my-main { display: grid; gap: 8px; min-width: 0; }
.my-top { display: flex; align-items: center; gap: 10px; }
.my-sym { display: grid; place-items: center; min-width: 44px; height: 36px; padding: 0 6px; border-radius: 8px; flex: none;
  background: color-mix(in srgb, var(--c) 30%, transparent); font: 700 .9375rem/1 var(--mono); }
.my-sym small { font-size: .5625rem; font-weight: 500; color: var(--muted); }
.my-input { width: 100%; min-width: 0; min-height: 34px; padding: 6px 10px; border-radius: 7px; border: 1px solid transparent; background: rgba(255, 255, 255, .03); color: var(--ink); font: inherit; font-size: .875rem; }
.my-input:hover { border-color: var(--stroke); }
.my-input:focus { outline: none; border-color: var(--focus); background: rgba(255, 255, 255, .05); }
select.my-input { background: var(--bg2); }
.my-top .my-input { font-weight: 600; font-size: 1rem; }
.my-fields { display: grid; grid-template-columns: 160px repeat(2, minmax(0, 1fr)) 130px; gap: 8px; align-items: end; }
.my-field { display: grid; gap: 3px; min-width: 0; }
.my-field > span { font: 500 .625rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.my-check { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; font: 500 .75rem/1 var(--mono); color: var(--muted); cursor: pointer; }
.my-check input { accent-color: var(--accent); width: 16px; height: 16px; }
.my-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.my-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.my-flag { padding: 3px 8px; border-radius: 999px; font: 500 .6875rem/1.2 var(--mono); color: #F2C94C; background: rgba(242, 201, 76, .1); }
.my-flag.bad { color: #FF8A8A; background: rgba(224, 67, 90, .12); }
.my-actions { display: flex; gap: 14px; margin-left: auto; }
.my-desc-box[hidden] { display: none; }
.my-desc { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--stroke); background: rgba(255, 255, 255, .03); color: var(--ink); font: inherit; font-size: .875rem; line-height: 1.5; resize: vertical; }
.my-mark { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.my-mark.saving { background: var(--muted); animation: pulse 1s infinite alternate; }
.my-mark.ok { background: #7FE0A6; }
.my-mark.bad { width: auto; height: auto; padding: 3px 8px; border-radius: 999px; background: rgba(224, 67, 90, .15); color: #FF8A8A; font: 500 .6875rem/1.2 var(--mono); }
.my-mark.bad::before { content: attr(title); }
.my-empty { padding: 30px 0; text-align: center; }
@keyframes pulse { to { opacity: .3; } }
@media (max-width: 760px) {
  .my-row { grid-template-columns: 64px minmax(0, 1fr); gap: 10px; }
  .my-thumb { width: 64px; height: 64px; }
  .my-fields { grid-template-columns: 1fr 1fr; }
  .my-elements { max-width: none; }
}

/* ── A museum's column: who, numbers, actions, about, goals, talk ─────── */
.museum-side { display: grid; gap: 16px; align-content: start; min-width: 0; }
.museum-side .report-museum { margin: 0; }
.side-id { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; }
.side-id-text { display: grid; gap: 6px; min-width: 0; }
.side-id h1 { font-size: 1.375rem; font-weight: 700; line-height: 1.15; letter-spacing: -.3px; overflow-wrap: anywhere; }
.side-id .profile-line { gap: 4px 14px; font-size: .75rem; }
.museum-side .profile-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 12px 10px;
  border: 1px solid var(--stroke); border-radius: 14px; background: var(--card); }
.museum-side .profile-stats .stat { display: grid; justify-items: center; text-align: center; min-width: 0; }
.museum-side .profile-stats dt { font-size: .5625rem; letter-spacing: .5px; }
.museum-side .profile-stats dd { margin-top: 6px; font-size: 1.125rem; white-space: nowrap; }
.museum-side .profile-stats small { font-size: .625rem; }
.side-actions { display: grid; gap: 8px; }
.side-row { display: flex; gap: 8px; }
.side-row > :not(.share-small) { flex: 1 1 0; min-width: 0; white-space: nowrap; justify-content: center; }
.side-row .btn { min-height: 40px; padding: 8px 12px; font-size: .75rem; }
.side-row .share-small { flex: none; }
.about-text { font-size: .875rem; color: #C8C8D8; }
.about-text.clampable { max-height: 7.6em; overflow: hidden; }
.text-dialog-part h3 { margin: 0 0 8px; font: 600 .6875rem/1 var(--mono); text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.text-dialog-part + .text-dialog-part { margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--stroke-soft); }

/* ── Scrollbars in the site's colours ─────────────────────────────────── */
html, * { scrollbar-color: #2A2A44 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2A2A44; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #3C3C60; background-clip: padding-box; }

/* ── Global table: the title in the empty space at the top of the table ── */
.ptable-inset { grid-row: 1 / 4; grid-column: 3 / 13; min-width: 0; container-type: inline-size; display: flex; align-items: center; padding: 0 3% 0 4%; }
.ptable-inset > * { display: none; }
.ptable-inset { flex-wrap: wrap; align-content: center; gap: 0; }
.ptable-inset .table-kicker, .ptable-inset h1, .ptable-inset .table-sub, .ptable-inset .table-stats { display: block; flex: 1 0 100%; }
.ptable-inset .table-kicker { font-size: clamp(.5625rem, 1.5cqw, .75rem); margin-bottom: 1.2cqw; }
.ptable-inset h1 { font-size: clamp(1.125rem, 4.4cqw, 2.75rem); line-height: 1.04; letter-spacing: -.02em; font-weight: 700; text-wrap: balance; }
.ptable-inset .table-sub { margin-top: 1.6cqw; max-width: 64ch; font-size: clamp(.6875rem, 1.75cqw, .9375rem); line-height: 1.45; }
.ptable-inset .table-stats { display: flex; gap: 0 5cqw; margin: 2.2cqw 0 0; }
@container (max-width: 520px) { .ptable-inset .table-sub { display: none; } }
.table-stats { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 4px 0 0; }
.table-stats div { display: flex; align-items: baseline; gap: 7px; }
.table-stats dd { order: -1; margin: 0; font: 600 clamp(1.125rem, 3.4cqw, 1.875rem)/1 var(--mono); color: var(--ink); }
.table-stats dd small { font-size: .55em; color: var(--muted); }
.table-stats dt { font: 400 .75rem/1 var(--mono); color: var(--muted); }
@media (max-width: 900px) { .ptable-inset { display: none; } }
@media (min-width: 901px) { .table-head-narrow { display: none; } }

/* ── Just added: photos first ─────────────────────────────────────────── */
.added-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.added-card { --c: var(--stroke); position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 12px; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: var(--bg2); }
.added-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s cubic-bezier(.2, .8, .3, 1); }
.added-sym { display: grid; place-items: center; height: 100%; font: 800 2rem/1 var(--sans); color: color-mix(in srgb, var(--c) 60%, transparent); }
.added-text { position: absolute; inset: auto 0 0; display: grid; gap: 4px; padding: 26px 9px 8px;
  background: linear-gradient(transparent, rgba(3, 3, 10, .92)); }
.added-text b { font-size: .8125rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.added-text small { font: 400 .625rem/1.2 var(--mono); color: #B8B8CC; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) {
  .added-card:hover { border-color: var(--c); }
  .added-card:hover img { transform: scale(1.06); }
}
@media (max-width: 560px) { .added-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── Specimen viewer: the photo itself, blurred, fills the space around it ── */
.viewer-stage::before { content: ''; position: absolute; inset: -60px; background: var(--ambient, none) center / cover no-repeat;
  filter: blur(48px) saturate(1.25) brightness(.42); opacity: .9; pointer-events: none; transition: background-image .3s; }

/* ── A museum's chats, with a glimpse of what is in them ──────────────── */
.talk-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--stroke); border-radius: 14px; background: var(--card); color: var(--ink); text-decoration: none; }
.talk-card:hover, .talk-card:focus-visible { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.talk-card.has-new { border-color: color-mix(in srgb, var(--accent) 45%, var(--stroke)); }
.talk-card-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.talk-card-head b { font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.talk-card-head > .icon { margin-left: auto; flex: none; color: var(--muted); }
.talk-count { font: 400 .6875rem/1 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-new { flex: none; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #000; font: 700 .625rem/1 var(--mono); }
.talk-empty { font-size: .8125rem; line-height: 1.4; color: var(--muted); }
.talk-msgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.talk-msg { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; }
.talk-msg-dot { width: 22px; height: 22px; border-radius: 50%; background: var(--stroke); }
.talk-msg-text { display: grid; gap: 2px; min-width: 0; }
.talk-msg-head { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.talk-msg-head b { font-size: .75rem; font-weight: 600; white-space: nowrap; }
.talk-msg-head small { font: 400 .625rem/1 var(--mono); color: var(--muted); white-space: nowrap; }
.talk-msg-head .talk-msg-on { overflow: hidden; text-overflow: ellipsis; }
.talk-msg-body { font-size: .8125rem; line-height: 1.35; color: #C8C8D8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }

/* ── Followers and following ─────────────────────────────────────────── */
.museum-side .profile-stats .stat-link { cursor: pointer; }
.museum-side .profile-stats .stat-link dd { text-decoration: underline; text-decoration-color: var(--stroke); text-underline-offset: 4px; }
.museum-side .profile-stats .stat-link:hover dd { text-decoration-color: var(--accent); }
.people-dialog { width: min(520px, calc(100vw - 32px)); }
.people-dialog .goals-dialog-head > div { display: grid; gap: 12px; }
.people-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: min(60dvh, 520px); overflow: auto; }
.people-list li { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 10px; }
.people-list li:hover { background: rgba(255, 255, 255, .04); }
.people-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.people-who > span { display: grid; gap: 3px; min-width: 0; }
.people-who b { font-weight: 600; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-who small { font: 400 .75rem/1 var(--mono); color: var(--muted); }
.people-who:hover b { color: var(--accent); }
.people-empty { padding: 12px 0; }

/* ── Feed: one post, one screen; the page stops on each post ──────────── */
html:has(.page-feed) { scroll-snap-type: y mandatory; scroll-padding-top: calc(var(--bar-h, 69px) + 12px); }
.page-feed .feed-head, .page-feed ~ .foot, .feed-more { scroll-snap-align: start; }
.post { display: flex; flex-direction: column; scroll-snap-align: start; scroll-snap-stop: always;
  height: calc(100svh - var(--bar-h, 69px) - 24px); min-height: 460px; max-height: 1100px; }
.post > * { flex: none; }
.post .post-media { flex: 1 1 auto; min-height: 0; }
.post-photos { height: 100%; }
.post-photo { position: relative; aspect-ratio: auto; height: 100%; overflow: hidden; }
.post-photo::before { content: ''; position: absolute; inset: -40px; background: var(--ambient, none) center / cover no-repeat;
  filter: blur(36px) saturate(1.2) brightness(.45); }
.post-photo img { position: relative; object-fit: contain; }
.post-actions { padding: 10px 14px 2px; }
.post-text { gap: 6px; padding: 6px 16px 12px; }
.post-text h2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-desc { font-size: .875rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-comments li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-comments li:nth-child(n+3) { display: none; }
@media (max-width: 560px) {
  html:has(.page-feed) { scroll-padding-top: var(--bar-h, 69px); }
  .post { height: calc(100svh - var(--bar-h, 69px)); }
}

/* Staff flair on a profile. */
.flair { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; font: 700 .625rem/1 var(--mono);
  text-transform: uppercase; letter-spacing: .8px; }
.flair-admin { color: #000; background: var(--accent); }
.flair-moderator { color: #9FD0FF; border: 1px solid rgba(130, 180, 255, .5); background: rgba(130, 180, 255, .1); }

/* A museum's column with little height: chats with their last message only, then the text behind a button. */
.side-tight .talk-msg:not(:last-child), .side-tight .talk-empty { display: none; }
.side-tight .talk-card { gap: 8px; padding: 10px 12px; }
.side-tight { gap: 12px !important; }
.side-tight .goals-next { display: none; }
.side-tight .goals-card { gap: 8px; padding: 12px 14px; }
.side-tightest .about-text { display: none; }

/* A specimen's mentions elsewhere, under its discussion. */
.mentions { display: grid; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--stroke-soft); }
.mention-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.mention { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start; }
.mention-main { display: grid; gap: 4px; min-width: 0; }
.mention-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 0; font-size: .8125rem; }
.mention-head a { text-decoration: none; }
.mention-head small { font: 400 .6875rem/1 var(--mono); color: var(--muted); }
.mention-where { font: 400 .6875rem/1.2 var(--mono); color: var(--muted); }
.mention-where:hover { color: var(--accent); }
.mention-body { font-size: .875rem; line-height: 1.5; color: #C8C8D8; overflow-wrap: anywhere; }
.mention-body p { margin: 0; }

/* ── Table: the element under the mouse shows a card beside it ────────── */
.ptable-wrap { position: relative; }
@media (hover: hover) {
  .ptable.peeking .tile:hover, .ptable.peeking .tile:focus-visible {
    transform: translateY(-2px); z-index: 5; border-color: var(--c);
    box-shadow: 0 0 0 1px var(--c), 0 10px 26px rgba(0, 0, 0, .7), 0 0 22px color-mix(in srgb, var(--c) 28%, transparent);
  }
  .ptable.peeking .tile:hover .tile-cover { transform: scale(1.06); }
}
.tile-peek { --c: #888; position: absolute; left: 0; top: 0; z-index: 20; width: 264px; pointer-events: none;
  display: grid; overflow: hidden; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--c) 55%, var(--stroke));
  background: #0A0A18; box-shadow: 0 24px 60px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .03);
  opacity: 0; translate: -6px 0; transition: opacity .16s ease, translate .2s cubic-bezier(.2, .8, .3, 1); }
.tile-peek.from-left { translate: 6px 0; }
.tile-peek.on { opacity: 1; translate: 0 0; }
.tile-peek[hidden] { display: none; }
.peek-photo { position: relative; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--c) 10%, #05050E); display: grid; place-items: center; overflow: hidden; }
.peek-photo img { width: 100%; height: 100%; object-fit: cover; }
.peek-photo::after { content: ''; position: absolute; inset: auto 0 0; height: 40%; background: linear-gradient(transparent, #0A0A18); }
.peek-big-sym { font: 800 4.5rem/1 var(--sans); color: color-mix(in srgb, var(--c) 55%, transparent); }
.peek-body { position: relative; display: grid; gap: 8px; padding: 0 16px 14px; margin-top: -26px; }
.peek-head { display: flex; align-items: center; gap: 12px; }
.peek-sym { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 11px;
  background: color-mix(in srgb, var(--c) 30%, #0A0A18); border: 1px solid var(--c); font: 700 1.25rem/1 var(--mono); }
.peek-names { display: grid; gap: 3px; min-width: 0; }
.peek-names b { font-size: 1.0625rem; font-weight: 700; }
.peek-names small { font: 400 .6875rem/1.2 var(--mono); color: var(--muted); }
.peek-count { margin: 0; font: 400 .75rem/1.2 var(--mono); color: #B8B8CC; }
.peek-count b { font-size: 1rem; color: var(--ink); }
.peek-best { display: grid; gap: 2px; margin: 0; padding-top: 8px; border-top: 1px solid var(--stroke-soft); }
.peek-best span { font-size: .875rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.peek-best small { font: 400 .625rem/1.2 var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.peek-best small + span + small { text-transform: none; letter-spacing: 0; }
.peek-talk { display: flex; align-items: center; gap: 6px; margin: 0; font: 500 .75rem/1 var(--mono); color: var(--accent); }

/* A speech bubble on tiles with comments. */
.tile-talk { position: absolute; z-index: 2; top: 6%; right: 6%; display: inline-flex; align-items: center; gap: 2px;
  padding: 2px 4px; border-radius: 5px; background: rgba(3, 3, 10, .78); color: var(--accent);
  font: 700 clamp(.4375rem, 12cqw, .625rem)/1 var(--mono); }
.tile-talk .icon { width: 1.1em; height: 1.1em; }

/* ── Museum column: folds into a strip ─────────────────────────────────── */
/* Animated: the column's width (two plain lengths, so the browser can tween them; the table
   follows, frame by frame), the content fading out while keeping its width (nothing reflows
   while it shrinks), the picture getting smaller and the button gliding to the middle. */
.side-toggle { display: none; }
@media (min-width: 1101px) {
  .page-museum { grid-template-columns: 320px minmax(0, 1fr); transition: grid-template-columns .38s cubic-bezier(.65, 0, .25, 1); }
  .page-museum.side-folded { grid-template-columns: 56px minmax(0, 1fr); }
  .page-museum .museum-side { position: relative; top: auto; transition: padding .38s cubic-bezier(.65, 0, .25, 1); }
  .page-museum .museum-side > :not(.side-toggle):not(dialog) { width: 316px; transition: opacity .2s ease .12s, visibility 0s; }
  .side-toggle { display: grid; place-items: center; position: absolute; top: 0; right: 4px; z-index: 3; width: 30px; height: 30px; padding: 0;
    border-radius: 9px; border: 1px solid var(--stroke); background: var(--bg2); color: var(--muted); cursor: pointer;
    transition: right .38s cubic-bezier(.65, 0, .25, 1), color .15s, border-color .15s; }
  .side-toggle:hover { color: var(--ink); border-color: rgba(255, 255, 255, .35); }
  .side-toggle .icon { transition: transform .38s cubic-bezier(.65, 0, .25, 1); }
  .side-id { padding-right: 34px; transition: padding .38s cubic-bezier(.65, 0, .25, 1); }
  .side-id > .avatar { transition: width .38s cubic-bezier(.65, 0, .25, 1), height .38s cubic-bezier(.65, 0, .25, 1), margin .38s cubic-bezier(.65, 0, .25, 1); }
  .side-id-text { transition: opacity .2s ease .12s; }

  .side-folded .museum-side { overflow: hidden; padding-right: 0; }
  .side-folded .side-toggle { right: 13px; }
  .side-folded .side-id { padding: 44px 0 0; }
  .side-folded .side-id > .avatar { width: 44px; height: 44px; margin-left: 6px; }
  .side-folded .side-id-text,
  .side-folded .museum-side > :not(.side-toggle):not(.side-id):not(dialog) {
    opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s ease, visibility 0s linear .12s; }
}
@media (min-width: 1101px) { .side-folded .side-toggle .icon { transform: rotate(180deg); } }
