.pn-hero { padding: calc(112px + var(--safe-t) + var(--top-push)) 0 18px; }
.pn-hero h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
@media (max-width: 700px) {
  .pn-hero { text-align: center; }
  .pn-hero .wrap { display: flex; flex-direction: column; align-items: center; }
  .pn-hero .eyebrow { justify-content: center; }
  .pn-hero h1 { margin-inline: auto; }
  .pn-hero .lede { margin-inline: auto; text-align: center; }
}

.pn-section { padding: 0 0 40px; }
.beta-tag { display: inline-block; vertical-align: middle; margin-left: 6px; padding: 2px 6px; border-radius: 999px; font: 700 .56rem/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; color: #ffd48a; border: 1px solid rgba(255,196,110,.4); background: rgba(255,170,60,.1); }
.pn { position: relative; border-radius: 26px; padding: 12px; background: linear-gradient(180deg, #1a1411, #0c0908); border: 1px solid rgba(255,255,255,.1); box-shadow: 0 30px 70px -30px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 10px; color: #f3e9dc; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pn-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: inset 0 1px 0 rgba(255,255,255,.2); touch-action: manipulation; }
.pn-btn { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; font: 650 .8rem/1 var(--font); color: #f3e9dc; cursor: pointer; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); touch-action: none; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.pn-btn svg { width: 16px; height: 16px; }
.pn-btn:active, .pn-btn[aria-pressed="true"] { background: rgba(255,255,255,.16); }
.pn-btn:focus-visible { outline: 2px solid var(--cyan, #45e6ff); outline-offset: 2px; }
.pn-ico { min-width: 36px; padding: 0; font-size: 1.1rem; }
.pn-grp { display: inline-flex; align-items: center; gap: 4px; }
.pn-range { min-width: 74px; text-align: center; font: 700 .8rem/1 var(--font); font-variant-numeric: tabular-nums; }
.pn-beta { font: 700 .56rem/1 var(--font); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; color: rgba(255,214,150,.75); border: 1px solid rgba(255,196,110,.28); }
.pn-back { display: none; }
.pn-led { width: 8px; height: 8px; border-radius: 50%; background: #4a3a2a; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); transition: background .12s, box-shadow .12s; }
.pn-sus.on { background: linear-gradient(180deg, rgba(255,190,90,.34), rgba(255,150,40,.18)); border-color: rgba(255,200,120,.7); box-shadow: 0 0 18px rgba(255,170,60,.45); }
.pn-sus.on .pn-led { background: #ffc15a; box-shadow: 0 0 10px 2px rgba(255,180,70,.9); }
.pn-lock.on { background: rgba(255,190,90,.28); border-color: rgba(255,200,120,.7); color: #ffd48a; }
.pn-rail { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 16px; background: linear-gradient(180deg, rgba(255,255,255,.09), rgba(255,255,255,.02)); border: 1px solid rgba(255,255,255,.12); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); touch-action: none; }
.pn-rail[data-side="right"] { flex-direction: row-reverse; }
.pn-rail .pn-sus { min-width: 150px; min-height: 46px; font-size: .9rem; justify-content: flex-start; padding: 0 18px; gap: 10px; border-radius: 14px; }
.pn-rail .pn-lock { min-height: 46px; min-width: 46px; border-radius: 14px; }
.pn-rail .pn-led { width: 10px; height: 10px; }
.pn-swap { min-height: 34px; font-size: .72rem; opacity: .85; }
.pn-ped { gap: 8px; }
.pn-rotate { display: none; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; font-size: .86rem; line-height: 1.3; background: linear-gradient(160deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.pn-phone { width: 26px; height: 26px; flex: none; color: #ffd48a; animation: pnRot 3.2s ease-in-out infinite; }
@keyframes pnRot { 0%,25% { transform: rotate(0); } 55%,85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (pointer: coarse) and (orientation: portrait) { .pn-rotate { display: flex; } }
.pn-port { height: clamp(200px, 29dvh, 290px); border-radius: 10px 10px 14px 14px; background: linear-gradient(#2a0f10 0, #5a1c1c 10px, #120c0a 10px); box-shadow: inset 0 6px 10px rgba(0,0,0,.6); }
.pn-keys { position: relative; display: flex; height: 100%; border-radius: 0; padding-top: 10px; background: transparent; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overflow: visible; box-shadow: none; }
.pn-keys .k { box-sizing: border-box; touch-action: none; }
.pn-keys .w { position: relative; flex: 1 1 0; min-width: 0; margin-right: 1px; border-radius: 0 0 7px 7px; background: linear-gradient(180deg, #d9d2c4 0, #f7f3ea 10%, #fffdf8 70%, #ece5d6 100%); box-shadow: inset 0 -8px 10px -6px rgba(110,90,60,.35), inset 1px 0 0 rgba(255,255,255,.9), 0 4px 6px rgba(0,0,0,.45); transform-origin: 50% 0; transition: transform .07s ease-out, box-shadow .12s, background .12s; }
.pn-keys .w:last-of-type { margin-right: 0; }
.pn-keys .w.down { transform: perspective(500px) rotateX(1.6deg) translateY(2px); background: linear-gradient(180deg, #c9c0ae 0, #ece5d3 14%, #f2ecde 100%); box-shadow: inset 0 -3px 6px -4px rgba(110,90,60,.4), 0 1px 2px rgba(0,0,0,.5), inset 0 -10px 18px -8px rgba(255,170,60,.55); }
.pn-keys .w.sus:not(.down) { box-shadow: inset 0 -8px 10px -6px rgba(110,90,60,.35), 0 4px 6px rgba(0,0,0,.45), inset 0 -3px 0 #ffb347, inset 0 -16px 22px -12px rgba(255,170,60,.7); }
.pn-keys .b { position: absolute; top: 10px; height: 62%; z-index: 2; border-radius: 0 0 6px 6px; background: linear-gradient(90deg, #17120f, #2c2521 45%, #0d0a09); box-shadow: inset 0 -10px 10px -6px rgba(255,255,255,.14), inset 0 1px 0 rgba(255,255,255,.28), inset 1px 0 0 rgba(255,255,255,.1), 0 6px 8px rgba(0,0,0,.65); transform-origin: 50% 0; transition: transform .07s ease-out, box-shadow .12s; }
.pn-keys .b::before { content: ""; position: absolute; left: 12%; right: 12%; top: 0; height: 12%; border-radius: 0 0 4px 4px; background: linear-gradient(rgba(255,255,255,.22), transparent); }
.pn-keys .b.down { transform: perspective(500px) rotateX(2.2deg) translateY(2px) scaleY(.985); box-shadow: inset 0 -4px 6px -4px rgba(255,255,255,.1), 0 2px 3px rgba(0,0,0,.6), inset 0 -14px 16px -8px rgba(255,170,60,.6); }
.pn-keys .b.sus:not(.down) { box-shadow: inset 0 -10px 10px -6px rgba(255,255,255,.14), 0 6px 8px rgba(0,0,0,.65), inset 0 -3px 0 #ffb347; }
.pn-keys .lb { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 700 .62rem/1 var(--font); color: #8c7e69; pointer-events: none; }
.pn-keys .w.c .lb { color: #5a4a35; }
.pn-keys .b .lb { display: none; bottom: 6px; color: #cdbfa9; font-size: .5rem; }
.pn-keys.drum .b .lb { display: block; }
.pn-keys.drum .w .lb { font-size: .5rem; color: #6a5a45; letter-spacing: .02em; }
.pn-keys.nolabels .lb, .pn-keys.nolabels.drum .b .lb { display: none; }
.pn-hint { margin: 0; font-size: .74rem; line-height: 1.45; color: rgba(243,233,220,.6); text-align: center; }
.pn-kb { display: none; }
@media (hover: hover) and (pointer: fine) { .pn-kb { display: inline; } }
@media (max-width: 700px) { .pn-bar { gap: 6px; padding: 6px; } .pn-beta { order: 2; } .pn-vp { order: 8; } .pn-fs span { display: none; } .pn { padding: 8px; border-radius: 22px; } }
@media (min-width: 701px) { .pn-section .wrap { max-width: 1240px; } .pn-port { height: 270px; } }

/* ---------- full screen (auto in phone landscape, or Full Screen button) ---------- */
html.pn-full, html.pn-full body { overflow: hidden !important; overscroll-behavior: none; }
html.pn-full .topbar, html.pn-full .gnav, html.pn-full .footer, html.pn-full .pn-hero, html.pn-full .wxs, html.pn-full .wxs-back, html.pn-full .skip { display: none !important; }
html.pn-full .pn-section, html.pn-full .pn-wrap { padding: 0 !important; max-width: none !important; margin: 0 !important; }
html.pn-full .pn { position: fixed; inset: 0; z-index: 400; width: 100vw; width: 100dvw; height: 100vh; height: 100dvh; border-radius: 0; border: 0; padding: 0; gap: 0; background: #0c0908; }
html.pn-full .pn-bar { flex: none; border-radius: 0; border-width: 0 0 1px; padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); padding-top: max(12px, env(safe-area-inset-top)); gap: 6px; flex-wrap: nowrap; overflow: hidden; background: #15100d; background: linear-gradient(180deg, #1a1410 0 12px, #2a211c 12px, #15100d 100%); -webkit-backdrop-filter: none; backdrop-filter: none; filter: none; }
html.pn-full .pn-bar .pn-btn { min-height: 40px; padding: 0 12px; font-size: .78rem; }
html.pn-full .pn-bar .pn-ico { min-width: 40px; min-height: 40px; padding: 0; }
html.pn-full .pn-back { display: inline-flex; }

html.pn-full .pn-fs span { display: none; }
html.pn-full .pn-rotate, html.pn-full .pn-hint { display: none; }
html.pn-full .pn-port { height: auto; flex: 1 1 auto; min-height: 0; border-radius: 0; margin: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); box-shadow: none; }
html.pn-full .pn-keys { height: 100%; padding-top: 8px; border-radius: 0; }
html.pn-full .pn-rail { flex: none; height: 54px; border-radius: 0; border-width: 1px 0 0; padding: 4px max(12px, env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); box-sizing: content-box; background: linear-gradient(180deg, #1c1511, #0e0a08); }
html.pn-full .pn-rail .pn-sus { min-height: 44px; min-width: 170px; }
html.pn-full .pn-rail .pn-lock { min-height: 44px; min-width: 44px; }
html.pn-full .pn-keys .b { top: 8px; height: 60%; }
html.pn-full .pn-keys .w { margin-right: 1px; }
@media (prefers-reduced-motion: reduce) { .pn-phone { animation: none; } }

.pn-oct-lbl { font: 700 .58rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: rgba(243,233,220,.55); margin-right: 2px; }
.pn-reset { min-height: 28px; padding: 0 10px; font-size: .68rem; transition: opacity .15s; }
.pn-reset:disabled { opacity: .3; pointer-events: none; }
.pn-reset:not(:disabled) { color: #ffd48a; border-color: rgba(255,196,110,.5); }
.pn-range { cursor: pointer; }
html.pn-full .pn-oct-lbl { font-size: .5rem; }
html.pn-full .pn-bar .pn-reset { min-height: 40px; padding: 0 10px; font-size: .68rem; }


.pn-vp { display: inline-flex; align-items: center; gap: 3px; flex: none; }
.pn-vsel { width: 172px; justify-content: flex-start; gap: 8px; padding: 0 10px; flex: none; }
.pn-vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.pn-vic { width: 16px; height: 16px; flex: none; color: #ffd48a; } .pn-vch { width: 14px; height: 14px; flex: none; opacity: .7; transition: transform .2s; }
.pn-vsel[aria-expanded="true"] .pn-vch { transform: rotate(180deg); }
.pn-vstep { min-width: 30px; padding: 0; font-size: 1.15rem; line-height: 1; }
html.pn-full .pn-bar .pn-vsel { width: 168px; min-height: 40px; } html.pn-full .pn-bar .pn-vstep { min-width: 40px; min-height: 40px; }
.pn-pop { position: absolute; z-index: 30; width: 250px; max-width: calc(100vw - 16px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; touch-action: pan-y; scroll-snap-type: y proximity; padding: 6px; border-radius: 20px; background: linear-gradient(160deg, rgba(60,48,40,.82), rgba(20,14,11,.9)); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(26px) saturate(1.7); -webkit-backdrop-filter: blur(26px) saturate(1.7); box-shadow: 0 24px 60px -10px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.28); transform-origin: var(--ox, 50%) var(--oy, 0); animation: pnPop .22s cubic-bezier(.2,.9,.3,1.1); scrollbar-width: thin; scrollbar-color: rgba(255,196,110,.5) transparent; }
.pn-pop[hidden] { display: none; }
.pn-pop::-webkit-scrollbar { width: 6px; } .pn-pop::-webkit-scrollbar-thumb { background: rgba(255,196,110,.45); border-radius: 6px; }
@keyframes pnPop { from { opacity: 0; transform: scale(.92) translateY(-6px); } to { opacity: 1; transform: none; } }
.pn-opt { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 6px 10px; border-radius: 14px; cursor: pointer; scroll-snap-align: start; color: #f3e9dc; -webkit-tap-highlight-color: transparent; }
.pn-opt + .pn-opt { margin-top: 2px; }
.pn-opt b { display: block; font: 700 .86rem/1.15 var(--font); } .pn-opt small { display: block; font: 500 .68rem/1.2 var(--font); color: rgba(243,233,220,.6); }
.pn-opt .pn-oi { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: .95rem; flex: none; }
.pn-opt .pn-ck { margin-left: auto; width: 16px; height: 16px; color: #ffc15a; opacity: 0; }
.pn-opt:active { background: rgba(255,255,255,.1); }
.pn-opt[aria-selected="true"] { background: linear-gradient(90deg, rgba(255,190,90,.26), rgba(255,150,40,.08)); box-shadow: inset 0 0 0 1px rgba(255,200,120,.45); }
.pn-opt[aria-selected="true"] .pn-ck { opacity: 1; }
.pn-opt:focus-visible { outline: 2px solid var(--cyan, #45e6ff); }
@media (max-width: 700px) { .pn-vsel { width: 176px; } .pn-vname { font-size: .76rem; } }
@media (prefers-reduced-motion: reduce) { .pn-pop { animation: none; } }

html.pg-piano, html.pg-piano body { overscroll-behavior: none; }
.pn, .pn * { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.pn-keys, .pn-rail { touch-action: none; }

.pn-pair { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; min-width: 0; max-width: 560px; }
.pn-rail[data-side="right"] .pn-pair { flex-direction: row-reverse; }
.pn-bend { position: relative; flex: 1 1 120px; min-width: 90px; max-width: 260px; height: 44px; border-radius: 22px; touch-action: none; cursor: grab; overflow: hidden; background: repeating-linear-gradient(90deg, rgba(255,255,255,.07) 0 2px, transparent 2px 9px), linear-gradient(180deg, #0c0807, #241a15 45%, #0c0807); border: 1px solid rgba(255,255,255,.16); box-shadow: inset 0 3px 8px rgba(0,0,0,.8), inset 0 -1px 0 rgba(255,255,255,.12); }
.pn-bend::after { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 1px; background: rgba(255,196,110,.35); }
.pn-bend-thumb { position: absolute; left: calc(50% - 15px); top: 3px; width: 30px; height: 36px; border-radius: 10px; z-index: 2; background: linear-gradient(90deg, #8d6a3e, #f0cf92 45%, #a07a47 55%, #6d4f2b); box-shadow: 0 3px 8px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.55); transform: translateX(var(--bx, 0px)); transition: transform .28s cubic-bezier(.3,1.6,.5,1); will-change: transform; }
.pn-bend.drag .pn-bend-thumb { transition: none; }
.pn-bend.drag { cursor: grabbing; border-color: rgba(255,200,120,.6); box-shadow: inset 0 3px 8px rgba(0,0,0,.8), 0 0 16px rgba(255,170,60,.3); }
.pn-bend-l, .pn-bend-r { position: absolute; top: 50%; transform: translateY(-50%); font: 700 .9rem/1 var(--font); color: rgba(255,214,150,.6); pointer-events: none; }
.pn-bend-l { left: 11px; } .pn-bend-r { right: 11px; }
.pn-bend-name { position: absolute; left: 50%; bottom: 1px; transform: translateX(-50%); font: 700 .45rem/1 var(--font); letter-spacing: .12em; text-transform: uppercase; font-style: normal; color: rgba(243,233,220,.4); pointer-events: none; z-index: 3; }
@media (max-width: 700px) { .pn-rail { gap: 6px; padding: 6px; } .pn-rail .pn-sus { min-width: 96px; padding: 0 12px; } .pn-pair { gap: 6px; } .pn-swap span { display: none; } .pn-swap { min-width: 34px; padding: 0; } .pn-bend { min-width: 70px; } }
html.pn-full .pn-bend { height: 42px; }

.pn-beatg { display: inline-flex; gap: 3px; flex: none; order: 8; }
.pn-beat { width: 82px; justify-content: flex-start; padding: 0 10px; gap: 6px; }
.pn-beat.on { background: linear-gradient(180deg, rgba(255,190,90,.3), rgba(255,150,40,.14)); border-color: rgba(255,200,120,.65); }
.pn-beat.on .pn-led, .pn-bigplay.on .pn-led { background: #ffc15a; box-shadow: 0 0 10px 2px rgba(255,180,70,.9); animation: pnLed var(--beat, .55s) ease-out infinite; }
@keyframes pnLed { 0% { transform: scale(1.7); } 100% { transform: scale(1); } }
.pn-beatopt { min-width: 52px; padding: 0 8px; gap: 3px; font-variant-numeric: tabular-nums; }
.pn-beatpop { width: 292px; padding: 12px; display: grid; gap: 8px; }
.pn-beatpop[hidden] { display: none; }
.pn-bigplay { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; border-radius: 16px; cursor: pointer; font: 750 .95rem/1 var(--font); color: #f3e9dc; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); touch-action: manipulation; }
.pn-bigplay.on { background: linear-gradient(180deg, rgba(255,190,90,.32), rgba(255,150,40,.14)); border-color: rgba(255,200,120,.7); }
.pn-bl { display: flex; justify-content: space-between; font: 700 .62rem/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: rgba(243,233,220,.55); margin-top: 2px; } .pn-bl b { color: #ffd48a; letter-spacing: 0; }
.pn-styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pn-st { all: unset; box-sizing: border-box; text-align: center; padding: 9px 4px; border-radius: 12px; cursor: pointer; font: 700 .74rem/1.1 var(--font); color: #f3e9dc; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.pn-st[aria-checked="true"] { background: linear-gradient(180deg, rgba(255,190,90,.3), rgba(255,150,40,.1)); border-color: rgba(255,200,120,.6); color: #ffe2b0; }
.pn-tempo { display: flex; align-items: center; gap: 6px; } .pn-tempo input { flex: 1; min-width: 0; }
.pn-beatpop input[type=range] { -webkit-appearance: none; appearance: none; height: 28px; background: transparent; touch-action: pan-x; accent-color: #ffb347; }
.pn-beatpop input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); }
.pn-beatpop input[type=range]::-moz-range-track { height: 6px; border-radius: 6px; background: rgba(255,255,255,.18); }
.pn-beatpop input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: linear-gradient(180deg, #f0cf92, #a07a47); box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.pn-beatpop input[type=range]::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: linear-gradient(180deg, #f0cf92, #a07a47); }
@media (max-width: 700px) { .pn-beat { width: 76px; } }
html.pn-full .pn-bar .pn-beat { width: 80px; min-height: 40px; } html.pn-full .pn-bar .pn-beatopt { min-width: 52px; min-height: 40px; }
@media (max-width: 900px) {
  html.pn-full .pn-oct-lbl { display: none; }
  html.pn-full .pn-bar { gap: 5px; }
  html.pn-full .pn-bar .pn-vsel { width: 148px; }
  html.pn-full .pn-bar .pn-btn { padding-inline: 9px; }
  html.pn-full .pn-bar .pn-ico, html.pn-full .pn-bar .pn-vstep { padding: 0; min-width: 38px; }
  html.pn-full .pn-range { min-width: 62px; }
  html.pn-full .pn-bar .pn-beat { width: 72px; }
}
@media (max-width: 860px) {
  html.pn-full .pn-beta { display: none; }
  html.pn-full .pn-bar .pn-vsel { width: 136px; }
  html.pn-full .pn-bar .pn-fs span { display: none; }
}

/* iPhone Home Screen blur fix for the Piano page (mirrors the site header standalone fix).
   iOS draws a soft blur under the status bar in Home Screen apps. Never place a backdrop-filter
   bar in that band — use a crisp solid/gradient scrim and padding-top with the safe area. */
html.standalone.pg-piano .topbar { background: var(--bg); }
html.standalone.pg-piano .topbar::before { opacity: 1; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; filter: none; }
html.standalone.pg-piano .pn-bar { -webkit-backdrop-filter: none; backdrop-filter: none; filter: none; background: linear-gradient(180deg, #2a211c, #1a1410); }
@media (display-mode: standalone) {
  html.pg-piano .topbar { background: var(--bg); }
  html.pg-piano .topbar::before { opacity: 1; background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; filter: none; }
  html.pg-piano .pn-bar { -webkit-backdrop-filter: none; backdrop-filter: none; filter: none; background: linear-gradient(180deg, #2a211c, #1a1410); }
  html.pn-full .pn-bar {
    -webkit-backdrop-filter: none; backdrop-filter: none; filter: none;
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + var(--top-push, 0px)));
    background: #15100d; background: linear-gradient(180deg, #1a1410 0 12px, #2a211c 12px, #15100d 100%);
  }
}
html.standalone.pn-full .pn-bar {
  -webkit-backdrop-filter: none; backdrop-filter: none; filter: none;
  padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + var(--top-push, 0px)));
  background: #15100d; background: linear-gradient(180deg, #1a1410 0 12px, #2a211c 12px, #15100d 100%);
}

.pn-board { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
.pn-board[hidden], #pnBoardHi[hidden] { display: none !important; }

.pn-port { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.pn-port .pn-keys { height: 100%; width: max-content; will-change: transform; padding-top: 10px; border-radius: 0; }
.pn-keys .w { flex: 0 0 var(--kw, 36px); width: var(--kw, 36px); }
.pn-strip { position: relative; height: 22px; border-radius: 8px; overflow: hidden; touch-action: none; cursor: pointer; background: #120c0a; border: 1px solid rgba(255,255,255,.12); }
.pn-strip-keys { position: absolute; inset: 0; display: flex; pointer-events: none; }
.pn-strip-keys i { flex: 1; background: linear-gradient(#ded6c8, #f4efe4); margin-right: .4px; }
.pn-strip-keys i.c { background: linear-gradient(#cfc6b6, #ebe4d6); }
.pn-strip-keys b { position: absolute; top: 0; height: 58%; width: 1.1%; margin-left: -.55%; background: #1a1410; border-radius: 0 0 1px 1px; }
.pn-strip-win { position: absolute; top: 0; bottom: 0; border-radius: 4px; border: 1.5px solid #ffc15a; background: rgba(255,180,70,.22); box-shadow: 0 0 8px rgba(255,170,60,.35); pointer-events: none; }
.pn-mode { min-width: 64px; }
.pn-mode[aria-pressed="false"] { background: linear-gradient(180deg, rgba(255,190,90,.28), rgba(255,150,40,.12)); border-color: rgba(255,200,120,.6); color: #ffe2b0; }
html.pn-full .pn-board { flex: 1 1 auto; min-height: 0; }
html.pn-full .pn-port { flex: 1 1 auto; }
html.pn-full .pn-strip { flex: none; height: 18px; margin: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); border-radius: 0; border-width: 1px 0; }
html.pn-full .pn-bar .pn-mode { min-width: 58px; min-height: 40px; }
@media (max-width: 860px) { html.pn-full .pn-bar .pn-mode { min-width: 52px; padding-inline: 8px; } }

.pn-boards { display: flex; flex-direction: column; gap: 6px; min-height: 0; flex: 1 1 auto; }
.pn-row-lbl { display: none; font: 700 .58rem/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: rgba(243,233,220,.5); padding: 0 4px; }
.pn-board-lo .pn-row-lbl { display: none; }

/* Portrait full-screen: two stacked keyboards (treble on top, bass below). */
html.pn-full.pn-stack .pn-boards { flex: 1 1 auto; min-height: 0; gap: 8px; padding: 0 max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left)); }
html.pn-full.pn-stack .pn-board { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; gap: 4px; }
html.pn-full.pn-stack #pnBoardHi { display: flex; }
html.pn-full.pn-stack .pn-row-lbl { display: block; }
html.pn-full.pn-stack .pn-board-lo .pn-row-lbl { display: block; }
html.pn-full.pn-stack .pn-port { flex: 1 1 auto; height: auto; min-height: 140px; border-radius: 10px; }
html.pn-full.pn-stack .pn-strip { height: 16px; margin: 0; border-radius: 6px; border-width: 1px; }
html.pn-full.pn-stack .pn-bar { flex-wrap: wrap; overflow: visible; justify-content: center; row-gap: 6px; }
html.pn-full.pn-stack .pn-hint { display: none; }

/* Landscape single-row bar: keep one line, hide some labels so 40px buttons still fit. */
@media (orientation: landscape) and (max-height: 540px) {
  html.pn-full .pn-back span { display: none; }
  html.pn-full .pn-bar { flex-wrap: nowrap; overflow: hidden; }
}
/* t170u: never let a button collapse into a blank pill. Every control keeps its size; JS (fitBar)
   measures the real width left after the iPhone safe-area insets and steps down through tighter
   tiers (.t1 → .t3). The Beat button shows its LED + "Beat" label instead of the bare target icon. */
html.pn-full:not(.pn-stack) .pn-bar > *, html.pn-full:not(.pn-stack) .pn-bar .pn-grp > *, html.pn-full:not(.pn-stack) .pn-bar .pn-vp > *, html.pn-full:not(.pn-stack) .pn-bar .pn-beatg > * { flex-shrink: 0; }
html.pn-full:not(.pn-stack) .pn-bar .pn-back, html.pn-full:not(.pn-stack) .pn-bar .pn-fs { width: 40px; min-width: 40px; padding: 0; }
html.pn-full:not(.pn-stack) .pn-bar .pn-back svg, html.pn-full:not(.pn-stack) .pn-bar .pn-fs svg { width: 18px; height: 18px; flex: none; }
html.pn-full:not(.pn-stack) .pn-bar .pn-beat svg { display: none; }
html.pn-full:not(.pn-stack) .pn-bar .pn-beat span { display: inline; }
html.pn-full:not(.pn-stack) .pn-bar .pn-beat { width: 74px; justify-content: center; }
html.pn-full:not(.pn-stack) .pn-bar .pn-vsel { width: 164px; }
html.pn-full:not(.pn-stack) .pn-bar.t1 { gap: 5px; }
html.pn-full:not(.pn-stack) .pn-bar.t1 .pn-beta, html.pn-full:not(.pn-stack) .pn-bar.t1 .pn-oct-lbl { display: none; }
html.pn-full:not(.pn-stack) .pn-bar.t2 .pn-vstep { display: none; }
html.pn-full:not(.pn-stack) .pn-bar.t2 .pn-range { min-width: 56px; font-size: .74rem; }
html.pn-full:not(.pn-stack) .pn-bar.t2 .pn-lbl { width: 66px; min-width: 66px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 { gap: 4px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-grp { gap: 3px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-ico { min-width: 36px; width: 36px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-reset, html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-mode { padding-inline: 8px; font-size: .7rem; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-lbl { width: 60px; min-width: 60px; font-size: .7rem; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-vsel { width: 146px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-beat { width: 64px; padding-inline: 8px; }
html.pn-full:not(.pn-stack) .pn-bar.t3 .pn-beatopt { min-width: 50px; padding-inline: 8px; }
html.pn-full:not(.pn-stack) .pn-bar.t4 { overflow-x: auto; scrollbar-width: none; }
html.pn-full:not(.pn-stack) .pn-bar.t4::-webkit-scrollbar { display: none; }
/* Safari (not Home Screen) landscape tip: the page can't hide Safari's own tab bar, so say how. */
.pn-tip { position: fixed; z-index: 420; left: 50%; bottom: calc(64px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: min(92vw, 560px); padding: 9px 10px 9px 14px; border-radius: 14px; font: 600 .78rem/1.35 var(--font); color: #f3e9dc; background: #241b16; border: 1px solid rgba(255,200,120,.4); box-shadow: 0 12px 30px rgba(0,0,0,.6); animation: pnPop .25s ease-out; }
.pn-tip b { color: #ffd48a; }
.pn-tip button { all: unset; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.1); font-size: 1rem; }
.pn-tip[hidden] { display: none; }

/* Labels stays a fixed width so voice changes (C4 / KICK / off) never shift the bar. */
.pn-btn.pn-lbl { min-width: 76px; width: 76px; flex: none; justify-content: center; padding-inline: 8px; }
html.pn-full .pn-bar .pn-lbl { min-width: 76px; width: 76px; }
@media (max-width: 700px) { .pn-btn.pn-lbl { min-width: 72px; width: 72px; } }

html.pn-full.pn-stack { overscroll-behavior: none; }
html.pn-full.pn-stack .pn-rail { flex: none; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
html.pn-full.pn-stack .pn-port { min-height: clamp(132px, 26dvh, 280px); }
html.standalone.pn-full .pn-bar, html.pn-full.standalone .pn-bar {
  padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + var(--top-push, 0px)));
  -webkit-backdrop-filter: none; backdrop-filter: none; filter: none;
}

html.pn-full .pn-boards { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
html.pn-full:not(.pn-stack) .pn-board-lo { flex: 1 1 auto; min-height: 0; }
html.pn-full:not(.pn-stack) #pnBoardHi[hidden] { display: none; }

html:not(.pn-stack) #pnBoardHi { display: none !important; }

/* portrait-only Refresh (t169u): one tap reloads the page if iOS ever drops the audio */
.pn-refresh { flex: none; width: 36px; }
.pn-refresh svg { width: 17px; height: 17px; }
.pn-refresh.spin svg { animation: pnSpin .6s linear infinite; }
@keyframes pnSpin { to { transform: rotate(360deg); } }
@media (orientation: landscape) { .pn-refresh { display: none !important; } }
@media (max-width: 700px) { .pn-refresh { order: 9; } }

/* t171u: Gliss / Scroll on the landscape rail, beside Sustain + Pitch bend + Pedal side */
.pn-rail .pn-mode.on-rail { flex: none; min-height: 44px; min-width: 92px; padding: 0 16px; border-radius: 14px; font-size: .86rem; margin-inline: auto 0; }
.pn-rail[data-side="right"] .pn-mode.on-rail { margin-inline: 0 auto; }
.pn-rail .pn-mode.on-rail[aria-pressed="false"] { background: rgba(69,230,255,.12); border-color: rgba(69,230,255,.45); color: #bff6ff; }
@media (max-width: 440px) { html:not(.pn-full) .pn-oct-lbl { display: none; } }

/* t173u: portrait control panel, three balanced full-width rows.
   Row 1: sound picker. Row 2: range + Reset pill · Gliss/Scroll · Labels. Row 3: Beat + BPM · Refresh · Full screen.
   The Octave −/+ stepper is dropped in portrait (Scroll mode + the 88-key mini strip move the keyboard). */
@media (orientation: portrait) and (max-width: 700px) {
  html:not(.pn-full) .pn-bar, html.pn-full.pn-stack .pn-bar { display: flex; flex-wrap: wrap; justify-content: stretch; gap: 6px; padding: 6px; }
  html:not(.pn-full) .pn-bar .pn-btn, html.pn-full.pn-stack .pn-bar .pn-btn { min-height: 40px; }
  html:not(.pn-full) .pn-bar .pn-beta, html.pn-full.pn-stack .pn-bar .pn-beta,
  html:not(.pn-full) .pn-bar .pn-oct-lbl, html.pn-full.pn-stack .pn-bar .pn-oct-lbl,
  html:not(.pn-full) #pnOctDn, html.pn-full.pn-stack #pnOctDn,
  html:not(.pn-full) #pnOctUp, html.pn-full.pn-stack #pnOctUp { display: none !important; }
  html:not(.pn-full) .pn-bar .pn-oct, html.pn-full.pn-stack .pn-bar .pn-oct { display: contents; }
  /* row 1 */
  html:not(.pn-full) .pn-bar .pn-vp, html.pn-full.pn-stack .pn-bar .pn-vp { order: 10; flex: 1 1 100%; display: flex; gap: 6px; }
  html:not(.pn-full) .pn-bar .pn-vsel, html.pn-full.pn-stack .pn-bar .pn-vsel { flex: 1 1 auto; width: auto; min-width: 0; justify-content: center; }
  html:not(.pn-full) .pn-bar .pn-vname, html.pn-full.pn-stack .pn-bar .pn-vname { flex: 0 1 auto; text-align: center; font-size: .86rem; }
  html:not(.pn-full) .pn-bar .pn-vstep, html.pn-full.pn-stack .pn-bar .pn-vstep { flex: none; width: 40px; min-width: 40px; padding: 0; font-size: 1.15rem; }
  /* row 2: one segmented range/reset pill, then the two toggles */
  html:not(.pn-full) .pn-bar .pn-range, html.pn-full.pn-stack .pn-bar .pn-range { order: 20; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 6px 0 10px; margin-right: -6px; border-radius: 999px 0 0 999px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-right: 0; box-sizing: border-box; font-size: .78rem; white-space: nowrap; overflow: hidden; }
  html:not(.pn-full) .pn-bar .pn-reset, html.pn-full.pn-stack .pn-bar .pn-reset { order: 21; flex: none; min-height: 40px; padding: 0 10px; border-radius: 0 999px 999px 0; font-size: .72rem; border-left: 1px solid rgba(255,255,255,.1); }
  html:not(.pn-full) .pn-bar .pn-reset:disabled, html.pn-full.pn-stack .pn-bar .pn-reset:disabled { opacity: 1; color: rgba(243,233,220,.38); }
  html:not(.pn-full) .pn-bar .pn-mode, html.pn-full.pn-stack .pn-bar .pn-mode { order: 22; flex: 1 1 0; min-width: 0; }
  html:not(.pn-full) .pn-bar .pn-lbl, html.pn-full.pn-stack .pn-bar .pn-lbl { order: 23; flex: 1 1 0; width: auto; min-width: 64px; }
  /* row 3 */
  html:not(.pn-full) .pn-bar .pn-beatg, html.pn-full.pn-stack .pn-bar .pn-beatg { order: 30; flex: 1 1 58%; display: flex; gap: 6px; }
  html:not(.pn-full) .pn-bar .pn-beat, html.pn-full.pn-stack .pn-bar .pn-beat { flex: 1 1 auto; width: auto; justify-content: center; }
  html:not(.pn-full) .pn-bar .pn-beatopt, html.pn-full.pn-stack .pn-bar .pn-beatopt { flex: none; min-width: 64px; }
  html:not(.pn-full) .pn-bar .pn-refresh, html.pn-full.pn-stack .pn-bar .pn-refresh { order: 31; flex: 1 1 0; width: auto; min-width: 44px; }
  html:not(.pn-full) .pn-bar .pn-fs, html.pn-full.pn-stack .pn-bar .pn-fs { order: 32; flex: 1 1 0; min-width: 44px; padding: 0; }
  html.pn-full.pn-stack .pn-bar .pn-back { order: 31; flex: 1 1 0; min-width: 44px; padding: 0; }
  html.pn-full.pn-stack .pn-bar .pn-back span { display: none; }
}
@media (orientation: portrait) and (max-width: 700px) {
  html.pn-full.pn-stack .pn-bar { padding-top: max(10px, env(safe-area-inset-top)); padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  html.pn-full.pn-stack .pn-bar .pn-back { flex: none; padding: 0 12px; } html.pn-full.pn-stack .pn-bar .pn-back span { display: inline; }
  html.pn-full.pn-stack .pn-bar .pn-range { font-size: .7rem; padding-left: 8px; }
}
@media (orientation: portrait) and (max-width: 700px) { html.pn-full.pn-stack .pn-bar .pn-fs { display: none; } }
/* t174u: white-key pitch is exactly --kw (key + its 1px seam), so the black keys placed at
   n × --kw sit on the true C|D, D|E, F|G, G|A, A|B seams across all 88 keys. */
.pn-keys .w, html.pn-full .pn-keys .w { flex: 0 0 calc(var(--kw, 36px) - 1px); width: calc(var(--kw, 36px) - 1px); margin-right: 1px; }
.pn-keys .b { margin-left: -.5px; }
.pn-strip-keys i { flex: 1 1 0; min-width: 0; margin-right: 0; box-shadow: inset -.5px 0 0 rgba(60,45,30,.55); }

/* t177u: Power button with status LED. Off = context closed, keys dimmed; On = fresh audio graph. */
.pn-power { position: relative; flex: none; width: 40px; color: rgba(243,233,220,.55); }
.pn-power svg { width: 17px; height: 17px; }
.pn-power .pn-pled { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: #5a2a22; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); transition: background .15s, box-shadow .15s; }
.pn-power.on { color: #9ff7d6; border-color: rgba(80,240,190,.5); background: rgba(60,230,170,.1); }
.pn-power.on .pn-pled { background: #43f0b8; box-shadow: 0 0 8px 2px rgba(67,240,184,.85); }
html.pn-off .pn-power { color: #ffb4a0; border-color: rgba(255,120,90,.45); animation: pnPwr 1.6s ease-in-out infinite; }
@keyframes pnPwr { 50% { box-shadow: 0 0 14px rgba(255,120,90,.45); } }
html.pn-off .pn-port, html.pn-off .pn-rail .pn-pair { opacity: .45; filter: saturate(.4); transition: opacity .2s; }
@media (orientation: portrait) and (max-width: 700px) {
  html:not(.pn-full) .pn-bar .pn-power, html.pn-full.pn-stack .pn-bar .pn-power { order: 29; flex: 1 1 0; width: auto; min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) { html.pn-off .pn-power { animation: none; } }
/* iPhone SE landscape (t4): tighten so the bar fits without scrolling */
html.pn-full:not(.pn-stack) .pn-bar.t4 .pn-vsel { width: 120px; }
html.pn-full:not(.pn-stack) .pn-bar.t4 .pn-beatopt { min-width: 42px; padding-inline: 6px; }
html.pn-full:not(.pn-stack) .pn-bar.t4 .pn-lbl { width: 52px; min-width: 52px; }
@media (max-width: 380px) { html:not(.pn-full) .pn-bar .pn-range { font-size: .68rem; padding-left: 8px; letter-spacing: -.01em; } }
html.pn-full.pn-stack .pn-bar .pn-range { font-size: .66rem; letter-spacing: -.01em; }
html.pn-full.pn-stack .pn-bar .pn-range { flex: 1.6 1 0; padding-left: 6px; padding-right: 4px; }
