.gallery-board {
    --header-map: url("/art/pokedex/appearance-studio.webp");
    --map-position: 58%;
    --stage-tint: var(--type, #aac4d1);
}
.gallery-board[data-shiny] { --stage-tint: #e5c57e; }
.gallery-head { padding-top: 0; }
.gallery-head::before { width: min(90%, 860px); }
.gallery-heading {
    display: grid; grid-template-columns: minmax(0, 1fr) min(54%,516px); gap: 12px;
    align-items: center; min-height: 142px; padding: 10px 0 0;
}
.gallery-heading > div { min-width: 0; }
.gallery-crumb, .gallery-related, .gallery-toolbar, .gallery-matches { display: flex; align-items: center; gap: 10px; }
.gallery-crumb { color: var(--muted); font-size: .85rem; margin-bottom: 3px; }
.gallery-crumb a, .gallery-related a { display: inline-flex; align-items: center; min-height: 34px; font-weight: 600; }
.gallery-crumb a { color: var(--paper); }
.gallery-crumb span:last-child { font: .8rem ui-monospace, monospace; }
.gallery-heading h1 { line-height: 1.02; overflow-wrap: anywhere; }
.gallery-related { margin-top: 5px; gap: 18px; flex-wrap: wrap; row-gap: 0; }
.gallery-related a { gap: 6px; font-size: .87rem; color: #dfe0e4; }
.gallery-related a span, .gallery-matches a { color: var(--gold); }
.gallery-subject { width: min(100%,155px); height: 134px; justify-self: center; object-fit: contain; translate: 0 12px; filter: drop-shadow(0 6px 5px #10151d80); }
.gallery-palettes { margin-top: 0; }
.gallery-palettes a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; white-space: nowrap; }
.gallery-palettes small { color: #c9cbd2; font-weight: 500; font-size: .8rem; }
.gallery-toolbar { justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 14px 0 0; }
.gallery-toolbar .board-search { margin: 0; max-width: 430px; }
.gallery-kinds a { min-height: 40px; }
.gallery-matches { margin-top: 10px; color: var(--muted); font-size: .86rem; }
.appearance-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.look-tile { min-width: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--edge); border-radius: 10px; background: var(--panel); }
.look-tile:focus-within { border-color: var(--gold); }
.look-stage, .look-comparison figure { position: relative; isolation: isolate; }
.look-stage {
    display: grid; place-items: center; min-height: 134px; padding: 7px;
    background: radial-gradient(ellipse at 50% 78%,color-mix(in srgb,var(--stage-tint) 20%,transparent),transparent 78%),#272b32;
}
.look-stage::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: radial-gradient(circle, #e6efff30 .8px, transparent 1px) 0 0 / 11px 11px;
    mask-image: linear-gradient(135deg, #0009, transparent 48%, transparent 74%, #0008);
}
.look-stage img { object-fit: contain; width: 114px; max-width: 90%; height: 114px; filter: drop-shadow(0 3px 3px #15182055); transition: transform .16s ease-out; }
@media (hover: hover) {
    .look-stage:hover img { transform: translateY(-2px) scale(1.035); }
    .look-stage:hover .look-expand { color: var(--gold); }
}
.look-stage:active img { transform: scale(.97); }
.look-expand {
    position: absolute; top: 9px; right: 9px; display: grid; place-items: center; width: 22px; height: 22px;
    color: #d3d8df; font: normal 13px/1 Icons;
}
.look-expand::before { content: "\f065"; }
.look-base { position: absolute; bottom: 4px; border-radius: 4px; padding: 1px 5px; background: #1c2029ed; color: #e1e3e8; font-size: .72rem; }
.look-identity { flex: 1; padding: 12px 12px 10px; }
.look-identity h2 { margin: 0 0 5px; overflow-wrap: anywhere; font: 690 1.49rem/1.1 Cond,sans-serif; }
.look-status { color: var(--muted); font-size: .79rem; }
.look-status[data-released] { color: #e9cb88; }
.look-status[data-released]::before { content: "✦"; margin-right: 4px; }
.look-sightings, .look-preview-find { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; color: var(--paper); font-size: .85rem; font-weight: 610; }
.look-sightings { border-top: 1px solid #ffffff10; background: #1e2229; padding: 0 12px; }
.look-sightings span, .look-preview-find span { color: var(--gold); }
.look-tile a:focus-visible { outline-offset: -3px; }
.gallery-empty { margin-top: 16px; }
.gallery-empty a { padding-block: 10px; color: var(--gold); }
.look-dialog {
    inset: 0; width: min(485px, calc(100% - 24px)); max-height: 88dvh; margin: auto; padding: 0;
    border: 1px solid #4a505b; border-radius: 12px; background: #22262e; color: var(--ink); box-shadow: 0 25px 80px #0008;
}
.look-dialog::backdrop { background: #0b0d14c9; }
body:has(.look-dialog[open]) { overflow: hidden; }
.look-dialog-head, .look-dialog-meta, .look-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; }
.look-dialog-head p { color: var(--muted); font-size: .85rem; }
.look-dialog-head { position: sticky; top: 0; z-index: 1; background: #22262e; }
.look-dialog-head h2 { font: 700 1.9rem/1.1 Cond,sans-serif; overflow-wrap: anywhere; }
.look-close { align-self: flex-start; width: 42px; height: 42px; flex: none; border-radius: 6px; font-size: 1.6rem; }
.look-close:hover, .look-pager button:hover { background: #ffffff0e; color: var(--gold); }
.look-comparison { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 1px; background: #383d46; }
.look-comparison figure {
    display: grid; justify-items: center; align-items: end; gap: 8px; padding: 14px 8px 10px; margin: 0;
    background: radial-gradient(ellipse at 50% 70%,#36434a,#252931 85%);
}
.look-comparison [data-shiny-figure] { background: radial-gradient(ellipse at 50% 70%,#494337,#282a30 85%); }
.look-comparison img { display: block; width: auto; height: auto; max-width: 100%; max-height: 175px; align-self: center; object-fit: contain; }
.look-comparison figure { grid-template-rows: 175px auto; }
.look-comparison figcaption { font-size: .84rem; font-weight: 600; color: #d6dbe3; }
.look-comparison [data-shiny-figure] figcaption { color: #f0d194; }
.look-dialog [hidden] { display: none; }
.look-dialog-meta { padding-block: 2px; }
.look-pager { border-top: 1px solid var(--edge); padding: 4px 8px; color: var(--muted); font-size: .84rem; }
.look-pager button { padding: 0 8px; min-height: 44px; color: var(--paper); border-radius: 6px; }
@media (max-width: 960px) { .appearance-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
@media (max-width: 740px) {
    .appearance-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; }
    .gallery-heading { min-height: 114px; }
    .gallery-subject { height: 105px; }
    .gallery-toolbar .board-search { order: 0; flex: 1 1 240px; }
}
@media (max-width: 580px) {
    body:has(.gallery-board) .mast nav { flex-wrap: nowrap; min-width: 0; justify-content: space-between; gap: 8px; }
    .gallery-heading { grid-template-columns: minmax(0,1fr) 25%; gap: 4px; padding: 3px 13% 0 0; }
    .gallery-heading h1 { font-size: clamp(2rem,8vw,2.7rem); }
    .gallery-related { column-gap: 6px; }
    .gallery-related a { font-size: .78rem; }
    .gallery-subject { height: 90px; translate: 0 6px; }
    .gallery-head::before {
        width: 82%; bottom: 24px;
        /* Keep the center of the paper in place when a longer title changes the crop. */
        background-position: center, 71% var(--map-position);
        mask-image: linear-gradient(90deg,transparent 8%,#0004 43%,black 72%,black 94%,transparent);
    }
    .gallery-palettes { gap: 16px; }
    .gallery-palettes a { font-size: .89rem; gap: 4px; }
    .gallery-toolbar { margin-top: 8px; }
    .gallery-toolbar .board-search { flex-basis: 100%; max-width: none; }
    .gallery-kinds a { min-height: 38px; }
    .appearance-grid { grid-template-columns: repeat(2,minmax(0,1fr)); margin-top: 9px; }
    .look-stage { min-height: 107px; }
    .look-stage img { width: 96px; height: 96px; }
    .look-expand { right: 4px; top: 5px; }
    .look-identity { padding: 9px; }
    .look-identity h2 { font-size: 1.34rem; }
}
