.pg-page { min-height:100vh; background:linear-gradient(180deg,#fae6e2 0,#fff8f5 430px,#fff 900px); }
.pg-main { padding-block:48px 72px; }
.pg-main [hidden] { display:none !important; }
.pg-intro,.pg-title-row,.pg-file-row,.pg-run,.pg-dialog-head,.pg-axis { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.pg-intro { margin-bottom:30px; }
.pg-intro h1 { font:500 clamp(34px,4.6vw,54px)/1.12 var(--serif); letter-spacing:-.03em; }
.pg-intro p,.pg-card p,dialog > p { color:var(--muted); font-size:16px; line-height:1.55; margin-top:8px; }
.pg-intro p { max-width:650px; }
.pg-primary,.pg-secondary,.pg-file-button { display:inline-flex; align-items:center; justify-content:center; gap:12px; min-height:42px; border:1px solid #c69c92; border-radius:7px; background:#fffaf8; color:var(--accent-dark); padding:8px 16px; font:600 15px var(--sans); cursor:pointer; white-space:nowrap; }
.pg-primary { background:var(--accent-dark); color:white; border-color:var(--accent-dark); }
.pg-primary:disabled { opacity:.5; cursor:default; }
.pg-secondary:hover,.pg-file-button:hover { background:#faede8; }
.pg-main :focus-visible { outline:2px solid var(--accent-dark); outline-offset:3px; }
.pg-inputs { min-inline-size:0; padding:0; margin:0; border:0; display:grid; gap:18px; }
.pg-card { min-width:0; padding:22px; border:1px solid #e4d2cb; background:#fffdfa; border-radius:12px; }
.pg-card h2,.pg-task label,.pg-dialog-head h2 { margin:0; font:600 20px/1.3 var(--sans); color:var(--ink); }
.pg-title-row > span,.pg-file-row > span,.pg-axis,.pg-count-label { color:var(--muted); font:400 14px/1.5 var(--sans); }
.pg-task textarea { display:block; width:100%; box-sizing:border-box; margin-top:12px; padding:10px 12px; resize:vertical; min-height:48px; border:1px solid #d8c5bc; border-radius:6px; color:var(--ink); font:16px/1.55 var(--sans); background:#fff; }
.pg-pair,.pg-result-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.pg-video-card { display:flex; flex-direction:column; }
.pg-video-card > p:first-of-type { min-height:48px; }
.pg-preview { position:relative; aspect-ratio:16/9; max-height:260px; background:#f4ece7; border:1px solid #e9dcd4; border-radius:8px; margin:14px 0; display:grid; place-items:center; overflow:hidden; }
.pg-empty { font:italic 20px var(--serif); color:#89726a; }
.pg-preview video,.pg-result-pair video { display:block; height:100%; width:100%; object-fit:contain; background:#231e1c; }
.pg-preview video { position:absolute; inset:0; }
.pg-file-row { justify-content:flex-start; }
.pg-file-row > span { min-width:0; overflow-wrap:anywhere; }
.pg-file-button { position:relative; flex-shrink:0; overflow:hidden; }
.pg-file-button input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.pg-file-button:focus-within { outline:2px solid var(--accent-dark); outline-offset:3px; }
.pg-media-status:empty { display:none; }
.pg-media-status[data-error="true"],#evaluation-status[data-error="true"] { color:#9e342c; }
.pg-count-label { display:flex; align-items:center; gap:8px; }
.pg-count-label select,.pg-anchor input[type=number] { font:inherit; color:var(--ink); border:1px solid #d9c7bf; background:#fff; padding:5px 6px; border-radius:5px; }
#anchors { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); gap:14px; }
#anchors:not(:empty) { margin-top:18px; }
.pg-anchor { min-width:0; padding:10px; border:1px solid #eadbd4; border-radius:7px; background:#fff; }
.pg-anchor img { width:100%; aspect-ratio:4/3; display:block; border-radius:4px; object-fit:contain; background:#231e1c; }
.pg-anchor header,.pg-anchor label { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:3px 6px; margin:8px 0; font:14px var(--sans); }
.pg-anchor header strong { font-size:15px; }
.pg-anchor header span,.pg-anchor label { color:var(--muted); }
.pg-anchor input[type=number] { width:60px; }
.pg-anchor input:read-only { background:#f7f2ed; }
.pg-main input[type=range] { width:100%; display:block; accent-color:var(--accent-dark); cursor:pointer; }
.pg-tips { padding:14px 18px; margin-block:18px; border-left:3px solid #d9ab95; background:#faf2ec; border-radius:0 6px 6px 0; }
.pg-tips h2 { font:600 16px var(--sans); }
.pg-tips li,.pg-run > span { color:var(--muted); font:15px/1.55 var(--sans); }
.pg-tips ul { list-style:disc; margin:6px 0 0; padding-left:1.3em; }
.pg-tips li + li { margin-top:6px; }
.pg-tips strong { color:var(--ink); }
.pg-result { margin-top:24px; }
.pg-result-pair { margin-top:16px; align-items:center; }
.pg-result video { aspect-ratio:4/3; max-height:295px; border-radius:6px; }
#result-value { font:600 18px var(--sans); color:var(--accent-dark); }
#result-curve { display:block; width:100%; height:210px; }
.pg-axis { margin-top:4px; }
#examples { width:min(740px,calc(100% - 32px)); margin:auto; padding:24px; border:1px solid #e4d2cb; border-radius:12px; color:var(--ink); background:#fffbf8; }
#examples::backdrop { background:#32232080; }
#example-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-top:18px; }
.pg-example { border:1px solid #ddc9bf; border-radius:7px; background:#fff; padding:8px; text-align:left; color:var(--ink); cursor:pointer; }
.pg-example:hover { border-color:var(--accent-dark); }
.pg-example img { width:100%; aspect-ratio:4/3; object-fit:contain; background:#292321; border-radius:4px; }
.pg-example strong,.pg-example small { display:block; margin:6px 2px 0; font:550 15px/1.4 var(--sans); }
.pg-example small { color:var(--muted); font-size:13px; font-weight:400; }
@media(max-width:720px){.pg-main{padding-block:30px 48px}.pg-intro{align-items:flex-start;flex-direction:column}.pg-pair,.pg-result-pair{grid-template-columns:1fr}.pg-video-card>p:first-of-type{min-height:0}.pg-card{padding:16px}.pg-preview{max-height:none}.pg-run{align-items:flex-start;flex-direction:column}#example-list{grid-template-columns:1fr}.pg-example{display:grid;grid-template-columns:85px 1fr;column-gap:12px}.pg-example img{grid-row:span 2}.pg-example small,.pg-example strong{align-self:center}.pg-title-row{flex-wrap:wrap}}
