/* the look is all tokens: a theme in site.json sets these and nothing else. a new theme is a new set of values */
:root { --page: #8fcbc8; --frame: #a58ab0; --line: #123; --panel: #f5dfb8; --paper: #fff3cc; --ink: #145; --muted: #368; --active: #e5c9a0; --hi: #fff; --lo: #356; --font: Georgia, serif; --radius: 10; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--frame); color: var(--ink); font-family: var(--font); font-size: 15px; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }

/* the look of an Obsidian control: paper, a dark outline, a light inset top left and a shade bottom right */
.bevel { background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6px); box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.btn:hover { filter: brightness(1.05); }
.btn:active, .btn.on { background: var(--active); box-shadow: inset 2px 2px 0 var(--lo), inset -2px -2px 0 var(--hi); }
.btn:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
input.field, select.field, textarea.field { padding: 5px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6px); box-shadow: inset 2px 2px 0 var(--lo); min-width: 0; }

/* the page: a window on the frame color, as wide as the screen */
#shell { min-height: 100vh; padding: 8px; }
#workspace { min-height: calc(100vh - 16px); background: var(--page); border: 2px solid var(--line); border-radius: calc(var(--radius) * 2px); padding: 10px; display: flex; flex-direction: column; gap: 10px; }
header.top { display: flex; align-items: center; gap: 14px; padding: 8px 14px; background: var(--panel); flex-wrap: wrap; }
header.top img { height: 40px; width: auto; display: block; }
header.top h1 { font-size: 20px; margin: 0; font-weight: 700; }
nav.pages { display: flex; gap: 6px; flex-wrap: wrap; }
.spring { flex: 1; }
main { display: flex; flex-direction: column; gap: 10px; flex: 1; }
footer.end { text-align: center; font-size: 12px; color: var(--muted); padding: 6px; }

/* blocks */
.block { background: var(--panel); padding: 14px; position: relative; }
.block > h2 { font-size: 17px; margin: 0 0 12px; min-height: 1em; }
.block.bare { padding: 0; background: none; border: 0; box-shadow: none; }

/* a gallery's display modes. a new one is a rule here and a name in MODES in app.js */
.items { --cols: 3; --gap: 10px; }
.mode-grid .items { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.mode-grid .card { aspect-ratio: 16 / 9; }
.mode-wall .items { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 2px; }
.mode-wall .card { aspect-ratio: 16 / 9; border-radius: 0; border: 0; box-shadow: none; }
.mode-masonry .items { column-count: var(--cols); column-gap: var(--gap); }
.mode-masonry .card { break-inside: avoid; margin-bottom: var(--gap); }
.mode-masonry .card img { height: auto; }
.mode-strip .items { display: flex; gap: var(--gap); overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.mode-strip .card { flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols)); aspect-ratio: 16 / 9; scroll-snap-align: start; }
.mode-spotlight .items { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--gap); }
.mode-spotlight .card { aspect-ratio: 16 / 9; }
.mode-spotlight .card:first-child { grid-column: 1 / -1; aspect-ratio: 21 / 9; }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
@media (max-width: 760px) { .items { --cols: 1 !important; } .span-2, .span-3 { grid-column: auto; } .mode-strip .card { flex-basis: 85%; } }

.card { position: relative; margin: 0; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6px); cursor: pointer; display: block; min-height: 60px; }
.card img, .card video { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .play { position: absolute; left: 10px; bottom: 10px; pointer-events: none; font-size: 12px; padding: 3px 7px; }
.card figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 10px 8px; color: #fff; font-size: 13px; background: linear-gradient(transparent, rgba(0,0,0,.7)); pointer-events: none; }
.card.has-cap .play { display: none; }
.card .plain { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 90px; padding: 10px; background: var(--paper); color: var(--ink); font-size: 13px; word-break: break-all; text-align: center; }

.text { white-space: pre-wrap; line-height: 1.6; max-width: 80ch; margin: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links .off { opacity: .5; pointer-events: none; }
.embed iframe { display: block; width: 100%; height: 84vh; border: 1px solid var(--line); border-radius: calc(var(--radius) * 0.6px); background: #000; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* the full view */
#lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
#lightbox video, #lightbox img { max-width: 100vw; max-height: 100vh; }
#lightbox .btn { position: absolute; z-index: 1; }
#lightbox .close { top: 14px; right: 14px; }
#lightbox .prev { left: 14px; top: 50%; }
#lightbox .next { right: 14px; top: 50%; }

/* logging in */
.login { max-width: 340px; margin: 12vh auto; padding: 20px; background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.login h2 { margin: 0; font-size: 17px; }
.login .bad { color: #b3263c; font-size: 13px; }

/* ---- the editor ---- */
#edbar { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: flex; gap: 6px; padding: 6px; background: var(--panel); align-items: center; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 36px); }
#edstatus { font-size: 12px; color: var(--muted); padding: 0 6px; }
#edstatus.bad { color: #b3263c; font-weight: 700; }
#drawer { position: fixed; top: 18px; right: 18px; bottom: 74px; width: 340px; max-width: calc(100vw - 36px); z-index: 40; background: var(--panel); padding: 12px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
#drawer h3 { margin: 0; font-size: 14px; }
#drawer .row { display: flex; gap: 6px; align-items: center; }
#drawer .row > .field { flex: 1; width: 100%; }
#drawer label.token { display: grid; grid-template-columns: 1fr 34px 1.4fr; gap: 6px; align-items: center; font-size: 12px; }
#drawer input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--line); background: none; }
#drawer .libgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#drawer .libgrid button { padding: 0; aspect-ratio: 1; overflow: hidden; cursor: pointer; font-size: 10px; word-break: break-all; }
#drawer .libgrid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.editing .block { outline: 1px dashed var(--muted); outline-offset: -1px; padding-top: 48px; }
.editing .block.bare { padding: 48px 0 0; }
.blockbar { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; z-index: 3; }
.blockbar .grip { cursor: grab; }
.blockbar label { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.blockbar input[type=range] { width: 70px; }
.editing [contenteditable] { outline: 1px dotted var(--muted); outline-offset: 3px; min-width: 60px; cursor: text; }
.editing .card { cursor: grab; }
.cardbar { position: absolute; top: 6px; right: 6px; display: none; gap: 4px; z-index: 2; }
.editing .card:hover .cardbar, .editing .card:focus-within .cardbar { display: flex; }
.cardbar .btn { padding: 2px 7px; font-size: 12px; }
.card.drop-before { box-shadow: -4px 0 0 var(--ink); } .card.drop-after { box-shadow: 4px 0 0 var(--ink); }
.block.drop-before { box-shadow: 0 -4px 0 var(--ink); } .block.drop-after { box-shadow: 0 4px 0 var(--ink); }
.block.drop-here { outline: 3px solid var(--ink); outline-offset: -3px; background: var(--active); }
#dropveil { position: fixed; inset: 0; z-index: 30; pointer-events: none; border: 6px dashed var(--ink); display: none; align-items: flex-end; justify-content: center; padding-bottom: 80px; }
body.dropping #dropveil { display: flex; }
#dropveil span { padding: 8px 14px; font-weight: 700; }
#tray { position: fixed; left: 18px; bottom: 18px; width: 320px; max-width: calc(100vw - 36px); max-height: 50vh; overflow: auto; z-index: 40; background: var(--panel); padding: 10px; display: flex; flex-direction: column; gap: 8px; font-size: 12px; }
#tray .bar { height: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 3px; overflow: hidden; margin-top: 3px; }
#tray .bar i { display: block; height: 100%; background: var(--ink); }
#tray .bad { color: #b3263c; font-weight: 700; }
.linkrow { display: flex; gap: 4px; margin-bottom: 4px; align-items: center; flex-wrap: wrap; }
.linkrow .field { flex: 1 1 120px; }

/* ---- the sections ---- */
#edgeL, #edgeR { position: fixed; top: 0; bottom: 0; width: clamp(8px, 2vw, 30px); z-index: 20; pointer-events: none; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
#edgeL { left: 0; -webkit-mask-image: linear-gradient(to right, #000, transparent); mask-image: linear-gradient(to right, #000, transparent); }
#edgeR { right: 0; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); }
.textbox { padding: 14px 16px; background: var(--paper); overflow: auto; line-height: 1.55; }
.textbox h2, .textbox h3 { margin: 0 0 8px; font-size: 1.25em; color: var(--ink); }
.textbox p { margin: 0; white-space: pre-wrap; }
.textbox.mark1 { border-color: var(--mark1); box-shadow: 0 0 0 2px var(--mark1), inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }
.textbox.mark2 { border-color: var(--mark2); box-shadow: 0 0 0 2px var(--mark2), inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); }

/* LA wheel: the first thing on the page, the quarter circle cut off by the corner of its stage */
.hero { display: grid; grid-template-columns: 62fr 38fr; gap: 10px; min-height: calc(100svh - 112px); position: relative; }
.wh-stage { position: relative; overflow: hidden; touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; border-radius: calc(var(--radius) * 0.6px); }
.wh-stage.turning { cursor: grabbing; }
.wh-card { position: absolute; will-change: transform; background: var(--line); }
.wh-view { position: absolute; will-change: transform; pointer-events: none; }
.wh-view img, .wh-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.wh-blank { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--panel); color: var(--ink); font-size: 34px; }
.wh-sym { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 7px 11px; font-size: 14px; color: var(--ink); }
.wh-frame { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wh-frame path { fill: none; stroke: var(--line); stroke-width: 3; vector-effect: non-scaling-stroke; }
.wh-hub { position: absolute; left: 0; bottom: 0; z-index: 3; padding: 0; cursor: pointer; border-radius: 0 100% 0 0; }
.wh-hub:hover { filter: brightness(1.06); }
.wh-hub:active { box-shadow: inset 2px 2px 0 var(--lo), inset -2px -2px 0 var(--hi); }
.wh-side { display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; padding: 10px 0; }
.wh-side .textbox { max-height: 100%; }
.wh-side .textbox:empty { display: none; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; grid-template-rows: 58svh auto; min-height: 0; } }

/* the carousel: text 35, the turning frame 65 */
.carousel { display: grid; grid-template-columns: 35fr 65fr; gap: 10px; align-items: stretch; }
.ca-text { position: relative; min-width: 0; min-height: 200px; }
.ca-layer { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; padding: 12px 4px; opacity: 0; transition: opacity .45s ease; justify-content: center; }
.ca-layer.on { opacity: 1; }
.ca-layer .textbox { flex: 0 1 auto; min-height: 0; }
.ca-frame { position: relative; aspect-ratio: 1; max-height: calc(100svh - 28px); width: 100%; margin-left: auto; overflow: hidden; touch-action: pan-y; cursor: grab; outline: none; border-radius: calc(var(--radius) * 0.6px); user-select: none; -webkit-user-select: none; }
.ca-frame.turning { cursor: grabbing; }
.ca-frame:focus-visible { box-shadow: 0 0 0 2px var(--ink); }
.ca-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ca-head { position: absolute; left: 0; right: 0; top: 0; width: 100%; pointer-events: none; }
.ca-head text { fill: var(--ink); font-family: var(--font); font-weight: 700; font-size: 34px; paint-order: stroke; stroke: var(--paper); stroke-width: 6px; stroke-linejoin: round; }
.ca-none { display: flex; flex-direction: column; gap: 8px; padding: 10px; overflow: auto; height: 100%; }
.ca-none img { width: 100%; display: block; }
@media (max-width: 760px) { .carousel { grid-template-columns: 1fr; } .ca-frame { order: -1; } .ca-text { min-height: 180px; } }

/* the mosaic */
.mo-wall { position: relative; }
.mo-wall .card { position: absolute; left: 0; top: 0; transition: width .25s ease, height .25s ease, transform .25s ease; min-height: 0; }
.mosaic .card img { transform-origin: 50% 0; }

/* music */
.music { padding: 30px 0 18vh; position: relative; overflow: hidden; }
.mu-title { text-align: center; font-size: clamp(30px, 6vw, 72px); margin: 0 0 30px; color: var(--ink); }
.mu-wall { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 2vw, 24px); padding: 0 3%; perspective: 1200px; }
.mu-tile { position: relative; }
/* the top rows make an arch, the middle highest */
.mu-tile:nth-child(5n + 1), .mu-tile:nth-child(5n) { margin-top: 64px; }
.mu-tile:nth-child(5n + 2), .mu-tile:nth-child(5n + 4) { margin-top: 26px; }
.mu-tile .albumbox { will-change: transform; transform-origin: 50% 40%; }
@media (max-width: 760px) { .mu-wall { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mu-tile:nth-child(n) { margin-top: 0; } .mu-tile:nth-child(2n) { margin-top: 26px; } }

/* the album art box */
.albumbox { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; padding: 5px; background: var(--paper); display: block; }
.albumbox > img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: calc(var(--radius) * 0.3px); }
.ab-blank { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: clamp(30px, 6vw, 70px); color: var(--ink); background: var(--active); border-radius: calc(var(--radius) * 0.3px); }
.ab-controls { position: absolute; inset: 5px; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 3px; padding: 8px; color: #fff; background: linear-gradient(transparent 45%, rgba(0,0,0,.72)); opacity: 1; transition: opacity .5s ease; border-radius: calc(var(--radius) * 0.3px); }
.albumbox.playing .ab-controls { opacity: 0; }
.albumbox.playing:hover .ab-controls, .albumbox.playing:focus-within .ab-controls, .albumbox.playing.peek .ab-controls { opacity: 1; }
.ab-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 25%; min-width: 34px; aspect-ratio: 1; border-radius: 50%; border: 1px solid #fff; background: rgba(0,0,0,.4); color: #fff; font-size: clamp(11px, 1.3vw, 18px); cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.albumbox figcaption { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-bar { width: 100%; height: 16px; margin: 0; accent-color: #fff; cursor: pointer; }
.ab-time { font-size: 10px; opacity: .85; text-align: right; min-height: 1em; }

/* a free board: everything placed by hand, in units of the board's width so it scales with the screen */
.boardblock { container-type: inline-size; }
.board { position: relative; height: calc(var(--board-h) * 1cqw); }
.bd-item { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1cqw); width: calc(var(--w) * 1%); height: calc(var(--h) * 1cqw); z-index: var(--z); }
.bd-item.card { min-height: 0; }
.bd-audio .albumbox { width: 100%; height: 100%; aspect-ratio: auto; }
@media (max-width: 760px) {
  .board { height: auto; display: flex; flex-direction: column; gap: 10px; }
  .bd-item { position: relative; left: auto; top: auto; width: 100%; height: auto; aspect-ratio: calc(var(--w) / var(--h)); order: var(--o); }
  .bd-item.textbox { aspect-ratio: auto; }
}
.editing .board { outline: 1px dotted var(--muted); background-image: linear-gradient(var(--muted) 1px, transparent 1px), linear-gradient(90deg, var(--muted) 1px, transparent 1px); background-size: 5cqw 5cqw; background-blend-mode: normal; }
.editing .bd-item { cursor: move; touch-action: none; outline: 1px solid var(--ink); }
.bd-h { position: absolute; width: 14px; height: 14px; background: var(--paper); border: 1px solid var(--ink); z-index: 5; touch-action: none; }
.bd-h[data-dir="nw"] { left: -7px; top: -7px; cursor: nwse-resize; } .bd-h[data-dir="ne"] { right: -7px; top: -7px; cursor: nesw-resize; }
.bd-h[data-dir="sw"] { left: -7px; bottom: -7px; cursor: nesw-resize; } .bd-h[data-dir="se"] { right: -7px; bottom: -7px; cursor: nwse-resize; }
.bd-h[data-dir="n"] { left: 50%; top: -7px; margin-left: -7px; cursor: ns-resize; } .bd-h[data-dir="s"] { left: 50%; bottom: -7px; margin-left: -7px; cursor: ns-resize; }
.bd-h[data-dir="w"] { left: -7px; top: 50%; margin-top: -7px; cursor: ew-resize; } .bd-h[data-dir="e"] { right: -7px; top: 50%; margin-top: -7px; cursor: ew-resize; }
.bd-tools { position: absolute; top: 4px; right: 4px; display: none; gap: 3px; z-index: 6; }
.editing .bd-item:hover .bd-tools, .editing .bd-item:focus-within .bd-tools { display: flex; }
.bd-tools .btn { padding: 2px 6px; font-size: 11px; }

/* the block tools sit above the fancy sections, and the pieces in them are listed underneath to order and write about */
.editing .hero, .editing .carousel, .editing .music { position: relative; padding-top: 48px; outline: 1px dashed var(--muted); outline-offset: -1px; }
.tray { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; padding: 8px; background: var(--panel); border: 1px dashed var(--muted); align-items: flex-start; }
.chip { flex: 0 0 150px; background: var(--paper); border: 1px solid var(--line); padding: 4px; cursor: grab; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }
.chip img, .chip .chipblank { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--line); pointer-events: none; }
.chip .field { width: 100%; font-size: 11px; }
.chip textarea.field { height: 54px; resize: vertical; }
.chip.drop-before { box-shadow: -4px 0 0 var(--ink); } .chip.drop-after { box-shadow: 4px 0 0 var(--ink); }
.hero.drop-here, .carousel.drop-here, .music.drop-here { outline: 3px solid var(--ink); outline-offset: -3px; }

/* the frame is always square, as big as the screen lets it be, and the text boxes stack on one spot to cross fade, the space they need held open */
.carousel { align-items: center; }
.ca-frame { width: min(100%, calc(100svh - 28px)); max-height: none; justify-self: center; margin-left: 0; }
.ca-text { display: grid; align-self: center; }
.ca-layer { position: relative; inset: auto; grid-area: 1 / 1; padding: 6px 4px; }
.ca-layer .textbox { overflow: visible; }
@media (max-width: 760px) { .ca-frame { width: 100%; } .ca-text { min-height: 0; } }

/* a track with no art: its note sits above the play button */
.ab-blank { align-items: flex-start; padding-top: 10%; }

/* the wheel's button is the LA logo itself, cut to its own shape: the dark plate on light themes, the light one on dark */
.wh-hub, .wh-hub:active { background: url(/media/hub-dark.png) center / 100% 100% no-repeat; border: 0; box-shadow: none; border-radius: 0 42% 0 0 / 0 38% 0 0; transform-origin: 0 100%; transition: transform .15s ease, filter .15s ease; }
:root[data-scheme="dark"] .wh-hub { background-image: url(/media/hub-light.png); }
.wh-hub:hover { filter: brightness(1.15); transform: scale(1.02); }
.wh-hub:active { transform: scale(0.98); }
.wh-hub:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* the hole in the wheel: the logo's own outline plus a small gap, still while the cards turn underneath it */
.wh-plate { position: absolute; left: 0; bottom: 0; z-index: 2; display: block; }
.wh-plate path { fill: var(--page); stroke: none; }
.wh-hub, .wh-hub:active { border-radius: 0 43% 0 0 / 0 36% 0 0; }

/* the Utilities page: the square tiles, in a panel with a line between the groups */
.tilepanel { padding: 18px; }
.links.pin-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(71px, 1fr)); }
.tile-group + .tile-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid color-mix(in srgb, var(--ink) 32%, transparent); }
.pin-tile { background: var(--page); border: 1px solid var(--line); border-radius: 8px; box-shadow: inset 2px 2px 0 var(--hi), inset -2px -2px 0 var(--lo); padding: 4px 3px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; text-decoration: none; color: var(--ink); gap: 2px; font-size: 9.6px; line-height: 1.05; transition: transform .1s ease; height: 71px; overflow: hidden; }
.pin-tile:hover { transform: translateY(-2px); }
.pin-tile:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.pin-tile .icon { font-size: 24px; line-height: 1; }
.pin-tile.disabled { opacity: .4; pointer-events: none; }
@media (max-width: 620px) {
  .links.pin-grid { gap: 8px; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .pin-tile { height: 84px; font-size: 10.5px; padding: 6px 4px 5px; }
  .pin-tile .icon { font-size: 26px; }
}
@media (hover: none) and (pointer: coarse) {
  .pin-tile.pc-na { opacity: .4; position: relative; }
  .pin-tile.pc-na::after { content: "PC"; position: absolute; top: 2px; right: 3px; font-size: 8px; letter-spacing: .04em; opacity: .8; }
}
.pin-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 10px 16px; font-size: 13px; z-index: 100; max-width: 80vw; text-align: center; }
.editing .tile-group { position: relative; padding-top: 48px; outline: 1px dashed var(--muted); outline-offset: -1px; }

/* the carousel has no window: it lies on the page, reaches in behind the text, and fades into the page on every side */
.carousel { align-items: center; position: relative; }
.ca-text { z-index: 2; }
.ca-frame { width: 100%; height: min(calc(100svh - 28px), 62vw); aspect-ratio: auto; max-height: none; overflow: visible; border-radius: 0; background: none; justify-self: stretch; }
.ca-frame:focus-visible { box-shadow: none; outline: 1px dashed var(--muted); outline-offset: -1px; }
.ca-canvas { left: -24%; top: -5%; width: 124%; height: 110%; inset: -5% 0 -5% -24%; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 26%, #000 84%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 26%, #000 84%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 13%, #000 87%, transparent 100%);
  -webkit-mask-composite: source-in; mask-composite: intersect; }
@media (max-width: 760px) {
  .ca-frame { height: 96vw; }
  .ca-canvas { left: 0; top: -4%; width: 100%; height: 108%; inset: -4% 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 90%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 8%, #000 90%, transparent 100%), linear-gradient(to bottom, transparent 0, #000 10%, #000 90%, transparent 100%); }
}

/* the background is the theme's tan (its panel color). its blue (the page color) is kept for frames and tiles */
#workspace { background: var(--panel); }
.wh-plate path { fill: var(--panel); }
/* the gallery has no big frame: each piece has its own, blue then tan */
.block.bevel.mosaic { background: none; border: 0; box-shadow: none; padding: 0; }
.mosaic > h2 { margin: 4px 0 12px; }
.mo-wall .card, .bd-item.card, .mode-grid .card, .mode-masonry .card, .mode-strip .card, .mode-spotlight .card { --fr: 8px; padding: var(--fr); background: var(--panel); border: 1px solid var(--line); box-shadow: inset 0 0 0 5px var(--page); }
.card img, .card > .plain { border-radius: calc(var(--radius) * 0.25px); }
.card .hovervid { position: absolute; left: var(--fr, 0px); top: var(--fr, 0px); width: calc(100% - 2 * var(--fr, 0px)); height: calc(100% - 2 * var(--fr, 0px)); border-radius: calc(var(--radius) * 0.25px); }
.card .play { left: calc(var(--fr, 0px) + 10px); bottom: calc(var(--fr, 0px) + 10px); }
.card figcaption { left: var(--fr, 0px); right: var(--fr, 0px); bottom: var(--fr, 0px); }

/* ======== browsing: a header that stays, jump links, room to breathe ======== */
html { scrollbar-gutter: stable; }
html.lb-open { overflow: hidden; }
header.top { position: sticky; top: 12px; z-index: 15; flex-wrap: nowrap; padding: 6px 12px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex: none; border-radius: 6px; }
.brand:focus-visible, .jump a:focus-visible, .wh-stage:focus-visible, .card:focus-visible, .chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
header.top img { height: 36px; }
.brand h1 { font-size: 18px; white-space: nowrap; }
.navs { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px; }
.navs::-webkit-scrollbar { display: none; }
nav.pages, .jump { display: flex; gap: 6px; flex: none; flex-wrap: nowrap; align-items: center; }
.jump { margin-left: 6px; padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.jump a { padding: 5px 8px; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; border-radius: 6px; }
.jump a:hover { text-decoration: underline; }
.jump a.on { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
#themebtn { flex: none; }
.btn[disabled] { opacity: .45; cursor: default; }
main { gap: clamp(22px, 4vh, 56px); }
main > section, main .tile-group { scroll-margin-top: 84px; }
.hero { min-height: calc(100svh - 96px); }
.hero-next { position: absolute; right: 4px; bottom: 8px; z-index: 4; width: 40px; height: 40px; justify-content: center; font-size: 18px; }
.wh-side:has(> .textbox:empty) { pointer-events: none; }
.mosaic > h2, .mu-title { text-align: center; font-size: clamp(28px, 5vw, 60px); margin: 0 0 22px; font-weight: 700; color: var(--ink); }
.music { padding-top: 10px; }
.card .play { position: absolute; left: calc(var(--fr, 0px) + 10px); bottom: calc(var(--fr, 0px) + 10px); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; padding: 0; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .5); border: 1px solid rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: none; transition: opacity .2s ease; }
.card:has(.hovervid) .play { opacity: 0; }
.mo-wall .card, .bd-item.card { cursor: zoom-in; }
.mo-wall .card:hover { filter: brightness(1.04); }

/* the carousel's arrows and where you are */
.ca-nav { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 8px; padding: 4px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; }
.ca-nav .btn { width: 34px; height: 34px; padding: 0; justify-content: center; font-size: 18px; border-radius: 50%; }
.ca-where { font-size: 13px; min-width: 44px; text-align: center; color: var(--ink); }
.ca-frame.flat { height: auto; overflow: visible; cursor: default; }
.ca-none { height: auto; overflow: visible; padding: 0; gap: 10px; }
.ca-none .card { width: 100%; }

/* the music wall centres a short last row, and keeps its arch */
.mu-wall { --g: clamp(10px, 2vw, 24px); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--g); }
.mu-wall .mu-tile, .mu-wall .mu-tile:nth-child(n) { width: calc((100% - (var(--cols) - 1) * var(--g)) / var(--cols)); margin-top: var(--arch, 0px); }

/* the full view */
#lightbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 8px; }
.lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; flex: 0 1 auto; max-width: 100%; }
#lightbox img, #lightbox video { display: block; max-width: 96vw; max-height: 84svh; object-fit: contain; background: #000; }
.lb-audio { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lb-audio img { max-height: 60svh; }
.lb-info { color: #fff; text-align: center; font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; max-width: min(90vw, 70ch); min-height: 1.2em; }
.lb-info p { flex-basis: 100%; margin: 0; font-size: 13px; opacity: .85; white-space: pre-wrap; }
#lightbox .btn { position: absolute; width: 44px; height: 44px; padding: 0; justify-content: center; font-size: 20px; z-index: 1; }
#lightbox .lb-close { top: 12px; right: 12px; }
#lightbox .lb-prev { left: 12px; top: calc(50% - 22px); }
#lightbox .lb-next { right: 12px; top: calc(50% - 22px); }

.login { align-items: stretch; }
.login a { font-size: 13px; text-align: center; }
.linkbtn { background: none; border: 0; padding: 0 2px; cursor: pointer; text-decoration: underline; color: inherit; font-size: 12px; }

/* ======== phones ======== */
@media (hover: none) and (pointer: coarse), (max-width: 760px) {
  .btn { min-height: 40px; padding: 6px 12px; }
  .jump a { padding: 10px 8px; }
  .ab-play { min-width: 44px; }
  .ab-bar { height: 24px; }
}
@media (max-width: 760px) {
  #shell { padding: 4px; }
  #workspace { padding: 6px; border-radius: 16px; }
  header.top { top: 6px; padding: 4px 6px; gap: 6px; }
  header.top img { height: 32px; }
  .brand h1, .tlabel { display: none; }
  .hero { grid-template-rows: auto auto; min-height: 0; }
  .wh-stage { height: min(60svh, 92vw); }
  .wh-side { padding: 0; }
  .wh-side:has(> .textbox:empty) { display: none; }
  .hero-next { display: none; }
  .mu-wall .mu-tile, .mu-wall .mu-tile:nth-child(n) { width: calc((100% - var(--g)) / 2); }
  #lightbox .lb-prev, #lightbox .lb-next { top: auto; bottom: 12px; }
  .ca-nav { bottom: -2px; }
}

/* ======== the editor ======== */
#shell.editing { padding-bottom: 92px; }
.editing .hero { grid-template-rows: minmax(420px, calc(100svh - 240px)) auto auto; min-height: 0; }
.editing .carousel { grid-template-rows: auto auto auto; }
.editing .tray, .editing .addzone { grid-column: 1 / -1; }
.is-hidden { opacity: .45; }
.is-hidden:hover { opacity: .8; }
[contenteditable]:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .75; pointer-events: none; }
.editing [contenteditable]:hover { outline-style: solid; }
.editing .wh-side .textbox { min-width: 240px; }
.editing .card, .editing .chip, .editing .mu-tile { cursor: pointer; }
.editing .mu-tile { position: relative; }
.sel, .card.sel, .mu-tile.sel, .chip.sel { outline: 3px solid var(--ink) !important; outline-offset: 2px; }
.editing .mu-tile:hover .cardbar, .editing .mu-tile:focus-within .cardbar, .editing .chip:hover .cardbar, .editing .chip:focus-within .cardbar, .editing .card:hover .cardbar { display: flex; }
.chip { position: relative; flex: 0 0 132px; padding: 4px; cursor: pointer; }
.chipname { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.chipblank { display: flex; align-items: center; justify-content: center; color: var(--paper); }
.tray { align-items: stretch; background: none; border: 0; padding: 4px 0; }
.addzone { display: block; width: 100%; margin-top: 10px; padding: 14px; background: none; color: var(--ink); border: 2px dashed var(--muted); border-radius: calc(var(--radius) * 0.6px); cursor: pointer; font-size: 13px; }
.addzone:hover, .addzone:focus-visible { background: var(--paper); border-color: var(--ink); outline: none; }
.blockbar .btn { min-height: 30px; padding: 3px 9px; }
.bl-name { font-size: 12px; font-weight: 700; padding: 0 4px; white-space: nowrap; }
.linklist { margin-top: 6px; }
/* a drop marker shows over a piece's frame, not under it */
.mo-wall .card.drop-before, .chip.drop-before, .mu-tile.drop-before { box-shadow: -5px 0 0 var(--ink), inset 0 0 0 5px var(--page); }
.mo-wall .card.drop-after, .chip.drop-after, .mu-tile.drop-after { box-shadow: 5px 0 0 var(--ink), inset 0 0 0 5px var(--page); }
main > .drop-here, .tile-group.drop-here { outline: 3px solid var(--ink) !important; outline-offset: -3px; }
/* the panel sits beside the page instead of over it, so what you are changing stays in view */
@media (min-width: 1000px) { body.drawer-open #shell { margin-right: 356px; } }
#drawer { width: 348px; top: 8px; right: 8px; bottom: 8px; padding: 12px; gap: 10px; }
#drawer .dr-close { position: absolute; top: 8px; right: 8px; min-height: 30px; padding: 2px 9px; }
#drawer h3 { font-size: 15px; padding-right: 40px; margin-top: 4px; }
#drawer p { margin: 0; font-size: 13px; }
#drawer small { font-size: 11px; color: var(--muted); }
#drawer .row { flex-wrap: wrap; }
#drawer .row.between { justify-content: space-between; }
#drawer .row.four .fld { flex: 1 1 60px; min-width: 0; }
#drawer .row > .btn { flex: 0 1 auto; }
#drawer > .btn { justify-content: center; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700; }
.fld > .field, .fld textarea, .fld select { width: 100%; font-weight: 400; font-size: 13px; }
.fld.chk { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 400; font-size: 13px; cursor: pointer; }
.fld.chk input { width: 18px; height: 18px; }
.fld .row input[type=range] { flex: 1; min-width: 80px; }
.fld output { font-weight: 400; min-width: 44px; text-align: right; }
.pv { width: 100%; max-height: 180px; object-fit: contain; background: var(--line); border-radius: 6px; display: block; }
.pv.small { max-height: 70px; width: auto; }
.fname { word-break: break-all; }
.btn.danger { color: #b3263c; justify-content: center; }
.seg .btn { flex: 1 1 auto; justify-content: center; }
#drawer .libgrid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.libitem { position: relative; padding: 0; aspect-ratio: 1; overflow: hidden; cursor: pointer; background: var(--line); border: 2px solid var(--line); border-radius: 6px; display: block; }
.libitem img { width: 100%; height: 100%; object-fit: cover; display: block; }
.libitem.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--ink); outline: none !important; }
.libitem:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.libblank { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: #fff; font-size: 24px; }
.libname { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 3px 2px; font-size: 9px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.libtype, .libused { position: absolute; top: 3px; width: 17px; height: 17px; font-size: 9px; line-height: 17px; text-align: center; border-radius: 50%; color: #fff; background: rgba(0, 0, 0, .65); }
.libtype { left: 3px; } .libused { right: 3px; background: #1d7a46; }
.libnone { grid-column: 1 / -1; }
.pagerow { display: flex; flex-direction: column; gap: 5px; padding-bottom: 8px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 20%, transparent); }
.pagerow .row .field { flex: 1 1 100%; }
#tray { gap: 10px; }
.tr-top { display: flex; justify-content: space-between; gap: 8px; }
.tr-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-name.bad { white-space: normal; }
.tr-tools { display: flex; gap: 8px; flex: none; }
#edbar { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
body.drawer-open #edbar { right: 366px; }
#edreload[hidden] { display: none; }
@media (max-width: 999px) {
  body.drawer-open #edbar { right: 10px; }
  #drawer { left: 8px; right: 8px; top: auto; width: auto; bottom: 8px; max-height: 58svh; z-index: 45; }
}
@media (max-width: 760px) {
  #edbar { left: 6px; right: 6px; bottom: 6px; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; }
  #edbar .btn { flex: none; }
  .bd-h { width: 22px; height: 22px; }
}

/* the carousel fits under the header, so its arrows are always on screen */
.ca-frame { height: min(calc(100svh - 104px), 62vw); }
@media (max-width: 760px) { .ca-frame { height: min(96vw, calc(100svh - 150px)); } }

/* messages sit above the edit bar */
body.is-editing .pin-toast { bottom: 76px; }

/* an embed that opens on its own address */
.embed-away { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 16px; text-align: center; }
.embed-away p { margin: 0; }
.embed-away .row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.embed-alt { margin: 6px 0 0; font-size: 12px; text-align: right; }
.embed-alt a { color: var(--muted); }
