/* Everamble Community — the game's materials and tokens (ui-system/tokens.json) on the web.
   1u follows the design system: clamp(13px, 9px + 0.009 * short side, 22px); 1em = 1u on body. */
@font-face { font-family: "Signika"; src: url(ui/fonts/Signika.ttf) format("truetype"); font-weight: 300 700; font-display: swap; }

:root {
  --u: clamp(15px, calc(9px + 0.9vmin), 19px);
  /* The shared tokens of ui/chrome.css (infra/website/site/chrome.css) under the names of this sheet. */
  --c-ink: var(--ev-ink); --c-ink-soft: var(--ev-ink-soft); --c-chrome: var(--ev-chrome); --c-chrome-soft: var(--ev-chrome-soft);
  --c-paper: #F1E0BB; --c-wood: var(--ev-wood); --c-wood-dark: var(--ev-wood-dark); --c-wood-line: var(--ev-wood-line);
  --c-gold: var(--ev-gold); --c-gold-deep: var(--ev-gold-deep); --c-focus: var(--ev-focus); --c-ok: #3E7F1F;
  --c-info: var(--ev-info); --c-danger: var(--ev-danger); --c-parch-ground: #F2DDB0;
  --c-dark-ground: #29190E; --c-board-ground: #492C18; --c-scrim: rgba(10, 6, 2, .62);
  --c-ground: var(--ev-paper);
  --touch: var(--ev-touch); --gap: .9em; --radius: .35em;
  --font-ui: var(--ev-font);
}

* { box-sizing: border-box; }
/* Ground, font and colour of the page: ui/chrome.css. */
body { font-size: var(--u); line-height: 1.4; }
img { display: block; max-width: 100%; }
a { color: #6B3A12; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { border-radius: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- materials (9-slice, tokens.material) ---------- */
.m-board { border: 1.15em solid transparent; border-image: url(ui/materials/board.webp) 36 fill / 1.15em round; filter: drop-shadow(0 .4em .6em rgba(0, 0, 0, .55)); }
.m-panel { border: .55em solid transparent; border-image: url(ui/materials/panel-parch.png) 18 fill / .55em round; }
.m-dark { border: .45em solid transparent; border-image: url(ui/materials/dark.png) 16 fill / .45em round; color: var(--c-chrome); }
.sheet { position: relative; isolation: isolate; padding: 1.6em 1.7em 1.7em; min-width: 0; }
.sheet::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 2.4em solid transparent;
  border-image: url(ui/materials/parchment.webp) 74 fill / 2.4em round;
  background: linear-gradient(#EFE0BF, #EFE0BF) center / calc(100% - 2.2em) calc(100% - 2.2em) no-repeat border-box;
  filter: drop-shadow(0 .35em .5em rgba(0, 0, 0, .5));
}

/* ---------- type (tokens.type) ---------- */
.t-heading { display: flex; align-items: center; justify-content: center; gap: .5em; margin: 0 0 .9em; font-weight: 600; font-size: 1.05em; line-height: 1; letter-spacing: .06em; text-transform: uppercase; }
.t-heading .fl { width: 2.6em; height: auto; flex: none; opacity: .8; }
.t-heading .fl.r { transform: scaleX(-1); }
h1.t-heading { font-size: 1.25em; }
.t-label { display: block; margin: 0; font-weight: 600; font-size: .82em; line-height: 1.1; letter-spacing: .05em; text-transform: uppercase; color: var(--c-ink-soft); }
.t-caption { font-weight: 600; font-size: .74em; letter-spacing: .05em; text-transform: uppercase; color: var(--c-ink-soft); }
.t-body { color: var(--c-ink-soft); }
.center { text-align: center; justify-content: center; }

/* ---------- buttons (tab / tab-gold / btn-wood / btn-red) ---------- */
/* Buttons (tab, gold tab): ui/chrome.css; the portal adds wood, danger, small and wide. */
.btn { white-space: nowrap; }
.btn.wood { color: #FFF3DC; text-shadow: 0 1px 1px #000; border-image-source: url(ui/materials/btn-wood.png); }
.btn.danger { color: #fff; text-shadow: 0 1px 1px #000; border-image-source: url(ui/materials/btn-red.png); }
.btn[disabled] { opacity: .55; filter: grayscale(.6); cursor: default; }
.btn.sm { min-height: max(2.3em, 36px); padding: 0 .8em; font-size: .82em; }
/* Touch: every target at least 44 px. */
@media (pointer: coarse) { .btn.sm, .chip { min-height: var(--touch); min-width: var(--touch); justify-content: center; } }
.btn.wide { width: 100%; }
.btn .ic { width: 1.2em; height: 1.2em; }
.link { background: none; border: 0; padding: .3em 0; color: #6B3A12; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; min-height: 32px; }
.link.danger { color: var(--c-danger); }
.round { display: grid; place-items: center; width: var(--touch); height: var(--touch); border: 0; border-radius: 50%; background: url(ui/materials/btn-round.png) center / 100% 100% no-repeat; filter: drop-shadow(0 .2em .25em rgba(0, 0, 0, .5)); }
.round img { width: 52%; }
.seg { display: inline-flex; gap: .35em; flex-wrap: wrap; }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: .4em; margin: 0 0 1.05em; }
.hint { font-size: .8em; color: var(--c-ink-soft); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; width: 1.1em; height: 1.1em; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 2l8 8M10 2l-8 8' stroke='%237A4A26' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  width: 100%; min-height: var(--touch); padding: .55em .75em; border-radius: var(--radius);
  border: 2px solid #9C7A4E; background: #FBF2DC; color: var(--c-ink); box-shadow: inset 0 .12em .25em rgba(80, 50, 20, .22);
}
textarea { resize: none; line-height: 1.45; field-sizing: content; min-height: 6em; max-height: 60vh; }
select { appearance: none; padding-right: 2.2em; background: #FBF2DC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2355402A' stroke-width='2'/%3E%3C/svg%3E") right .8em center no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--c-gold-deep); box-shadow: 0 0 0 3px rgba(255, 194, 31, .45), inset 0 .12em .25em rgba(80, 50, 20, .2); }
.check { display: flex; align-items: center; gap: .6em; min-height: var(--touch); font-weight: 600; font-size: .9em; cursor: pointer; }
.check input { appearance: none; flex: none; width: 1.7em; height: 1.7em; margin: 0; background: url(ui/materials/checkbox.png) center / 100% 100% no-repeat; position: relative; }
.check input:checked::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--c-ok); font-size: 1.15em; }
.form-error { margin: 0 0 1em; padding: .6em .8em; border-radius: var(--radius); background: rgba(180, 54, 47, .12); color: #8A231D; font-weight: 600; }

/* ---------- header ---------- */
/* The strip around the sticky board is page ground, so scrolled content never shows above or beside it. */
#top { position: sticky; top: 0; z-index: 20; padding: .55em max(.6em, env(safe-area-inset-left)) .3em; background: linear-gradient(var(--c-ground) calc(100% - .3em), transparent); }
/* The website's bar (ui/chrome.css) scrolls away here; the portal's own board above stays. */
.site-bar { position: relative !important; }
#view { flex: 1; }
#view:focus { outline: none; }
/* The portal's own row under the website's bar: a light parchment strip, not a second header. */
.bar {
  display: flex; align-items: center; gap: 1em; max-width: 78em; margin: 0 auto; padding: .35em .6em;
  border-radius: 14px; background: rgba(255, 250, 238, .8); box-shadow: 0 0 0 1px rgba(122, 74, 38, .2), 0 4px 10px rgba(60, 32, 10, .12);
}
.brand { display: flex; align-items: center; gap: .6em; min-height: var(--touch); text-decoration: none; min-width: 0; }
.logo { height: 2.6em; width: auto; filter: drop-shadow(0 .1em .15em rgba(0, 0, 0, .6)); }
/* The game's logo is in the website's bar above; the board names the portal. */
.brand-ic { width: 2em; height: 2em; image-rendering: pixelated; }
.brand-sub { color: var(--c-wood-dark); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: 1.05em; }
.nav { display: flex; gap: .5em; margin-left: auto; }
/* Current page: pressed wood with a gold edge (gold fill stays for the primary action). */
.nav .btn.wood[aria-current="page"] { color: var(--c-gold); transform: translateY(.1em); box-shadow: inset 0 -.28em 0 var(--c-gold-deep), 0 0 0 2px rgba(247, 214, 138, .75); filter: drop-shadow(0 0 .35em rgba(255, 200, 90, .7)); }
.plus { font-size: 1.35em; line-height: 0; font-weight: 700; }
.who { position: relative; }
.avatar { padding: 0; border: 0; background: none; filter: drop-shadow(0 .2em .25em rgba(0, 0, 0, .55)); }
.portrait { display: inline-grid; place-items: center; flex: none; width: 2.2em; aspect-ratio: 1; font-weight: 700; color: var(--c-ink); line-height: 1;
  background: url(ui/art/portrait-neutral.webp) center / 100% 100% no-repeat, radial-gradient(circle, #F3DFB2 0 52%, transparent 53%); }
.avatar-img { width: 3.1em; font-size: 1.1em; }
.member-avatar { width: 2.8em; }
.menu { position: absolute; right: 0; top: calc(100% + .5em); min-width: 15em; display: flex; flex-direction: column; gap: .3em; padding: .6em; filter: drop-shadow(0 .4em .6em rgba(0, 0, 0, .6)); }
.menu-who { display: flex; flex-direction: column; padding: .3em .4em .6em; border-bottom: 1px solid rgba(255, 246, 226, .18); margin-bottom: .2em; }
.menu-who span { font-size: .8em; color: var(--c-chrome-soft); overflow-wrap: anywhere; }
.menu-item { display: flex; align-items: center; gap: .6em; min-height: var(--touch); padding: 0 .5em; border: 0; border-radius: var(--radius); background: none; color: var(--c-chrome); text-decoration: none; font-weight: 600; text-align: left; }
.menu-item:hover { background: rgba(255, 214, 120, .14); }
.menu-item .ic { width: 1.3em; height: 1.3em; }
.menu .lang { padding: .3em .2em; }

/* ---------- auth ---------- */
.auth { display: grid; place-items: safe center; padding: 2.4em 1em 3em; }
.auth-card { width: min(27em, 100%); }
.auth-sheet { padding-top: 2em; }
.auth-sheet .t-body { margin: -.2em 0 1.4em; }
.switch { text-align: center; margin: 1em 0 .6em; font-size: .92em; }
.auth-sheet .lang { display: flex; justify-content: center; margin-top: 1.4em; padding-top: 1em; border-top: 1px dashed rgba(122, 74, 38, .35); }
.auth-sheet .t-body { text-wrap: balance; }
.pending-emote { width: 6em; margin: 0 auto .6em; image-rendering: pixelated; }

/* ---------- layout ---------- */
#view { padding: 1.1em max(.8em, env(safe-area-inset-left)) 3em; }
.list-page, .detail-page { max-width: 78em; margin: 0 auto; display: grid; gap: 1.4em; align-items: start; }
.list-page { grid-template-columns: 17em minmax(0, 1fr); }
.detail-page { grid-template-columns: minmax(0, 1fr) 19em; }
.narrow { max-width: 46em; margin: 0 auto; }
.side { position: sticky; top: 5.6em; }

/* ---------- list ---------- */
.toolbar { display: flex; gap: .6em; align-items: center; margin-bottom: .75em; }
.search { flex: 1; position: relative; }
.search input { padding-left: 2.4em; border-color: #6E4A26; background-color: #FBF2DC; }
/* Magnifier in the ink of the parchment UI (pixel steps, no type icon). */
.search::before { content: ""; position: absolute; left: .8em; top: 50%; width: 1.15em; height: 1.15em; transform: translateY(-50%); z-index: 1;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%2355402A' d='M5 1h4v1h2v1h1v2h1v4h-1v2h-1v1H9v1H5v-1H3v-1H2V9H1V5h1V3h1V2h2zm0 2v1H4v1H3v4h1v1h1v1h4v-1h1V9h1V5h-1V4H9V3z'/%3E%3Cpath fill='%2355402A' d='M11 11h2v1h1v1h1v2h-2v-1h-1v-1h-1z'/%3E%3C/svg%3E") center / contain no-repeat; }
.filter-toggle { display: none; }
.chips { display: flex; gap: .45em; flex-wrap: wrap; margin-bottom: .8em; }
.chip {
  display: inline-flex; align-items: center; gap: .4em; min-height: 38px; padding: 0 .85em; border-radius: 999px;
  border: 2px solid rgba(122, 74, 38, .35); background: rgba(255, 250, 238, .7); color: var(--c-ink); font-weight: 600; font-size: .86em;
}
.chip-ic { width: 1.25em; height: 1.25em; image-rendering: pixelated; }
.chip[aria-pressed="true"] { background: linear-gradient(#FBE3A2, #E9B44E); color: var(--c-ink); border-color: #FFE7A8; box-shadow: 0 0 .7em rgba(255, 196, 80, .55); }
.count-line { color: var(--c-ink-soft); margin: 0 0 .6em .2em; }
.cards { display: flex; flex-direction: column; gap: .7em; }
.card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 4.2em; gap: .9em; align-items: center; padding: .55em .7em; transition: transform .12s ease; filter: drop-shadow(0 .25em .35em rgba(0, 0, 0, .45)); }
.card:hover { transform: translateY(-1px); }
.card.is-merged { opacity: .72; }
.card > .card-kind { grid-column: 1; grid-row: 1 / span 2; }
.card > .card-body { grid-column: 2; }
.card > .card-thumb { grid-column: 3; grid-row: 1; }
.card > .vote { grid-column: 4; grid-row: 1; justify-self: end; }
.card-thumb { margin-right: .4em; }
.card-kind { width: 3.1em; height: 3.1em; display: grid; place-items: center; background: url(ui/materials/btn-round.png) center / 100% 100% no-repeat; }
.kind-ic { width: 58%; image-rendering: pixelated; }
.card-body { min-width: 0; }
.card-badges { display: flex; gap: .35em; flex-wrap: wrap; align-items: center; margin-bottom: .3em; }
.card-title { margin: 0; font-size: 1.06em; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.card-title a { color: var(--c-ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
@media (hover: hover) and (pointer: fine) { .card-title a:hover { text-decoration: underline; text-underline-offset: .15em; } }
.card-title a:focus { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.card-excerpt { margin: .2em 0 0; color: var(--c-ink-soft); font-size: .9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-meta { display: flex; gap: .3em .85em; flex-wrap: wrap; align-items: center; margin-top: .4em; font-size: .8em; color: var(--c-ink-soft); font-weight: 600; }
.num { font-variant-numeric: tabular-nums; color: #8A6A44; }
.meta-count, .from { display: inline-flex; align-items: center; gap: .3em; }
.meta-ic { width: 1.15em; height: 1.15em; opacity: .85; }
.card-thumb { width: 5.6em; height: 4.2em; border-radius: var(--radius); overflow: hidden; border: 2px solid #8A6A44; box-shadow: 0 .1em .25em rgba(0, 0, 0, .35); position: relative; z-index: 1; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb.is-video::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.9em; height: 1.9em; transform: translate(-50%, -50%);
  border-radius: 50%; background: #F6E7C1 url(ui/glyphs/play.png) 58% 50% / 55% no-repeat; box-shadow: 0 0 0 2px rgba(36, 19, 10, .85), 0 .1em .3em rgba(0, 0, 0, .5); }
.empty { display: grid; justify-items: center; gap: .6em; padding: 3em 1em; color: var(--c-ink-soft); text-align: center; }
.empty-ic { width: 4em; image-rendering: pixelated; opacity: .9; }
.list-main > .btn.wide { margin-top: 1em; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .12em .55em; border-radius: 999px; font-size: .72em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; line-height: 1.5; }
.badge-ic { width: 1.2em; height: 1.2em; image-rendering: pixelated; }
.badge.game { background: #3D220E; color: var(--c-gold); border: 1px solid #6B4423; }
.badge.crash { background: #8A231D; color: #FFF1E0; border: 1px solid #5C1410; }
.badge.kind { background: rgba(122, 74, 38, .12); color: var(--c-ink-soft); border: 1px solid rgba(122, 74, 38, .3); }
/* Status colours, once: badges (.status-x) and the admin's status chips ([data-status]) read the same tokens. */
.status-new, [data-status="new"] { --st-bg: #EAD8B4; --st-fg: #55402A; --st-line: #B99668; --st-dot: #B99668; }
.status-planned, [data-status="planned"] { --st-bg: #F3D7A6; --st-fg: #7A3E00; --st-line: #D9902F; --st-dot: #D9902F; }
.status-in_progress, [data-status="in_progress"] { --st-bg: #D6E4EF; --st-fg: #1F5583; --st-line: #8FB2CF; --st-dot: #4F86B8; }
.status-done, [data-status="done"] { --st-bg: #DCEDCB; --st-fg: #2F6216; --st-line: #A8CF86; --st-dot: #5E9E2E; }
.status-wont_do, [data-status="wont_do"] { --st-bg: #EBD3CC; --st-fg: #8A231D; --st-line: #C99286; --st-dot: #C0584F; }
.status-merged, [data-status="merged"] { --st-bg: #E3DDD3; --st-fg: #5E554A; --st-line: #C2B8A8; --st-dot: #C2B8A8; }
.badge.status { background: var(--st-bg); color: var(--st-fg); border: 1px solid var(--st-line); }
.ribbon { display: inline-flex; align-items: center; gap: .3em; padding: .14em .6em; border-radius: .25em; font-size: .72em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #3D2208; background: linear-gradient(#FFE59B, #F2B640); box-shadow: 0 0 .55em rgba(255, 190, 60, .7); }
.ribbon::before { content: ""; width: 1.05em; height: 1.05em; background: url(ui/quest/sparkle.png) center / contain no-repeat; image-rendering: pixelated; }
.ribbon.soft { background: #F6E7C3; box-shadow: none; border: 1px solid #E2B654; }

/* votes */
.vote { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .4em; min-height: var(--touch); padding: 0 1em; border: .45em solid transparent; border-image: url(ui/materials/tab.png) 16 fill / .45em round; background: none; font-weight: 700; filter: drop-shadow(0 .15em .2em rgba(0, 0, 0, .4)); }
.vote.on { border-image-source: url(ui/materials/tab-gold.png); filter: drop-shadow(0 0 .35em rgba(255, 200, 90, .85)); }
.vote.compact { flex-direction: column; gap: 0; min-width: 3.3em; padding: .2em .35em; line-height: 1.05; }
.vote-arrow { color: #8A5A22; font-size: .85em; }
.vote.on .vote-arrow { color: #7A3E00; }
.vote-n { font-variant-numeric: tabular-nums; font-size: 1.05em; }
.vote-label { display: inline-flex; align-items: center; gap: .3em; text-transform: uppercase; font-size: .82em; letter-spacing: .04em; }
.vote-check { width: 1.1em; height: 1.1em; filter: sepia(1) saturate(2.2) hue-rotate(-12deg) brightness(.75); }
.vote[disabled] { opacity: .5; cursor: default; }

/* ---------- entry form ---------- */
.kind-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5em; }
.kind-opt { display: flex; flex-direction: column; align-items: center; gap: .35em; padding: .65em .3em .55em; min-height: var(--touch); border: .45em solid transparent; border-image: url(ui/materials/tab.png) 16 fill / .45em round; background: none; font-weight: 600; font-size: .85em; text-align: center; filter: drop-shadow(0 .15em .2em rgba(0, 0, 0, .35)); }
.kind-opt[aria-checked="true"] { border-image-source: url(ui/materials/tab-gold.png); filter: drop-shadow(0 0 .35em rgba(255, 200, 90, .9)); }
.kind-opt-ic { width: 2em; height: 2em; image-rendering: pixelated; }
.picker { display: flex; flex-direction: column; gap: .6em; align-items: flex-start; }
.attach { cursor: pointer; }
.picks { display: flex; gap: .55em; flex-wrap: wrap; }
.pick { position: relative; width: 7em; border-radius: var(--radius); overflow: hidden; border: 2px solid #8A6A44; background: #2A1A0E; }
.pick img, .pick video { width: 100%; height: 5em; object-fit: cover; }
.pick-name { display: block; padding: .2em .4em; font-size: .7em; color: var(--c-chrome); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-x { position: absolute; top: .2em; right: .2em; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(36, 19, 10, .8); color: #fff; font-size: 1.1em; line-height: 1; }
.progress { position: relative; height: 1.6em; margin: 0 0 1em; border: .28em solid transparent; border-image: url(ui/materials/bar-frame.png) 18 / .28em stretch; background: #1E1A17 padding-box; }
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#FFE08A, #E9AE3F); transition: width .2s; }
.progress-text { position: relative; display: block; text-align: center; font-size: .72em; font-weight: 700; line-height: 1.6em; color: #fff; text-shadow: 0 1px 2px #000; }

/* ---------- detail ---------- */
.entry-head { display: flex; justify-content: space-between; align-items: center; gap: .8em; flex-wrap: wrap; margin-bottom: 1em; }
.back .ic { width: 1em; height: 1em; }
.entry-title { margin: 0 0 .35em; font-size: 1.5em; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
.entry-meta { display: flex; gap: .3em 1em; flex-wrap: wrap; align-items: center; font-size: .85em; font-weight: 600; color: var(--c-ink-soft); margin-bottom: 1em; }
.notice { display: flex; align-items: flex-start; gap: .7em; margin: 0 0 1em; padding: .45em .7em; color: var(--c-ink); text-decoration: none; }
.notice p { margin: .15em 0 0; color: var(--c-ink-soft); overflow-wrap: anywhere; }
.notice-ic { flex: none; width: 2em; image-rendering: pixelated; }

.md { line-height: 1.55; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md pre, .md code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: rgba(122, 74, 38, .1); border-radius: .25em; }
.md code { padding: .05em .3em; }
.md pre { padding: .7em .9em; overflow-x: auto; }
.md blockquote { margin: .6em 0; padding: .2em 0 .2em .9em; border-left: 3px solid #C9A46A; color: var(--c-ink-soft); }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .7em; margin: 1.2em 0; }
.media-item { margin: 0; display: flex; flex-direction: column; gap: .3em; }
.media-item.wide { grid-column: 1 / -1; }
.media-img { padding: 0; border: 2px solid #8A6A44; border-radius: var(--radius); overflow: hidden; background: #2A1A0E; box-shadow: 0 .15em .35em rgba(0, 0, 0, .35); }
.media-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .2s; }
.media-img:hover img { transform: scale(1.03); }
.media video { width: 100%; max-height: 70vh; border-radius: var(--radius); background: #24130A; border: 2px solid #8A6A44; }
.voice-note { display: flex; gap: .75em; align-items: flex-start; margin: 1.2em 0; padding: .8em 1em; border-radius: var(--radius);
  background: rgba(247, 214, 138, .28); border: 1px solid #D9B676; border-left: 4px solid var(--c-gold-deep); }
.voice-note.is-pending { background: rgba(201, 164, 106, .2); border-color: #BFA071; border-left-color: #8A6A44; }
.voice-note.is-failed { background: rgba(180, 54, 47, .08); border-color: #D9A89A; border-left-color: var(--c-danger); }
.voice-note.is-pending .t-label, .voice-note.is-failed .t-label { text-transform: none; letter-spacing: 0; font-size: 1em; color: var(--c-ink); }
.voice-note.is-failed .t-label { color: #8A231D; }
.voice-ic { flex: none; width: 1.6em; margin-top: -.15em; }
.voice-note.is-pending .voice-ic { animation: voice-pulse 1.6s ease-in-out infinite; }
.voice-note.is-failed .voice-ic { opacity: .55; filter: sepia(1) saturate(4) hue-rotate(-30deg); }
@keyframes voice-pulse { 50% { opacity: .35; transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .voice-note.is-pending .voice-ic { animation: none; opacity: .6; } }
.voice-body { min-width: 0; }
.voice-hint { margin: .25em 0 0; font-size: .86em; color: var(--c-ink-soft); }
.voice-note + .media { margin-top: 1.5em; }
.voice-text { max-width: 75ch; margin: .35em 0 0; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.voice-text.is-empty { font-style: italic; color: var(--c-ink-soft); }
.media-from { font-size: .72em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #8A6A44; }
.diag { margin: 1.2em 0; padding: .4em .8em; }
.diag > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .2em .8em; align-items: baseline; min-height: var(--touch); padding: .6em 0; list-style: none; }
.diag > summary { align-items: center; }
.diag > summary::before { content: ""; align-self: center; border: .38em solid transparent; border-left: .55em solid var(--c-gold); border-right: 0; transition: transform .15s; }
.diag[open] > summary::before { transform: rotate(90deg); }
.diag > summary::-webkit-details-marker { display: none; }
.diag-title { font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--c-gold); }
.diag-hint { font-size: .86em; color: #F3E6CC; }
.kvs { display: grid; grid-template-columns: repeat(auto-fill, minmax(11em, 1fr)); gap: .5em 1em; margin: .2em 0 .8em; }
.kv dt { font-size: .72em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.diag-block { border-top: 1px solid rgba(255, 246, 226, .15); }
.diag-block summary { cursor: pointer; display: flex; align-items: center; gap: .6em; padding: .55em 0; min-height: var(--touch); font-weight: 600; list-style: none; }
.diag-block summary::-webkit-details-marker { display: none; }
.diag-block summary::before { content: ""; border: .32em solid transparent; border-left: .46em solid var(--c-gold); border-right: 0; transition: transform .15s; }
.diag-block[open] summary::before { transform: rotate(90deg); }
.diag-section { padding: .5em 0 .1em; border-top: 1px solid rgba(255, 246, 226, .15); }
.diag-h { margin: 0 0 .45em; font-size: .78em; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-gold); }
.diag-copy { margin: .2em 0 .8em; }
.diag-block pre { max-height: 22em; overflow: auto; margin: 0 0 .8em; padding: .7em; border-radius: .3em; background: rgba(0, 0, 0, .35); font: .74em/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: #F5EAD3; }
.badge.crash .badge-ic { filter: brightness(1.7) saturate(.5); }
.diag-crash .kv.wide { grid-column: 1 / -1; margin-top: .4em; }
.diag-crash .kv.wide dd { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; }
.diag-crash { border-top: 1px solid rgba(255, 246, 226, .15); padding-top: .6em; }
.diag-crash .diag-message { margin: 0 0 .6em; padding: .7em; border-left: .25em solid #D9534A; border-radius: .3em; background: rgba(0, 0, 0, .35);
  font: .8em/1.45 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; color: #FFE3D6; }
.origins { margin: 1.2em 0; display: flex; flex-direction: column; gap: .5em; }
.origin { padding: .3em .7em; }
.origin summary { cursor: pointer; font-weight: 600; min-height: 36px; padding: .4em 0; }
.origin .md { padding: .3em 0 .5em; font-size: .92em; }
.entry-actions { margin: 1.2em 0 0; }
.discussion { margin-top: 1.6em; padding-top: 1.2em; border-top: 2px dashed rgba(122, 74, 38, .35); }
.discussion > .t-label { margin-bottom: .8em; }
.comments { list-style: none; margin: 0 0 1em; padding: 0; display: flex; flex-direction: column; gap: .9em; }
.comment { padding: .45em .6em .55em; border: .55em solid transparent; border-image: url(ui/materials/panel-parch.png) 18 fill / .55em round; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .6em; margin-bottom: .4em; font-size: .88em; }
.comment-head time { color: var(--c-ink-soft); font-size: .92em; }
.comment-avatar { width: 2.3em; font-size: .95em; }
.comment-tools { display: flex; gap: 1.2em; margin-top: .3em; font-size: .86em; }
.comment-tools .link { color: var(--c-ink-soft); }
.comment .media { margin: .7em 0 0; }
.composer { display: flex; flex-direction: column; gap: .6em; }
.composer-row { justify-content: space-between; align-items: flex-start; }
.composer-row .btn, .picker .btn { min-height: max(2.7em, var(--touch)); font-size: .86em; }
.entry-side { display: flex; flex-direction: column; gap: 1.2em; position: sticky; top: 5.6em; align-items: stretch; }
.entry-side > * { align-self: start; width: 100%; }
.side-card { padding: 1.3em 1.35em 1.4em; min-height: 6.5em; }
.side-card::before { border-width: 1.6em; border-image-width: 1.6em; }
.vote-inline { display: none; margin: -.2em 0 1em; }
.vote-card { display: flex; flex-direction: column; align-items: center; gap: .3em; }
.vote-card .vote { min-width: 10em; justify-content: center; min-height: 3.2em; font-size: 1.05em; }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55em; font-size: .86em; }
.history li { display: flex; flex-direction: column; padding-left: .9em; border-left: 2px solid #C9A46A; }
.history-reason { font-style: italic; color: var(--c-ink-soft); overflow-wrap: anywhere; }
/* Admin tools of an entry: colored status chips (the badge colors), type chips with icons, menus as wooden plaques. */
.mod-chips { display: flex; flex-wrap: wrap; gap: .4em; }
.mod-chip {
  display: inline-flex; align-items: center; gap: .45em; min-height: max(2.4em, 38px); padding: 0 .8em; border-radius: 999px;
  border: 2px solid rgba(122, 74, 38, .35); background: rgba(255, 248, 230, .55); color: var(--c-ink); font-weight: 600; font-size: .86em;
  transition: transform .08s ease, box-shadow .15s ease;
}
.mod-chip:hover { box-shadow: 0 0 0 2px rgba(233, 174, 63, .45); }
.mod-chip:active { transform: translateY(.08em); }
.mod-chip .dot { width: .75em; height: .75em; border-radius: 50%; background: currentColor; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.mod-chip[data-status] .dot { background: var(--st-dot); }
/* The chosen one: its badge color with a gold rim and a check. */
.mod-chip[aria-pressed="true"] { border-color: var(--c-gold-deep); box-shadow: 0 0 0 2px rgba(255, 214, 120, .6), 0 0 .7em rgba(255, 196, 80, .55); }
.mod-chip[data-status][aria-pressed="true"] { background: var(--st-bg); color: var(--st-fg); }
.mod-chip.kind[aria-pressed="true"] { background: linear-gradient(#FBE3A2, #E9B44E); }
.mod-chip[aria-pressed="true"]::after { content: ""; width: .95em; height: .95em; background: url(ui/glyphs/check.png) center / contain no-repeat; filter: sepia(1) saturate(2) brightness(.55); }
/* Admin controls keep 44 px on every device (design system rule 1). */
.mod-select, .merge-open, .member-role-btn, .mod .btn.sm { min-height: var(--touch); }
.mod-select { justify-content: flex-start; max-width: 100%; text-transform: none; letter-spacing: 0; font-size: .9em; }
.mod-select-text { overflow: hidden; text-overflow: ellipsis; }
.mod-select .ic { width: 1.3em; height: 1.3em; }
.caret { width: 0; height: 0; margin-left: auto; padding-left: .2em; border: .32em solid transparent; border-top: .38em solid currentColor; border-bottom: 0; }
.merge-open { white-space: normal; }
/* Wide: an open card whose summary is the heading. Narrow: a fold under the post with the current status. */
.mod-slot { display: contents; }
.mod > summary { list-style: none; }
.mod > summary::-webkit-details-marker { display: none; }
.mod.sheet > summary { cursor: default; }
.mod.sheet > summary > :not(.t-heading) { display: none; }
.mod.sheet .field:last-child { margin-bottom: 0; }
.mod.m-panel { margin: 1em 0; padding: .2em .6em; }
.mod.m-panel > summary { display: flex; align-items: center; gap: .6em; min-height: var(--touch); cursor: pointer; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-size: .9em; }
.mod.m-panel > summary > .t-heading { display: none; }
.mod-fold-col { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1em; letter-spacing: 0; text-transform: none; color: var(--c-ink-soft); }
.mod.m-panel > summary::after { content: ""; margin-left: auto; border: .4em solid transparent; border-top: .5em solid var(--c-wood); border-bottom: 0; transition: transform .15s; }
.mod.m-panel[open] > summary::after { transform: rotate(180deg); }
.mod.m-panel > .mod-body { padding: .4em 0 .6em; }

/* ---------- dialogs and menus ---------- */
.dialog { width: min(30em, calc(100vw - 1.4em)); max-height: calc(100dvh - 2em); margin: auto; padding: calc(var(--touch) / 2) 0 0; border: 0; background: transparent; overflow: visible; color: var(--c-ink); }
.dialog.wide { width: min(38em, calc(100vw - 1.4em)); }
.dialog::backdrop { background: var(--c-scrim); }
.dialog-sheet { max-height: calc(100dvh - 2em - var(--touch) / 2); overflow: auto; overscroll-behavior: contain; }
.dialog > .close-x { position: absolute; top: 0; right: .35em; }
.dialog-title { margin: 0 calc(var(--touch) - .4em) .7em 0; font-size: 1.15em; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; text-wrap: balance; }
.dialog-text { margin: 0 0 1em; color: var(--c-ink-soft); }
.dialog-text p { margin: 0 0 .6em; }
.dialog-text p:first-child { color: var(--c-ink); font-weight: 600; }
.dialog-actions { margin-top: 1.2em; }
.dialog .field { margin-bottom: 0; }
.pop { position: fixed; z-index: 70; min-width: 13em; max-width: min(22em, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow-y: auto; display: flex; flex-direction: column; gap: .15em; padding: .45em; filter: drop-shadow(0 .4em .6em rgba(0, 0, 0, .6)); }
.pop-item { display: flex; align-items: center; gap: .65em; min-height: var(--touch); padding: .35em .6em; border: 0; border-radius: var(--radius); background: none; color: var(--c-chrome); text-align: left; font-weight: 600; }
.pop-item:hover:not([disabled]), .pop-item:focus-visible { background: rgba(255, 214, 120, .16); outline-offset: -2px; }
.pop-item[disabled] { opacity: .45; cursor: default; }
.pop-item .ic, .pop-ic { flex: none; width: 1.2em; height: 1.2em; filter: brightness(0) invert(.9); }
.pop-item[aria-checked="true"] .pop-ic { background: url(ui/glyphs/check.png) center / contain no-repeat; filter: sepia(1) saturate(3) brightness(1.1); }
.pop-item[aria-checked="true"] .pop-label { color: var(--c-gold); }
.pop-item.danger { color: #FFC4B8; }
.pop-title { padding: .25em .6em .45em; margin-bottom: .2em; border-bottom: 1px solid rgba(255, 246, 226, .18); color: var(--c-gold); font-weight: 700; font-size: .85em; }
/* Phones and short screens: a bottom sheet titled like its button. */
.pop-scrim { position: fixed; inset: 0; z-index: 69; background: var(--c-scrim); }
.pop.pop-sheet { left: 0; right: 0; bottom: 0; top: auto; max-width: 32em; margin-inline: auto; padding-bottom: calc(.45em + env(safe-area-inset-bottom)); max-height: min(80dvh, calc(100dvh - 16px)); }
.nowrap { white-space: nowrap; }
.merged-reply { margin: 0; color: var(--c-ink-soft); font-style: italic; }
.notice-link { align-items: center; }
.notice-link > div { flex: 1; min-width: 0; }
.notice-go { display: inline-flex; align-items: center; gap: .3em; flex: none; min-height: var(--touch); font-weight: 700; color: #6B3A12; }
.notice-go .ic { width: 1em; height: 1em; }
a.notice-link:hover .notice-go { text-decoration: underline; }
/* The check column only where a menu shows a choice. */
.pop:not(.pop-checks) .pop-ic { display: none; }
.pop-cancel { display: none; justify-content: center; margin-top: .2em; border-top: 1px solid rgba(255, 246, 226, .18); border-radius: 0; color: var(--c-chrome-soft); }
.pop.pop-sheet .pop-cancel { display: flex; }
.pop-sep { width: 100%; margin: .2em 0; border: 0; border-top: 1px solid rgba(255, 246, 226, .18); }
.pop-text { display: flex; flex-direction: column; min-width: 0; }
.pop-hint { font-size: .78em; font-weight: 400; color: var(--c-chrome-soft); }
/* Entry picker */
.dialog .search { margin-bottom: .8em; }
.pick-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45em; }
.pick-none { padding: 1.5em .5em; text-align: center; color: var(--c-ink-soft); }
.pick-entry { display: flex; align-items: center; gap: .7em; width: 100%; min-height: var(--touch); padding: .3em .5em; background: none; text-align: left; transition: transform .08s ease, filter .15s ease; }
.pick-entry:hover:not([disabled]) { filter: brightness(1.04) drop-shadow(0 0 .3em rgba(255, 200, 90, .7)); }
.pick-entry[disabled] { opacity: .55; cursor: default; }
.pick-entry .card-kind { flex: none; width: 2.4em; height: 2.4em; }
.pick-entry-body { display: flex; flex-direction: column; gap: .2em; min-width: 0; }
.pick-entry-title { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.pick-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2em .7em; font-size: .78em; font-weight: 600; color: var(--c-ink-soft); }
.pick-note { color: #7A3E00; font-style: italic; }

/* ---------- roadmap ---------- */
/* Same page grid as the other pages; a wide board scrolls inside it. */
.roadmap-page { max-width: 78em; margin: 0 auto; }
.rm-top { display: flex; flex-direction: column; align-items: center; gap: .2em; margin: .3em 0 .9em; color: var(--c-ink); text-align: center; }
.rm-top .t-heading { margin: 0; color: var(--c-wood-dark); font-size: 1.35em; }
.rm-intro { margin: 0; color: var(--c-ink-soft); }
.rm-hint { display: flex; align-items: center; justify-content: center; gap: .55em; margin: 0 0 .6em; font-size: .82em; color: var(--c-ink-soft); }
.rm-hint .rm-grip { background-image: radial-gradient(circle, var(--c-wood) 1.6px, transparent 2px); }
.rm-tabs { display: none; }
.rm-board { display: flex; align-items: flex-start; gap: 1.1em; overflow-x: auto; padding: .4em .2em 1.6em; overscroll-behavior-x: contain; }
.rm-col { flex: 0 0 20em; display: flex; flex-direction: column; gap: .55em; padding: 1.15em 1.1em 1.2em; min-height: 10em; }
.rm-col::before { border-width: 1.6em; border-image-width: 1.6em; }
.rm-col-head { display: flex; align-items: center; gap: .5em; padding-bottom: .5em; margin-bottom: .1em; border-bottom: 2px dashed rgba(122, 74, 38, .3); }
.rm-col-title { flex: 1; min-width: 0; margin: 0; font-size: 1.02em; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.rm-count { flex: none; min-width: 1.8em; padding: .05em .45em; border-radius: 999px; background: rgba(122, 74, 38, .14); font-size: .8em; font-weight: 700; text-align: center; }
.rm-col-menu-btn { flex: none; display: grid; place-items: center; width: var(--touch); height: var(--touch); margin: -.4em -.5em -.4em 0; border: 0; border-radius: 50%; background: none; color: var(--c-wood); }
.rm-col-menu-btn:hover, .rm-col-menu-btn[aria-expanded="true"] { background: rgba(122, 74, 38, .14); }
.dots { width: 4px; height: 4px; border-radius: 50%; background: currentColor; box-shadow: -7px 0 currentColor, 7px 0 currentColor; }
.rm-empty { margin: .3em 0; font-size: .86em; color: var(--c-ink-soft); }
.rm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55em; min-height: 2.5em; }
.rm-card { position: relative; display: flex; flex-direction: column; gap: .35em; padding: .35em .5em .4em; filter: drop-shadow(0 .2em .3em rgba(0, 0, 0, .35)); }
.rm-card-head { display: flex; flex-wrap: wrap; gap: .3em; padding-right: 2.6em; }
.rm-title { color: var(--c-ink); font-weight: 600; text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { .rm-title:hover { text-decoration: underline; } }
.rm-card-foot { display: flex; align-items: center; gap: .8em; font-size: .85em; font-weight: 600; color: var(--c-ink-soft); }
.rm-card-foot .num { margin-left: auto; font-size: .9em; }
.vote.mini { min-height: 34px; min-width: 3.6em; justify-content: center; padding: 0 .8em; gap: .35em; font-size: .95em; }
.rm-handle { position: absolute; top: 0; right: 0; width: var(--touch); height: var(--touch); display: grid; place-items: center; border: 0; background: none; cursor: grab; touch-action: none; }
.rm-handle:focus-visible { outline-offset: -4px; }
/* Grip: two columns of three ink dots. */
.rm-grip { display: inline-block; width: 10px; height: 16px; background: radial-gradient(circle, #8A6A44 1.6px, transparent 2px) 0 0 / 5px 5.5px; }
.ic.flip { transform: scaleX(-1); }
.rm-dragging { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; transform-origin: 20% 20%; filter: drop-shadow(0 .8em 1.2em rgba(0, 0, 0, .55)); }
.rm-dragging .rm-handle { cursor: grabbing; }
.rm-placeholder { border: 2px dashed rgba(122, 74, 38, .55); border-radius: var(--radius); background: rgba(247, 214, 138, .25); }
.rm-add-open, .rm-ghost { display: flex; align-items: center; justify-content: center; gap: .5em; border: 2px dashed rgba(122, 74, 38, .45); border-radius: var(--radius); background: rgba(255, 248, 230, .35); color: var(--c-ink-soft); font-weight: 600; }
.rm-add-open { min-height: var(--touch); margin-top: .1em; }
.rm-add-open:hover, .rm-ghost:hover { background: rgba(247, 214, 138, .45); color: var(--c-ink); border-color: var(--c-gold-deep); }
.rm-add-open .plus, .rm-ghost .plus { font-size: 1.4em; line-height: 1; }
/* The board ends in an empty, dashed column to start a new one. */
.rm-ghost { flex: 0 0 11em; flex-direction: column; min-height: 10em; padding: 1em; align-self: stretch; max-height: 16em; border-color: rgba(247, 214, 138, .45); background: rgba(36, 19, 10, .35); color: var(--c-chrome); }
.rm-ghost .plus { font-size: 2em; color: var(--c-gold); }
.rm-ghost:hover { color: var(--c-ink); }
.rm-board:has(.rm-dragging) .rm-ghost { background: rgba(36, 19, 10, .35); border-color: rgba(247, 214, 138, .45); color: var(--c-chrome); }

/* ---------- members ---------- */
.members { list-style: none; margin: .6em 0 1.4em; padding: 0; display: flex; flex-direction: column; gap: .55em; }
.member { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; padding: .6em .8em; }
.member.is-pending { filter: drop-shadow(0 0 .45em rgba(255, 196, 80, .55)); }
.member-who { display: flex; flex-direction: column; gap: .1em; flex: 1; min-width: 12em; }
.member-who strong { display: flex; align-items: center; gap: .5em; }
.member-you { padding: .05em .5em; border-radius: 999px; background: var(--c-gold); font-size: .72em; letter-spacing: .05em; text-transform: uppercase; }
.member-mail { font-size: .85em; color: var(--c-ink-soft); overflow-wrap: anywhere; }
.member-since { font-size: .78em; color: var(--c-ink-soft); }
.member-role-btn { min-width: 9.5em; justify-content: space-between; }
.member-role-self { display: flex; flex-direction: column; align-items: flex-end; gap: .2em; max-width: 16em; text-align: right; text-wrap: balance; }
.member-role-self .badge { font-size: .8em; }
.members-h { display: flex; align-items: center; gap: .5em; }
.narrow .sheet > .t-label, .members-pending > .t-label { margin: 1.2em 0 .5em; }
.members-pending { margin-bottom: 1em; }
.members-pending .members { margin-bottom: .5em; }
.members-calm { display: flex; align-items: center; justify-content: center; gap: .6em; margin: 0 0 .4em; color: var(--c-ink-soft); }
.members-calm-ic { width: 2.2em; image-rendering: pixelated; }

/* ---------- devices, cloud saves, linking ---------- */
.row-ic { width: 2.4em; height: 2.4em; flex: none; image-rendering: pixelated; }
.usage { margin: .6em 0 .9em; height: 1.9em; }
.usage .progress-text { line-height: 1.9em; font-size: .78em; }
.usage .progress-fill { min-width: .3em; }
.worlds .world { display: flex; flex-direction: column; gap: .3em; padding: .7em .8em; }
.world-head { display: flex; align-items: center; gap: .8em; }
.world-name { overflow-wrap: anywhere; }
.versions > summary { cursor: pointer; display: flex; align-items: center; gap: .5em; min-height: var(--touch); font-weight: 600; font-size: .9em; list-style: none; color: var(--c-ink-soft); }
.versions > summary::-webkit-details-marker { display: none; }
.versions > summary::before { content: ""; border: .34em solid transparent; border-left: .5em solid #8A6A44; border-right: 0; transition: transform .15s; }
.versions[open] > summary::before { transform: rotate(90deg); }
.version-list { list-style: none; margin: 0 0 .6em; padding: 0; display: flex; flex-direction: column; gap: .35em; }
.version { display: flex; align-items: center; justify-content: space-between; gap: .4em .8em; flex-wrap: wrap; padding: .35em .1em .35em .7em; border-left: 2px solid #C9A46A; }
.version-who { display: flex; flex-direction: column; min-width: 0; font-size: .88em; }
.version-who span { color: var(--c-ink-soft); font-size: .9em; overflow-wrap: anywhere; }
.cloud-empty { display: flex; align-items: center; gap: .9em; margin: .4em 0 1em; }
.cloud-empty-ic { width: 3em; image-rendering: pixelated; flex: none; }
.cloud-empty .t-body { margin: 0; }
.link-page { max-width: 32em; }
.link-sheet > .t-body { margin: 0 0 1em; text-wrap: balance; }
.link-form { display: flex; flex-direction: column; align-items: stretch; }
.code-input { text-align: center; font-size: 1.5em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.code-input::placeholder { color: rgba(85, 64, 42, .35); }
.link-device { display: flex; align-items: center; gap: .8em; flex-wrap: wrap; padding: .8em .9em; margin: 0 0 .9em; }
.link-device-who { display: flex; flex-direction: column; flex: 1; min-width: 9em; }
.link-device-who strong { font-size: 1.12em; overflow-wrap: anywhere; }
.link-device-who span { font-size: .85em; color: var(--c-ink-soft); }
.link-code { font-weight: 700; letter-spacing: .12em; color: #8A6A44; font-variant-numeric: tabular-nums; }
.link-warn { display: flex; align-items: center; gap: .7em; margin: 0 0 1.2em; padding: .65em .85em; border-radius: var(--radius); background: rgba(233, 174, 63, .2); border: 1px solid #D9902F; color: #6B3A12; font-weight: 600; font-size: .9em; }
.link-warn-ic { width: 2em; flex: none; image-rendering: pixelated; }
.link-sheet > .hint { display: block; margin: 0 0 .8em; text-wrap: balance; }
.link-emote { width: 5em; margin: 0 auto .4em; image-rendering: pixelated; }
.link-done { margin: 0 0 .4em; text-align: center; font-size: 1.2em; font-weight: 600; }
.link-sheet .row.center { margin-top: .4em; }

/* ---------- lightbox, toast ---------- */
/* The image stays whole; the close button sits on the frame's top-right corner (design system), the link to the
   original in a bar below. */
.lightbox { max-width: calc(100vw - var(--touch) - 1.5em); max-height: 96dvh; margin: auto; padding-top: calc(var(--touch) / 2 + .2em); padding: 0; border: 0; background: transparent; overflow: visible; display: flex; flex-direction: column; align-items: center; gap: .6em; }
.lightbox::backdrop { background: rgba(10, 6, 2, .92); }
.lightbox-frame { position: relative; }
.lightbox-frame > img { display: block; max-width: calc(100vw - var(--touch) - 1.5em); max-height: calc(96dvh - 5em - var(--touch) / 2); border-radius: var(--radius); border: 3px solid #C9A46A; }
.close-x { position: absolute; top: calc(var(--touch) / -2); right: calc(var(--touch) / -2); box-shadow: 0 0 0 3px rgba(20, 10, 4, .85); border-radius: 50%; }
.lightbox-bar { display: flex; justify-content: center; }
#toast { position: fixed; z-index: 50; left: 50%; bottom: calc(1.2em + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(30em, 92vw); padding: .75em 1.2em; border: .45em solid transparent; border-image: url(ui/materials/dark.png) 16 fill / .45em round; color: var(--c-chrome); font-weight: 600; text-align: center; filter: drop-shadow(0 .4em .6em rgba(0, 0, 0, .6)); }
#toast[data-kind="error"] { color: #FFD3C9; }

/* ---------- responsive ---------- */
@media (max-width: 62em) {
  .detail-page { grid-template-columns: minmax(0, 1fr); }
  .entry-side { position: relative; top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(16em, 1fr)); }
  .vote-card { display: none; }
  .vote-inline { display: block; }
}
@media (max-width: 52em) {
  .list-page { grid-template-columns: minmax(0, 1fr); }
  .side { position: relative; top: 0; display: none; }
  .side.open { display: block; }
  .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(10em, 1fr)); gap: 0 .8em; }
  .filter-toggle { display: inline-flex; }
}
@media (max-width: 40em) {
  :root { --u: 15px; }
  /* Columns swipe sideways, one at a time. */
  .rm-board { scroll-snap-type: x mandatory; gap: .7em; }
  .rm-col { flex-basis: 84vw; scroll-snap-align: center; }
  .rm-board { scroll-padding-inline: .3em; padding-top: .2em; }
  .rm-ghost { flex-basis: 84vw; scroll-snap-align: center; }
  .rm-hint { display: none; }
  #view { padding-inline: .45em; }
  .bar { gap: .5em; padding: 0; }
  .logo { height: 2.1em; }
  .member-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .member-role-btn, .member-role-self { margin-left: calc(2.8em + .8em); }
  .member-role-self { align-items: flex-start; text-align: left; max-width: none; }
  .dialog-actions:has(> :nth-child(2)) { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions .btn { white-space: normal; text-align: center; line-height: 1.15; }
  .nav-feedback, .nav-new-label { display: none; }
  .nav .btn.gold { min-width: var(--touch); min-height: var(--touch); padding: 0 .7em; }
  .sheet { padding: 1.4em 1.15em 1.4em; }
  /* The type badge carries the type; the round icon would only take width. */
  .card { grid-template-columns: minmax(0, 1fr) auto; gap: .6em; padding: .45em .5em; }
  .card > .card-kind { display: none; }
  .card > .card-body { grid-column: 1; }
  .card > .card-thumb { grid-column: 1; grid-row: 2; width: 8em; height: 4.6em; margin-top: -.2em; }
  .card > .vote { grid-row: 1; grid-column: 2; }
  .kind-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .3em; }
  .kind-opt { font-size: .7em; padding: .5em .1em .45em; hyphens: none; }
  .kind-opt span { white-space: nowrap; letter-spacing: -.02em; font-size: .94em; }
  .entry-head .card-badges { flex-basis: 100%; }
  .entry-title { font-size: 1.28em; }
  .card-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .entry-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-height: 30em) and (orientation: landscape) {
  #top { position: static; }
  .side, .entry-side { position: relative; top: 0; }
  .logo { height: 1.9em; }
  .auth { padding-block: .8em; }
}
/* Phones and short landscape screens: the column tabs name every column. */
@media (max-width: 40em), (max-height: 30em) {
  .rm-tabs { display: flex; gap: .4em; overflow-x: auto; margin: 0 -.45em .3em; padding: .2em .45em; scrollbar-width: none; }
  .rm-tabs { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2em), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2em), transparent); }
  .rm-tabs .chip { flex: none; }
  .rm-tabs .chip[aria-current="true"] { background: linear-gradient(#FBE3A2, #E9B44E); color: var(--c-ink); border-color: #FFE7A8; }
  .rm-tab-n { font-size: .85em; opacity: .75; }
}
/* Short screens: dialogs use the whole height, the close button sits inside the sheet. */
@media (max-height: 30em) {
  .dialog { padding-top: 0; max-height: calc(100dvh - .6em); }
  .dialog-sheet { max-height: calc(100dvh - .6em); }
  .dialog > .close-x { top: .45em; right: .45em; }
}
@media (max-width: 40em) { .kvs { grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); } }
/* Touch and phones: every control keeps 44 px (design system rule 1). */
@media (pointer: coarse), (max-width: 40em), (max-height: 30em) {
  .btn.sm, .chip, .seg .btn, .kind-opt, .vote.compact, .vote.mini, .mod-chip { min-height: var(--touch); }
  .link { min-height: var(--touch); padding: 0 .3em; display: inline-flex; align-items: center; }
  .pick-x { width: var(--touch); height: var(--touch); top: 0; right: 0; }
  /* Text fields under 16 px make phone browsers zoom and scroll the page (dialogs slid out of view). */
  input, select, textarea { font-size: max(16px, 1em); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
