/*
 * The gig poster studio at /tools/poster/ — laid out as an editor.
 *
 * The layout is the design frame's shell (static/js/design/shell.js and
 * design_frame.css, since the renovation's Phase 4): three panes on a laptop,
 * what the poster says on the left, the poster sticky in the middle at the
 * size the window allows, how it looks on the right; below 1200px the rails
 * stack beside the poster; on a phone the poster is on top and every panel is
 * a sheet from the tab bar. What is here is the poster's own: its columns, a
 * stage as tall as the window, the rails' cards, and the fields and chips.
 */

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

.ps-wrap { margin: 96px auto 4rem; padding: 0 1.25rem; color: #ccc; max-width: 1840px; }
/* `hidden` always wins in the studio. Without it a class that sets display
   (.ps-file-btn) beat the attribute, so the logo's Remove button showed with
   no logo uploaded. The same rule as the logo maker's (.lg-wrap). */
.ps-wrap [hidden] { display: none !important; }
.ps-art-listing { margin-top: .6rem; }

.ps-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.5rem; margin-bottom: 1rem; }
.ps-head h1 {
    font-family: 'Inter', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em;
    color: #fff; font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; margin: 0;
}
.ps-tagline { color: #8f8f8f; max-width: 760px; line-height: 1.55; margin: 0; font-size: .92rem; }

.ps-error { background: rgba(255,0,0,.1); border: 1px solid #ff0000; color: #ff9999; padding: .8rem 1rem; border-radius: 4px; margin-bottom: 1rem; }
.ps-noscript { background: #141414; border: 1px solid #333; padding: 1rem; border-radius: 5px; margin-bottom: 1rem; color: #aaa; }

/* ---- the editor --------------------------------------------------------------- */

.ps-editor { scroll-margin-top: 92px; }
.ps-editor .df-shell-body { grid-template-columns: 330px minmax(0, 1fr) 370px; gap: .9rem; }

/* The rails are cards; each of the shell's panels in them is a section. The
   frame's stylesheet comes after this one, so these say .ps-editor to win. */
.ps-rail { background: #0d0d0d; border: 1px solid #222; border-radius: 8px; }
.ps-editor .ps-pane { padding: .9rem; margin: 0; }
.ps-rail--right .ps-pane + .ps-pane { border-top: 1px solid #1d1d1d; }
@media (min-width: 900px) {
    /* The left rail shows one panel at a time, picked by its tabs (page.js). */
    .ps-rail .ps-pane.is-off { display: none; }
    /* The phone's Download sheet: on a laptop its buttons are in the stage's bar. */
    .ps-files { display: none; }
}

.ps-rail-tabs { display: flex; border-bottom: 1px solid #222; flex: 0 0 auto; }
.ps-rail-tab {
    flex: 1 1 0; background: none; border: 0; border-bottom: 2px solid transparent;
    color: #8c8c8c; padding: .75rem .5rem .65rem; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; cursor: pointer; font-family: inherit;
    margin-bottom: -1px;
}
.ps-rail-tab:hover { color: #ddd; }
.ps-rail-tab.is-active { color: #fff; border-bottom-color: #ff0000; }
.ps-rail-tab span { color: #666; font-weight: 600; margin-left: .25rem; }

/* Stickers: a card each, a row of chips per choice. */
.ps-stickers { display: flex; flex-direction: column; gap: .7rem; margin-bottom: .7rem; }
.ps-stickers:empty { display: none; }
/* The acts on the bill (page.js renderActs): a row each, its face and logo. */
.ps-acts { display: flex; flex-direction: column; gap: .5rem; }
.ps-act { border: 1px solid #262626; border-radius: 6px; padding: .55rem .6rem; background: #111; }
.ps-act-head { display: flex; align-items: baseline; gap: .5rem; margin-bottom: .4rem; }
.ps-act-name { color: #eee; font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-act-role { color: #777; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; margin-left: auto; flex: 0 0 auto; }
.ps-act-tools { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.ps-act-tools .ps-select { max-width: 11rem; }
.ps-act-btn { padding: .32rem .6rem; font-size: .76rem; }
.ps-act-keep { font-size: .76rem; }
.ps-act-note { margin-top: .35rem; }
.ps-sticker { border: 1px solid #262626; border-radius: 6px; padding: .6rem; background: #111; }
.ps-sticker.is-selected { border-color: #ff0000; }
.ps-sticker-head { display: flex; gap: .45rem; align-items: center; margin-bottom: .45rem; }
.ps-sticker-head .ps-select { flex: 1 1 auto; }
.ps-sticker-text { width: 100%; margin-bottom: .45rem; }
.ps-sticker-row { display: flex; gap: .5rem; align-items: baseline; margin-top: .35rem; }
.ps-sticker-label { flex: 0 0 3.6rem; font-size: .7rem; color: #777; text-transform: uppercase; letter-spacing: .06em; }
.ps-chips-inline { display: flex; flex-wrap: wrap; gap: .3rem; }
.ps-chip:disabled { opacity: .35; cursor: not-allowed; }

/* "Move it freely" (the free layers, renovation Phase 5): a lifted item's
   button says how to put it back, in red. */
.ps-lift { padding: .32rem .6rem; font-size: .76rem; }
.ps-lift.is-on { border-color: #ff0000; color: #fff; background: rgba(255,0,0,.1); }
.ps-lift-row { margin-top: .55rem; }
.ps-free-row { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.ps-free-row input[type="text"] { flex: 1 1 10rem; min-width: 0; }
.ps-free-row + .ps-free-row, .ps-field + .ps-free-row { margin-top: .55rem; }
.ps-layers-panel .df-layers { margin-bottom: .7rem; }

/* Sponsor logos waiting to go on the poster. */
.ps-sponsors { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .6rem; }
.ps-sponsors:empty { display: none; }
/* Mid grey, so a black logo and a white one both show. */
.ps-sponsor { position: relative; background: #8a8a8a; border: 1px solid #2c2c2c; border-radius: 4px; line-height: 0; }
.ps-sponsor canvas { width: 96px; height: 52px; }
.ps-sponsor-remove { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #ff0000; color: #fff; font-size: .8rem; line-height: 20px; cursor: pointer; padding: 0; }
.ps-sponsor-lift { display: block; width: 100%; margin-top: 2px; border-radius: 0 0 4px 4px; line-height: 1.2; padding: .2rem .3rem; font-size: .66rem; }

/* The last few posters made on this device. */
.ps-recent { margin: -.2rem 0 1rem; }
.ps-recent-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .7rem; color: #777; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .45rem; }
.ps-recent-head a { color: #ff4d4d; text-transform: none; letter-spacing: 0; font-size: .76rem; }
.ps-recent-list { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .3rem; }
.ps-recent-item { flex: 0 0 auto; padding: 0; border: 1px solid #2a2a2a; border-radius: 3px; background: #111; cursor: pointer; line-height: 0; }
.ps-recent-item:hover, .ps-recent-item:focus-visible { border-color: #ff0000; outline: none; }
.ps-recent-item img { height: 64px; width: auto; display: block; }
.ps-opened { margin: 0 0 .9rem; padding: .55rem .7rem; border: 1px solid #2c4a2c; background: #101a10; border-radius: 4px; color: #9fcf9f; }

/* The stamp nudge. */
.ps-suggest { margin-left: .4rem; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: #0c0c0c; background: #ffd23f; border-radius: 3px; padding: .05rem .3rem; }
.ps-stamp-past { color: #e3b35a; }

/* A field for another bill mode. .ps-row and .ps-field set their own display,
   which would otherwise beat the hidden attribute. */
[data-bill][hidden] { display: none !important; }

.ps-panel { border-bottom: 1px solid #1d1d1d; padding: .2rem 0 1.1rem; margin-bottom: 1rem; }
.ps-panel:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: .2rem; }
.ps-panel h2 { color: #fff; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; border-left: 3px solid #ff0000; padding-left: .6rem; margin: 0 0 .9rem; }

/* The middle pane (the shell's sticky stage): the poster, with the whole
   toolbar in one row above it so no height goes to buttons. */
.ps-stage {
    container-type: inline-size; container-name: stage;
    background: #080808; border: 1px solid #1d1d1d; border-radius: 8px; overflow: hidden;
    background-image: radial-gradient(#161616 1px, transparent 1px); background-size: 18px 18px;
}
.ps-editor .ps-stage-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: .45rem;
    margin: 0; padding: .55rem .6rem; background: rgba(12,12,12,.92); border-bottom: 1px solid #1d1d1d;
}
.ps-stage-bar .ps-spacer { flex: 1 1 auto; }
.ps-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.ps-bar-actions > span:not([hidden]) { display: contents; }
.ps-bar-btn {
    background: #151515; border: 1px solid #2f2f2f; color: #ddd; border-radius: 5px;
    padding: .45rem .8rem; font-size: .8rem; font-weight: 600; cursor: pointer; font-family: inherit;
    white-space: nowrap;
}
.ps-bar-btn:hover:not(:disabled) { border-color: #ff0000; color: #fff; }
.ps-bar-btn:disabled { opacity: .4; cursor: default; }
.ps-bar-btn[hidden] { display: none; }
.ps-bar-btn--icon { padding: .45rem .62rem; }
.ps-bar-btn--primary { background: #ff0000; border-color: #ff0000; color: #fff; }
.ps-bar-btn--primary:hover:not(:disabled) { background: #d51007; }
.ps-bar-btn--outline { background: transparent; border-color: #ff0000; color: #ff4d4d; }
.ps-stage-hint { font-size: .74rem; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }

/* The shell's stage box, as tall as the window leaves under the header, the
   bar and the status line: the poster is contained in it (page.js
   fitCanvas), so a Facebook cover runs the width and a story the height. */
.ps-editor .ps-canvas-box {
    aspect-ratio: auto; max-height: none;
    background: transparent; border-radius: 0;
    display: flex; align-items: center; justify-content: center; padding: 1.1rem;
}
/* Only above the phone: there the shell sizes the box to what a sheet leaves. */
@media (min-width: 900px) {
    .ps-editor .ps-canvas-box { min-height: 480px; height: calc(100vh - var(--df-header) - 136px); }
}
.ps-editor .ps-stage-foot { margin: 0; padding: 0 .8rem; min-height: 1.9rem; }
.ps-stage-foot .df-status { margin: .45rem 0; font-size: .76rem; color: #8fbf95; opacity: 1; }
.ps-stage-foot .df-status.is-error { color: #e39a9a; }
.ps-canvas-box canvas { display: block; box-shadow: 0 14px 44px rgba(0,0,0,.7); cursor: grab; }
.ps-canvas-box canvas.ps-dragging { cursor: grabbing; }
.ps-drag-hint { position: absolute; left: 50%; bottom: .6rem; transform: translateX(-50%); font-size: .72rem; color: #8a8a8a; background: rgba(0,0,0,.6); padding: .25rem .6rem; border-radius: 20px; pointer-events: none; }


/* The toolbar stays one row as the pane narrows: the hint goes first. */
@container stage (max-width: 940px) { .ps-stage-hint { display: none; } }
@container stage (max-width: 680px) { .ps-bar-label { display: none; } }
@container stage (max-width: 560px) { .ps-bar-btn { padding: .42rem .6rem; font-size: .76rem; } }

/* "Show me 12 versions": a grid over the poster, which stays where it was. */
.ps-versions {
    position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column;
    background: rgba(8,8,8,.97);
}
.ps-versions[hidden] { display: none; }
.ps-versions-head { display: flex; align-items: center; gap: .45rem; padding: .6rem .8rem; border-bottom: 1px solid #1d1d1d; flex: 0 0 auto; }
.ps-versions-head strong { color: #fff; font-size: .9rem; }
.ps-versions-head .ps-spacer { flex: 1 1 auto; }
.ps-versions-note { margin: .6rem .9rem 0; font-size: .76rem; color: #8a8a8a; flex: 0 0 auto; }
.ps-versions-grid {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: .8rem .9rem 1rem;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem .8rem;
    align-content: start;
}
.ps-version { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.ps-version-use {
    display: block; padding: 0; line-height: 0; cursor: pointer; background: #111;
    border: 2px solid transparent; border-radius: 4px; overflow: hidden;
}
.ps-version-use:hover, .ps-version-use:focus-visible { border-color: #ff0000; outline: none; }
.ps-version-use canvas { display: block; width: 100%; height: auto; }
.ps-version.is-picked .ps-version-use { border-color: #ff0000; }
.ps-version-foot { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; font-size: .72rem; color: #8a8a8a; min-width: 0; }
.ps-version-foot span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-version-more { background: none; border: 0; padding: 0; color: #ff4d4d; font-size: .72rem; cursor: pointer; font-family: inherit; }
.ps-version-more:hover { color: #fff; }
#ps-versions[aria-expanded="true"] { border-color: #ff0000; color: #fff; }

/* The share link, as a card over the foot of the poster. */
.ps-share-out {
    display: none; position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%);
    width: min(520px, calc(100% - 2rem)); z-index: 5;
    background: #101a10; border: 1px solid #2c4a2c; border-radius: 6px; padding: .8rem .9rem;
    box-shadow: 0 12px 30px rgba(0,0,0,.6);
}
.ps-share-out.is-error { background: #1a1010; border-color: #4a2c2c; }
.ps-share-out p { margin: 0 0 .5rem; font-size: .84rem; color: #9fd8a7; }
.ps-share-out.is-error p { color: #e39a9a; }
.ps-share-link { display: flex; gap: .5rem; }
.ps-share-link input { flex: 1; min-width: 0; background: #0a0a0a; border: 1px solid #333; color: #ddd; padding: .5rem .7rem; border-radius: 4px; font-size: .8rem; font-family: monospace; }
.ps-share-link button { background: #2c4a2c; border: none; color: #dff5df; padding: .5rem .9rem; border-radius: 4px; cursor: pointer; font-size: .8rem; font-weight: 700; }
.ps-share-close { position: absolute; top: .3rem; right: .45rem; background: none; border: 0; color: #7a9a7a; font-size: 1rem; cursor: pointer; }

.ps-select-box { position: absolute; border: 2px dashed #ff4d4d; border-radius: 3px; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }

/* ---- fields ---------------------------------------------------------------------- */

.ps-field { margin-bottom: .85rem; }
.ps-field:last-child { margin-bottom: 0; }
.ps-field label { display: block; margin-bottom: .3rem; font-size: .7rem; color: #8c8c8c; text-transform: uppercase; letter-spacing: .07em; }
.ps-field input[type="text"], .ps-field textarea {
    width: 100%; background: #161616; border: 1px solid #2c2c2c; color: #eee;
    padding: .55rem .7rem; border-radius: 4px; font-size: .9rem; font-family: inherit;
}
.ps-field input:focus, .ps-field textarea:focus { outline: none; border-color: #ff0000; }
.ps-field textarea { min-height: 80px; resize: vertical; }
.ps-hint { font-size: .72rem; color: #666; margin-top: .3rem; }
.ps-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }

.ps-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.ps-chips label {
    margin: 0; border: 1px solid #2f2f2f; border-radius: 4px; padding: .42rem .7rem;
    cursor: pointer; font-size: .8rem; color: #bbb; text-transform: none; letter-spacing: 0;
    transition: border-color .12s, color .12s, background .12s;
}
.ps-chips input { position: absolute; opacity: 0; pointer-events: none; }
.ps-chips label:has(input:checked) { border-color: #ff0000; color: #fff; background: rgba(255,0,0,.09); }
.ps-chips label:hover { border-color: #4a4a4a; }

/* Size chips carry their pixel dimensions underneath the name — the one fact
   that tells you whether you are about to download something you can print. */
.ps-chips--size label { display: flex; flex-direction: column; gap: .12rem; line-height: 1.25; }
.ps-size-dims { font-size: .66rem; color: #666; letter-spacing: .03em; }
.ps-chips--size label:has(input:checked) .ps-size-dims { color: #c98c8c; }

/* Gig lookup */
.ps-lookup { position: relative; padding-bottom: .8rem; margin-bottom: .9rem; border-bottom: 1px solid #1f1f1f; }
.ps-lookup input { width: 100%; background: #161616; border: 1px solid #2c2c2c; color: #eee; padding: .55rem .7rem; border-radius: 4px; font-size: .9rem; font-family: inherit; }
.ps-lookup input:focus { outline: none; border-color: #ff0000; }
.ps-lookup-results { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #141414; border: 1px solid #333; border-radius: 4px; max-height: 300px; overflow-y: auto; box-shadow: 0 12px 28px rgba(0,0,0,.65); }
.ps-lookup-results.is-open { display: block; }
.ps-lookup-results button {
    display: block; width: 100%; text-align: left; background: none; border: 0;
    border-bottom: 1px solid #222; padding: .6rem .8rem; cursor: pointer;
    color: #ddd; font-family: inherit; font-size: .86rem; line-height: 1.4;
}
.ps-lookup-results button:last-child { border-bottom: 0; }
.ps-lookup-results button:hover, .ps-lookup-results button:focus { background: #1e1e1e; color: #fff; outline: none; }
.ps-lookup-results .ps-lookup-meta { display: block; color: #7d7d7d; font-size: .76rem; margin-top: .12rem; }
.ps-lookup-results .ps-lookup-empty { padding: .7rem .8rem; color: #7d7d7d; font-size: .84rem; }
.ps-prefilled { color: #8fbf95; }

.ps-swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.ps-swatches label { position: relative; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.ps-swatches input { position: absolute; opacity: 0; pointer-events: none; }
.ps-swatches label:has(input:checked) { border-color: #fff; }
.ps-swatches .ps-swatch-custom { background: conic-gradient(#e21d1d, #ffb000, #beff00, #00d6e0, #7a3cff, #e80082, #e21d1d); }
.ps-swatches .ps-swatch-custom input[type="color"] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; pointer-events: auto; }

.ps-art-row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.ps-file-btn { display: inline-block; background: #1a1a1a; border: 1px solid #353535; color: #ddd; padding: .5rem .9rem; border-radius: 4px; cursor: pointer; font-size: .82rem; }
.ps-file-btn:hover { border-color: #ff0000; color: #fff; }
.ps-file-btn input { display: none; }

.ps-toggle { display: flex; align-items: flex-start; gap: .55rem; font-size: .83rem; color: #bbb; cursor: pointer; }
.ps-toggle input { margin-top: .18rem; accent-color: #ff0000; }
.ps-locked { color: #666; cursor: default; }
.ps-locked a { color: #ff4d4d; }

.ps-select {
    width: 100%; background: #161616; border: 1px solid #2c2c2c; color: #eee;
    padding: .5rem .7rem; border-radius: 4px; font-size: .88rem; font-family: inherit;
}
.ps-select:focus { outline: none; border-color: #ff0000; }
.ps-logo-treatments { margin-top: .5rem; }
.ps-print-field { margin-top: .8rem; }

/* ---- looks (templates), in the left rail, by family ---------------------------------- */

.ps-presets-family + .ps-presets-family { margin-top: 1.1rem; }
.ps-presets-head {
    margin: 0 0 .5rem; color: #8f8f8f; font-size: .68rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
}
.ps-presets-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.ps-preset {
    background: #111; border: 1px solid #262626; border-radius: 6px; padding: .45rem .45rem .5rem;
    cursor: pointer; font-family: inherit; color: #9a9a9a; text-align: center;
    transition: border-color .12s, color .12s;
}
.ps-preset:hover { border-color: #4a4a4a; color: #ddd; }
.ps-preset.is-active { border-color: #ff0000; color: #fff; background: rgba(255,0,0,.07); }
/* A fixed box so a story next to a Facebook cover does not make the grid jump. */
.ps-preset-thumb { display: block; width: 100%; height: 150px; object-fit: contain; margin-bottom: .4rem; }
.ps-preset-name { display: block; font-size: .72rem; line-height: 1.3; }
.ps-presets-all { display: block; margin-top: .9rem; color: #ff4d4d; font-size: .8rem; text-decoration: none; text-align: center; }
.ps-presets-all:hover { text-decoration: underline; }

/* ---- Customise ---------------------------------------------------------------------- */

.ps-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.ps-panel-head h2 { margin: 0; }
.ps-reset { background: none; border: 1px solid #333; color: #bbb; border-radius: 4px; padding: .3rem .6rem; font-size: .72rem; cursor: pointer; font-family: inherit; }
.ps-reset:hover:not(:disabled) { border-color: #ff0000; color: #fff; }
.ps-reset:disabled { opacity: .45; cursor: default; }
.ps-tabs { display: flex; flex-wrap: wrap; gap: .1rem; border-bottom: 1px solid #242424; margin-bottom: .9rem; }
.ps-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: #8c8c8c; padding: .45rem .5rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; font-family: inherit; margin-bottom: -1px; }
.ps-tab:hover { color: #ddd; }
.ps-tab.is-active { color: #fff; border-bottom-color: #ff0000; }
.ps-custom-label { font-size: .68rem; color: #8c8c8c; text-transform: uppercase; letter-spacing: .07em; margin-bottom: .3rem; }
.ps-chips--small { gap: .3rem; }
.ps-chip { display: inline-flex; align-items: center; gap: .35rem; background: none; border: 1px solid #2f2f2f; border-radius: 4px; padding: .34rem .55rem; font-size: .76rem; color: #bbb; cursor: pointer; font-family: inherit; }
.ps-chip:hover { border-color: #4a4a4a; color: #eee; }
.ps-chip.is-on { border-color: #ff0000; color: #fff; background: rgba(255,0,0,.09); }
.ps-chip-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.ps-chip-trio { display: inline-flex; gap: 2px; }
.ps-chip-custom input[type="color"] { width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.ps-pane.is-waiting .ps-custom-row { opacity: .55; }
.ps-needs-art { display: none; margin: 0 0 .8rem; }
.ps-pane.is-waiting .ps-needs-art { display: block; }
.ps-faces { max-height: 230px; overflow-y: auto; padding-right: .25rem; }
.ps-chip.ps-face { padding: .3rem .45rem; background: #141414; }
.ps-face-img { display: block; height: 20px; width: auto; max-width: 140px; }
.ps-range { flex: 1 1 160px; accent-color: #ff0000; }
.ps-range-value { min-width: 3.4em; font-size: .78rem; color: #bbb; text-align: right; }

.ps-element { border: 1px solid #222; border-radius: 5px; padding: .45rem .5rem; margin-bottom: .4rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; }
.ps-element.is-selected { border-color: #ff0000; background: rgba(255,0,0,.06); }
.ps-element.is-hidden .ps-element-name { color: #666; text-decoration: line-through; }
.ps-element-name { background: none; border: 0; color: #eee; font-size: .82rem; font-weight: 700; cursor: pointer; font-family: inherit; padding: 0; text-align: left; }
.ps-element-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.ps-element-show { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; color: #aaa; margin-right: .15rem; }
.ps-element-show input { accent-color: #ff0000; }
.ps-element-size { min-width: 2.8em; text-align: center; font-size: .74rem; color: #bbb; }
.ps-icon-btn { background: #161616; border: 1px solid #2f2f2f; color: #ddd; border-radius: 4px; width: 26px; height: 26px; cursor: pointer; font-size: .82rem; line-height: 1; font-family: inherit; }
.ps-icon-btn:hover:not(:disabled) { border-color: #ff0000; }
.ps-icon-btn:disabled { opacity: .35; cursor: default; }
.ps-select--small { width: auto; max-width: 140px; padding: .28rem .35rem; font-size: .74rem; }
.ps-element-add { font-size: .78rem; color: #8c8c8c; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .5rem; }


/* ---- scrollbars -------------------------------------------------------------------- */
/* Thin, dark, and red on hover, in the rails and every list inside them.
   Chromium and Safari take the ::-webkit-scrollbar styles; Firefox, which has
   only the standard properties, gets those — and only those, because Chromium
   drops its own styling the moment the standard ones are set. */

.ps-faces::-webkit-scrollbar,
.ps-lookup-results::-webkit-scrollbar, .ps-versions-grid::-webkit-scrollbar { width: 10px; height: 10px; }
.ps-faces::-webkit-scrollbar-track,
.ps-lookup-results::-webkit-scrollbar-track, .ps-versions-grid::-webkit-scrollbar-track { background: transparent; }
.ps-faces::-webkit-scrollbar-thumb,
.ps-lookup-results::-webkit-scrollbar-thumb, .ps-versions-grid::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 10px; border: 3px solid #0d0d0d; }
.ps-faces::-webkit-scrollbar-thumb:hover,
.ps-lookup-results::-webkit-scrollbar-thumb:hover, .ps-versions-grid::-webkit-scrollbar-thumb:hover { background: #ff0000; }
@supports not selector(::-webkit-scrollbar) {
    .ps-faces, .ps-lookup-results, .ps-versions-grid { scrollbar-width: thin; scrollbar-color: #2c2c2c transparent; }
}

/* ---- below the editor ------------------------------------------------------------------- */

/* Genre landing page extras. The example sits beside its caption: on a genre
   page the caption is doing real work, explaining that the bill is fictional
   but the layout is not. */
.ps-genre-example {
    display: flex; gap: 1.4rem; align-items: flex-start; margin: 2.5rem 0 0; max-width: 1180px;
    background: #0f0f0f; border: 1px solid #242424; border-radius: 6px; padding: 1.2rem;
}
.ps-genre-example img { width: 190px; height: auto; flex-shrink: 0; border-radius: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.55); }
.ps-genre-example figcaption { color: #8f8f8f; font-size: .88rem; line-height: 1.65; }
.ps-genre-example figcaption strong { color: #ddd; }

.ps-below { max-width: 1180px; }
/* The Adsterra banner (poster.html), on the guide's left edge like the
   sections around it. */
.ps-below > .ad-slot--adsterra { margin: 3.5rem 0 0; }
.ps-genre-extra { margin-top: 3.5rem; border-top: 1px solid #222; padding-top: 2.5rem; }
.ps-genre-extra h2 {
    color: #fff; font-size: 1rem; text-transform: uppercase; letter-spacing: .08em;
    border-left: 4px solid #ff0000; padding-left: .75rem; margin: 0 0 1rem;
}
.ps-genre-extra h2 + .bng-genres, .ps-genre-extra ul + h2 { margin-bottom: 2rem; }
.ps-genre-extra .bng-genres { margin-bottom: 2.2rem; }
.ps-genre-note { color: #8f8f8f; font-size: .88rem; line-height: 1.6; margin: 0 0 1rem; }
.ps-genre-events { list-style: none; padding: 0; margin: 0 0 1rem; }
.ps-genre-events li { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid #1e1e1e; padding: .7rem 0; }
.ps-genre-events a { color: #eee; text-decoration: none; font-size: .93rem; }
.ps-genre-events a:hover { color: #ff4d4d; }
.ps-genre-events span { color: #7d7d7d; font-size: .8rem; }
.ps-genre-all { display: inline-block; color: #ff4d4d; font-size: .85rem; font-weight: 700; text-decoration: none; margin-bottom: 2.2rem; }
.ps-genre-all:hover { text-decoration: underline; }

.ps-seo { margin-top: 4rem; border-top: 1px solid #222; padding-top: 2.5rem; }
.ps-seo h2 { color: #fff; font-family: 'Inter', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.02em; font-size: 1.5rem; margin-bottom: 1rem; }
.ps-seo h3 { color: #eee; font-size: 1rem; margin: 1.6rem 0 .5rem; }
.ps-seo p, .ps-seo li { color: #9a9a9a; line-height: 1.7; font-size: .93rem; }
.ps-seo ul { padding-left: 1.2rem; }
.ps-seo p + p { margin-top: .9rem; }
.ps-seo a { color: #ff4d4d; }

/* ---- smaller screens --------------------------------------------------------------------- */

/* A laptop keeps three panes, with slimmer rails. */
@media (max-width: 1439px) {
    .ps-editor .df-shell-body { grid-template-columns: 290px minmax(0, 1fr) 320px; gap: .7rem; }
}

/* Both rails in one column beside the sticky poster (the shell's columns). */
@media (max-width: 1199px) {
    .ps-editor .df-shell-body { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); }
}

/* A phone: the shell's sheets. The poster on top, full width; with no sheet
   open it takes most of the screen, and a sheet brings back the shell's
   shorter stage so the poster still shows above it. The rails' cards and the
   laptop's left tabs go (each panel is a sheet of its own). */
@media (max-width: 899px) {
    /* The shell's phone stage runs full bleed over a 1rem gutter. */
    .ps-wrap { margin-top: 84px; padding: 0 1rem; }
    .ps-rail { background: none; border: 0; border-radius: 0; }
    .ps-rail-tabs { display: none; }
    .ps-rail--right .ps-pane + .ps-pane { border-top: 0; }
    .ps-stage { border: 0; border-radius: 0; container-type: normal; }
    .ps-editor .ps-canvas-box { min-height: 0; padding: .5rem; }
    html:not(.df-sheet-open) .ps-editor .ps-canvas-box {
        height: clamp(260px, calc(100vh - var(--df-header) - var(--df-tabbar) - var(--df-stagebar, 40px) - 56px), 72vh);
        height: clamp(260px, calc(100svh - var(--df-header) - var(--df-tabbar) - var(--df-stagebar, 40px) - 56px), 72svh);
    }
    .ps-stage-hint { display: none; }
    .ps-editor .ps-stage-foot { min-height: 0; }
    /* Seven tabs: the red Download one a little wider, so its word fits. */
    .ps-editor .df-tab--primary { flex-grow: 1.35; }
    /* The Download sheet: every file, one to a row. */
    .ps-files .ps-bar-actions { flex-direction: column; align-items: stretch; gap: .55rem; }
    .ps-files .ps-bar-btn { width: 100%; text-align: left; padding: .7rem .9rem; font-size: .9rem; }
    .ps-files .ps-bar-btn--primary { text-align: center; }
    /* Room for a few rows of versions over a poster only a screen tall. */
    .ps-canvas-box.has-versions { min-height: 78vh; }
    .ps-versions-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .7rem .6rem; }
}

/* A phone held sideways: no 260px floor, which was most of the screen
   (design_frame.css has the rest of this layout). */
@media (max-width: 899px) and (max-height: 500px) and (orientation: landscape) {
    html:not(.df-sheet-open) .ps-editor .ps-canvas-box {
        height: clamp(140px, calc(100vh - var(--df-header) - var(--df-tabbar) - var(--df-stagebar, 40px) - 56px), 72vh);
        height: clamp(140px, calc(100svh - var(--df-header) - var(--df-tabbar) - var(--df-stagebar, 40px) - 56px), 72svh);
    }
}

@media (max-width: 640px) {
    .ps-genre-example { flex-direction: column; }
    .ps-genre-example img { width: 100%; max-width: 260px; align-self: center; }
}
