/* Pixel Pull: app-only styles on top of vendor/pixel-ui.css */
:root { --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
html { overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
body.px { margin: 0; height: 100vh; height: 100dvh; overflow: hidden; }
h1, h2, h3, p, dl, dd, ul { margin: 0; }
button, input, select { font-family: inherit; }
.px-hide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.small { font-size: 14px; color: var(--px-ink-2); }
.fine { font-size: 14px; color: var(--px-ink-2); line-height: 1.5; }

/* ---- layout: stage + panel fill the screen below the nav strip ---- */
.app { height: calc(100vh - var(--px-nav-h, 0px)); height: calc(100dvh - var(--px-nav-h, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(190px, 40%) minmax(0, 1fr); outline: none; padding-left: var(--safe-l); padding-right: var(--safe-r); }
@media (min-width: 700px) { .app { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); } }

.stage { position: relative; padding-bottom: 60px; box-sizing: border-box; overflow: hidden; background: var(--px-bg); border-bottom: var(--px-border); display: grid; place-items: center; min-height: 0; }
@media (min-width: 700px) { .stage { border-bottom: 0; border-right: var(--px-border); } }
.stage canvas { display: block; max-width: none; image-rendering: pixelated; }
.stage__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 60px; display: flex; align-items: center; justify-content: center; gap: var(--px-3); padding: 0 var(--px-3); pointer-events: none; }
.stage__bar > * { pointer-events: auto; }
.stage__bar[hidden] { display: none; }
#btn-main { min-width: 200px; }

.panel { overflow: auto; padding: var(--px-4) var(--px-4) calc(var(--px-5) + var(--safe-b)); display: flex; flex-direction: column; gap: var(--px-4); min-height: 0; background: var(--px-bg); overscroll-behavior: contain; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--px-3); flex-wrap: wrap; }
.panel__head .px-title { font-size: 16px; }
.lede { line-height: 1.5; max-width: 60ch; }
.lbl { font: 500 12px/1.3 var(--px-font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--px-ink-2); }
select.px-input { appearance: auto; }
.px-seg.wrap { flex-wrap: wrap; max-width: 100%; }
.px-seg > button { flex: 1 1 auto; }
.px-seg > button:disabled { color: var(--px-ink-2); cursor: not-allowed; background: var(--px-bg-3); }
.px-seg > button:disabled:hover { background: var(--px-bg-3); color: var(--px-ink-2); }
.px-seg small { font-size: 11px; opacity: .9; }
#view-setup { display: flex; flex-direction: column; gap: var(--px-3); }
.row-loc { display: flex; flex-wrap: wrap; align-items: center; gap: var(--px-3); margin-top: var(--px-1); }
.row-loc .small { flex: 1 1 200px; }
.pool { font-weight: 500; line-height: 1.5; padding: var(--px-3); border: var(--px-border-thin); background: var(--px-bg-3); }
.pool.bad { border-color: var(--px-warm); }
.busy { font-family: var(--px-font-pixel); font-size: 16px; line-height: 1.6; }
#view-busy { display: flex; flex-direction: column; gap: var(--px-3); }
.foot { margin-top: auto; }

/* ---- result card ---- */
#view-result { display: flex; flex-direction: column; gap: var(--px-3); }
#r-name { font-family: var(--px-font-pixel); font-size: 16px; line-height: 1.5; outline: none; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--px-2) var(--px-3); font-size: 16px; line-height: 1.45; }
.facts dt { font: 500 12px/1.9 var(--px-font-mono); text-transform: uppercase; color: var(--px-ink-2); }
.facts dd { overflow-wrap: anywhere; }
.why { border-left: 4px solid var(--px-warm); padding: var(--px-2) var(--px-3); background: var(--px-bg-2); line-height: 1.5; }
.why b { font: 500 12px var(--px-font-mono); text-transform: uppercase; display: block; color: var(--px-warm); }
.actions { display: flex; flex-wrap: wrap; gap: var(--px-2); }
.actions .px-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.actions .px-btn[aria-disabled="true"] { color: var(--px-ink-2); border-color: var(--px-ink-2); cursor: not-allowed; box-shadow: none; }
.tags { display: flex; flex-wrap: wrap; gap: var(--px-2); }
.px-tag--warm { background: var(--px-warm); border-color: var(--px-warm); color: var(--px-on-accent); }
details.ep { border: var(--px-border-thin); background: var(--px-bg-2); }
details.ep summary { min-height: 44px; display: flex; align-items: center; padding: 0 var(--px-3); cursor: pointer; font: 700 14px var(--px-font-mono); text-transform: uppercase; }
details.ep > div { padding: 0 var(--px-3) var(--px-3); display: flex; flex-direction: column; gap: var(--px-2); }
details.ep ul { padding-left: 20px; line-height: 1.5; }
details.ep li { margin-bottom: var(--px-1); }

/* ---- saved dialog ---- */
.sv { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--px-2); margin: var(--px-3) 0; }
.sv li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--px-2); border: var(--px-border-thin); padding: var(--px-2) var(--px-3); }
.sv .nm { flex: 1 1 160px; font-weight: 700; overflow-wrap: anywhere; }
.sv a.px-btn, .sv button.px-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.dlg-h { display: flex; justify-content: space-between; align-items: center; gap: var(--px-3); }
[hidden] { display: none !important; }

/* ---- links are real tap targets, My places screen ---- */
.px-link { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.dlg-wide { width: min(680px, calc(100vw - 32px)); }
@media (max-width: 599px) { .dlg-wide { width: 100vw; } }
.mine-tabs { margin: var(--px-3) 0; flex-wrap: wrap; }
.mine-tabs .px-tab { min-height: 44px; display: inline-flex; align-items: center; }
.mine-panel { display: flex; flex-direction: column; gap: var(--px-3); }
.mine-form { display: flex; flex-direction: column; gap: var(--px-3); }
.mine-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--px-3); }
.mine-panel textarea.px-input { min-height: 96px; }
.mine-prev { max-height: 40vh; overflow: auto; }
.px-tag--danger { background: var(--px-danger); border-color: var(--px-danger); color: var(--px-on-accent); }
.px-row { display: flex; flex-wrap: wrap; gap: var(--px-2); align-items: center; }
