/* UF_LIVE_20261108_2 */
:root{font-family:system-ui,-apple-system,sans-serif;color:#18322f;background:#f1f5f3;line-height:1.55}*{box-sizing:border-box}body{margin:0}header{background:#153f36;color:white;padding:18px 24px}header a{color:white}main{max-width:1120px;margin:auto;padding:20px}h1{font-size:1.4rem;margin:0}h2{font-size:1.15rem}section,.card{background:white;border:1px solid #d4e0dc;border-radius:12px;padding:20px;margin:16px 0}label{display:block;margin:10px 0}input,textarea,select,button{font:inherit}input,textarea,select{border:1px solid #8fa9a0;border-radius:6px;padding:10px;max-width:100%}textarea{width:100%;min-height:85px}button{border:0;background:#1b6855;color:white;border-radius:7px;padding:10px 15px;margin:4px;cursor:pointer}button:disabled{opacity:.45;cursor:default}button.secondary{background:#e4eee9;color:#214a3e}button.danger{background:#a12d36}a{color:#185c4a}#status{white-space:pre-wrap;position:sticky;top:0;z-index:3;padding:12px;background:#fff5ce;min-height:48px;border-bottom:1px solid #e7d18d}.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.row label{flex:1;min-width:120px}.row input{width:100%}.muted{font-size:.9rem;color:#536c63}#stage{background:#eef6f2;border:2px solid #526c62;position:relative;aspect-ratio:5/3;width:100%;overflow:hidden;touch-action:none}#stage:before{content:'奥 ／ 客席は下側';position:absolute;width:100%;text-align:center;color:#6c8278;font-size:12px;pointer-events:none}.stage-item{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;flex-direction:column;color:#17372e;background:#fff;border:1px solid #789e8c;border-radius:8px;cursor:grab;user-select:none;touch-action:none;line-height:1.1}.stage-item.selected{outline:3px solid #e59c28}.stage-item span{font-size:10px;max-width:110px;overflow:hidden}.stage-item b{font-size:clamp(14px,3vw,28px)}#stageWrap{overflow:auto}.toolbar{display:flex;flex-wrap:wrap}#songRows>div{display:flex;gap:5px;align-items:center;margin:8px 0}#songRows input{flex:1;min-width:0}#songRows select{width:145px}.hidden{display:none!important}table{width:100%;border-collapse:collapse}td,th{text-align:left;border-bottom:1px solid #ddd;padding:8px;overflow-wrap:anywhere}.scroll{overflow:auto}.badge{display:inline-block;background:#e7f4ec;padding:4px 10px;border-radius:5px}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}pre{white-space:pre-wrap;overflow-wrap:anywhere}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #e59c28} @media(max-width:600px){main{padding:10px}section{padding:12px}header{padding:14px}h1{font-size:1.15rem}.grid{grid-template-columns:1fr}#songRows>div{flex-wrap:wrap}#songRows select{width:120px}button{padding:10px}#stage{min-width:290px}}

/* Transparent hit area preserves diagram scale and improves touch targeting. */
.stage-item::after{content:"";position:absolute;left:50%;top:50%;width:max(100%,44px);height:max(100%,44px);transform:translate(-50%,-50%)}
nav{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:10px}.tabs{position:sticky;top:60px;background:#f1f5f3;padding:12px;z-index:2;border-bottom:1px solid #d4e0dc}section{scroll-margin-top:130px}input:not([type=checkbox]):not([type=number]):not([type=datetime-local]):not([type=date]){width:100%}.card>a{display:inline-block;margin:8px}details{border-top:1px solid #ddd;padding:12px 0}summary{cursor:pointer}.stage{background:#eef6f2;border:2px solid #526c62;position:relative;aspect-ratio:5/3;width:100%;overflow:hidden}#venue p{white-space:pre-wrap}small{font-size:.75em;opacity:.8}pre{font-family:inherit}.hero{padding:35px 0}.hero h1{font-size:clamp(1.6rem,4vw,2.5rem);color:#153f36}.help{background:#e9f2ed;padding:14px;border-radius:8px}@media(max-width:600px){.tabs{position:static}.row{align-items:stretch}.card{padding:12px}.card input{font-size:12px}section{scroll-margin-top:70px}}

.stage-item .stage-icon{display:block;width:100%;min-height:0;flex:1;overflow:visible;pointer-events:none}
.stage-icon svg{display:block;width:100%;height:100%}
.stage-tool{display:inline-flex;align-items:center;gap:.35rem}
.stage-tool .stage-icon{display:block;width:28px;height:26px;flex:none}
.stage-item .stage-text{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere}

.stage-transform{position:absolute;z-index:2;touch-action:none;user-select:none;min-width:36px;min-height:36px;margin:0;padding:4px;line-height:1}
.stage-transform.rotation{margin-left:var(--offset);transform:translate(3px,-115%)}
.stage-transform.scale{margin-left:var(--offset);transform:translate(3px,15%)}

.uf-floor{position:absolute;inset:0;pointer-events:none}
.uf-stagefill{position:absolute;inset:0;background:#f8fafc;clip-path:polygon(0 0,100% 0,100% 100%,78% 100%,0 20%)}
.uf-line{position:absolute;left:-4%;top:17%;width:90%;height:3px;background:#9b5367;transform:rotate(31deg);transform-origin:left center}
.audience{position:absolute;left:12%;bottom:8%;font-weight:900;color:#8b5262;letter-spacing:.08em}
.fixed-speaker{position:absolute;width:10%;height:15%;background:#4d5560;border:2px solid #252a31;border-radius:4px;z-index:2;transform-origin:center}
.fixed-speaker.left{left:2%;top:8%;transform:rotate(-6deg)}
.fixed-speaker.right{right:11.5%;bottom:5%;top:auto;transform:rotate(39deg)}
.fixed-speaker:after{content:'SP';position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:11px;font-weight:900}

.preset-stage-shape,.preset-stage-outline{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.preset-stage-shape{background:#f8fafc}
.preset-fixed{position:absolute;pointer-events:none}
.preset-fixed img,.preset-fixed .stage-icon,.preset-fixed svg{display:block;width:100%;height:100%;object-fit:contain}
.preset-fixed-label{position:absolute;top:100%;left:50%;transform:translateX(-50%);font-size:11px;white-space:nowrap}

.stage-icon img{display:block;width:100%;height:100%;object-fit:contain}

.stage-item .text-size-s{font-size:12px}
.stage-item .text-size-m{font-size:16px}
.stage-item .text-size-l{font-size:22px}

#stage{container-type:inline-size}

.legacy-piece{background:transparent;border:0;border-radius:0}
.stage-item.legacy-piece .stage-icon{display:block;position:absolute;left:50%;top:50%;translate:-50% -50%;overflow:visible}
.stage-item .text-size-s{font-size:11px}
.stage-item .text-size-l{font-size:23px}
.partHead{display:grid;grid-template-columns:minmax(90px,1fr) minmax(120px,2fr) auto;gap:8px;align-items:start}
@media(max-width:600px){.partHead{grid-template-columns:minmax(0,1fr) auto}.partHead .partGear{grid-column:1;grid-row:2}.partHead button{grid-column:2;grid-row:1 / span 2}}

.venue-designer{border:1px solid #cbd5e1;padding:12px;border-radius:12px;margin:16px 0}.vd-allowed{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:8px}.vd-allowed label{display:flex;align-items:center;gap:8px}.vd-allowed input,.venue-designer input[type=checkbox]{width:auto;display:inline-block}.venue-designer #vdBoard{position:relative;overflow:hidden;touch-action:pan-y;min-width:0}.venue-designer .stage-item{touch-action:none;background:transparent;border:1px dashed #789;min-width:44px;min-height:44px}.vd-vertex,.vd-edge{position:absolute;transform:translate(-50%,-50%);touch-action:none;min-width:44px;min-height:44px;z-index:3;padding:0;border-radius:50%}.vd-vertex{background:#2563eb}.vd-edge{opacity:.65;background:#64748b}.venue-designer .row>label{min-width:90px;flex:1}button,input,select{min-height:44px}@media(max-width:600px){.venue-designer{padding:8px}.venue-designer .row{gap:8px}.venue-designer .row>label{max-width:100%}}

#status{position:sticky;top:0;z-index:20;background:#fff9db;padding:12px;border-bottom:1px solid #d4b95d;overflow-wrap:anywhere}.venue-designer .stage-icon svg{width:100%;height:100%}.venue-designer .stage-icon{width:100%;height:100%}.venue-designer .stage-item{display:flex;align-items:center;justify-content:center}
#eventVenueChoices{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}#eventVenueChoices label,#iconVaultSection>label:has(input[type=checkbox]){display:flex;gap:10px;align-items:center}#eventVenueChoices input[type=checkbox],#vaultAllowed{width:auto;min-width:24px;min-height:24px}#vaultRows .card{display:flex;flex-wrap:wrap;align-items:center;gap:10px}#vaultRows img{object-fit:contain}.event-venue-panel{border:1px solid #cbd5e1;border-radius:12px;padding:12px;margin:14px 0}

.stage-delete-handle{position:absolute;transform:translate(-50%,-50%) translate(-35px,-35px);z-index:8;min-width:44px;min-height:44px;padding:0;background:#a52230;border-radius:50%;touch-action:manipulation}

.stage-item.stage-text-item{background:transparent;border:0;border-radius:0}.preset-fixed-label{max-width:130px;width:max-content;white-space:normal;overflow-wrap:anywhere}
main{overflow-wrap:anywhere}pre{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%}.stage-tool{max-width:100%}.stage-tool>span:last-child{min-width:0;white-space:normal;overflow-wrap:anywhere}#vaultRows strong{max-width:100%;overflow-wrap:anywhere}#eventVenueChoices label{min-width:0;overflow-wrap:anywhere}

/* Venue and event copies share the same direct-manipulation canvas. */
.venue-designer .vd-board-wrap{padding:24px 22px;margin:0;background:#f8fafc;border-radius:8px}
.venue-designer .vd-board{position:relative;overflow:visible;touch-action:pan-y;container-type:inline-size;min-width:0;background-color:#eff5fb;background-image:linear-gradient(90deg,#dbe4ee 1px,transparent 1px),linear-gradient(#dbe4ee 1px,transparent 1px);background-size:10% 16.666%}
.venue-designer .vd-board .stage-item{margin:0;padding:0;min-width:44px;min-height:44px;width:7.5%;aspect-ratio:60/55;height:auto;border:1px dashed #64748b;background:#ffffff30;z-index:2;overflow:visible}
.venue-designer .vd-board .stage-item .stage-icon{position:absolute;left:50%;top:50%;translate:-50% -50%;width:7.5cqw;height:6.875cqw;flex:none;max-width:none;overflow:visible}
.venue-designer .vd-board .stage-item.selected{background:#dbeafe80;outline:2px solid #2563eb}
.venue-designer .vd-board .vd-gear-muted{pointer-events:none;opacity:.5}
.venue-designer .vd-vertex{margin:0;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:2px solid white;box-shadow:0 1px 4px #0004;background:#2563eb;cursor:grab;z-index:4}
.venue-designer .vd-vertex.active{background:#d97706;outline:2px solid #7c2d12}
.venue-designer .vd-edge-layer{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1}
.venue-designer .vd-edge-layer line{stroke:#bf6c8866;stroke-width:16px;stroke-linecap:round;pointer-events:stroke;cursor:crosshair;touch-action:none}
.venue-designer .vd-edge-layer line:focus{stroke:#c026d3;outline:none}
.venue-designer .vd-transform{position:absolute;transform:translate(-50%,-50%);margin:0;padding:0;min-width:44px;min-height:44px;width:44px;height:44px;border-radius:50%;border:2px solid white;z-index:6;touch-action:none;box-shadow:0 1px 4px #0004;font-size:22px;font-weight:700}
.venue-designer .vd-rotate{background:#16803b}.venue-designer .vd-resize{background:#a95100}.venue-designer .vd-delete{background:#a52230}.venue-designer .vd-duplicate{background:#1d4ed8}
.vd-modes{display:flex;gap:6px;flex-wrap:wrap}.vd-modes button{margin:0;background:#e4eee9;color:#214a3e}.vd-modes button[aria-pressed=true]{background:#1b6855;color:white;outline:2px solid #153f36;outline-offset:1px}.vd-guide{font-size:.9rem;margin:10px 0}
.vd-palette{margin:16px 0}.vd-palette-group{margin:12px 0}.vd-icon-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(82px,1fr));gap:8px}
.venue-designer .vd-icon-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;margin:0;padding:8px 3px;min-height:96px;min-width:0;border:1px solid #9db2a9;background:white;color:#18322f;line-height:1.25;font-size:12px;overflow-wrap:anywhere}
.venue-designer .vd-icon-tile:hover{background:#e7f4ec;border-color:#1b6855}.venue-designer .vd-icon-preview{display:block;width:54px;height:50px;flex:none}.venue-designer .vd-icon-preview .stage-icon{display:block;width:100%;height:100%}
.vd-allowed .vd-allowed-thumb{width:32px;height:30px;display:block;flex:none}.vd-allowed .vd-allowed-thumb .stage-icon{display:block;width:100%;height:100%}.vd-allowed label{border:1px solid #d4e0dc;border-radius:7px;padding:6px;margin:0;font-size:13px;min-width:0}.vd-numeric summary{font-weight:700}.vd-selection{min-height:24px}
@media(max-width:600px){.venue-designer .vd-board-wrap{padding:24px 14px}.vd-icon-grid{grid-template-columns:repeat(auto-fill,minmax(64px,1fr));gap:6px}.venue-designer .vd-icon-tile{min-height:90px}.venue-designer .vd-modes button{font-size:13px;padding:10px 8px}}

/* Axis-independent venue canvas: resizing one axis never auto-fits the other. */
.venue-designer .vd-board-wrap{overflow:auto;overscroll-behavior-x:contain}
.venue-designer .vd-board .stage-item{width:max(44px,calc(7.5cqw * var(--vd-icon-factor,1)))}
.venue-designer .vd-board .stage-item .stage-icon{width:calc(7.5cqw * var(--vd-icon-factor,1));height:calc(6.875cqw * var(--vd-icon-factor,1))}

/* Cross-browser dimension steppers: one click equals one persisted canvas unit. */
.venue-designer .vd-dimension-input{display:flex;align-items:stretch;max-width:100%;position:relative}
.venue-designer .vd-dimension-input input{min-width:0;width:100%;border-radius:6px 0 0 6px;appearance:textfield;-moz-appearance:textfield}
.venue-designer .vd-dimension-input input::-webkit-inner-spin-button,.venue-designer .vd-dimension-input input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.venue-designer .vd-dimension-buttons{display:flex;flex-direction:column;flex:none;width:44px}
.venue-designer .vd-dimension-buttons button{margin:0;padding:0;min-height:24px;flex:1;border-radius:0;background:#e4eee9;color:#214a3e;border:1px solid #8fa9a0;border-left:0;line-height:1;font-size:13px}
.venue-designer .vd-dimension-buttons button:first-child{border-radius:0 6px 0 0;border-bottom:0}.venue-designer .vd-dimension-buttons button:last-child{border-radius:0 0 6px 0}.venue-designer .vd-dimension-buttons button:active{background:#1b6855;color:white}
@media(pointer:coarse){.venue-designer .vd-dimension-buttons button{min-height:44px}}

/* Every display/print board owns its cqw sizing; never fall back to viewport units. */
.stage-surface,.stage{container-type:inline-size}
.stage-surface > .stage-item{min-width:0;min-height:0;margin:0;padding:1px}
.stage-surface .stage-item span{font-size:1cqw;max-width:11cqw}
.stage-surface .stage-item .text-size-s{font-size:1.1cqw}
.stage-surface .stage-item .text-size-m{font-size:1.6cqw}
.stage-surface .stage-item .text-size-l{font-size:2.3cqw}
.stage-surface .preset-fixed-label{font-size:1.1cqw;max-width:13cqw}
.stage-surface .fixed-speaker:after{font-size:1.1cqw}
.stage-surface > .stage-item.stage-text-item{padding:0;border:0}
.stage-surface .stage-item .stage-text{width:100%;max-width:100%;line-height:1.1}

.stage-surface > .stage-item{padding:0;border-width:.1cqw;border-radius:.8cqw}
.stage-surface > .stage-item.legacy-piece,.stage-surface > .stage-item.stage-text-item{border-width:0;border-radius:0}
/* Labels never consume the icon's height at narrow widths or during printing. */
.stage-surface:not(.vd-board) .stage-item:not(.legacy-piece) > .stage-icon{position:absolute;inset:0;width:100%;height:100%;flex:none}
.stage-surface .stage-item > span:not(.stage-icon):not(.stage-text){position:absolute;top:100%;left:50%;transform:translateX(-50%);width:max-content;max-width:11cqw}
.stage-surface > .stage-item{border:0;box-shadow:inset 0 0 0 .1cqw #789e8c}
.stage-surface > .stage-item.legacy-piece,.stage-surface > .stage-item.stage-text-item{box-shadow:none}

/* The speaker artwork fills its own centered box. The outer button supplies the touch target. */
.preset-fixed.has-main-speaker,
.venue-designer .vd-board .stage-item.has-main-speaker {
 width:4.75cqw;
 height:6.375cqw;
 min-width:0;
 min-height:0;
 border:0;
 border-radius:0;
 background:transparent;
 transform:translate(-50%,-50%);
}
.venue-designer .vd-board .stage-item.has-main-speaker.selected,
.stage-surface > .stage-item.has-main-speaker.selected {outline:none;background:transparent}
.venue-designer .vd-board .stage-item.has-main-speaker:focus-visible,
.stage-surface > .stage-item.has-main-speaker:focus-visible {outline:2px solid #e59c28}
.venue-designer .vd-board .stage-item.has-main-speaker > .main-speaker-art {
 inset:0;
 translate:none;
 width:100%;
 height:100%;
}
.main-speaker-art {transform-origin:center}
.venue-designer .vd-board .stage-item.has-main-speaker > .main-speaker-art {outline:1px dashed #64748b}
.venue-designer .vd-board .stage-item.has-main-speaker.selected > .main-speaker-art {outline:2px dashed #2563eb}
.stage-item .main-speaker-frame {visibility:hidden}
.stage-item.selected .main-speaker-frame {visibility:visible;stroke:#2563eb;stroke-width:2;stroke-dasharray:4 3}

