button, input, select { font: inherit; color: inherit; }
.noise { position: fixed; inset: 0; opacity: .2; pointer-events: none; z-index: 10; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E"); }

.pm-wrap { position: relative; z-index: 11; max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px; }
.pm-hero { text-align: center; padding: 16px 0 4px; }
.pm-hero .kicker { color: var(--g-2); text-transform: uppercase; letter-spacing: 1.2px; font-size: 12px; font-weight: 700; }
.pm-hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -1.5px; margin: 12px 0 10px; font-weight: 600; }
.pm-hero p { color: var(--muted); font-size: 15px; max-width: 640px; margin: 0 auto; line-height: 1.5; }

.pm-drop { margin: 18px 0; padding: 30px 18px; border: 1.5px dashed var(--line-2); border-radius: 16px; background: var(--surface); text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.pm-drop:hover, .pm-drop.drag { border-color: var(--accent); }
.pm-drop strong { font-size: 15px; }
.pm-drop span { color: var(--g-2); font-size: 12.5px; }
.pm-drop.has { padding: 14px; }

.pm-app { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .pm-app { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.pm-opts { padding: 16px; display: flex; flex-direction: column; gap: 13px; }
.pm-row { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.pm-row > span, .pm-lab, .pm-check { color: var(--g-2); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 700; }
.pm-row em { font-style: normal; color: var(--ink); font-family: "DM Mono", monospace; text-transform: none; }
.pm-row.sm { gap: 4px; }
.pm-row select, .pm-hex { padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); font-size: 13px; outline: 0; }
.pm-row input[type=range], .pm-segs + input[type=range] { width: 100%; accent-color: var(--accent); }
.pm-block { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.pm-lab { margin-bottom: 2px; }

.pm-motion-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pm-motion { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.pm-motion:hover { border-color: var(--line-2); }
.pm-motion.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.pm-motion-ico { font: 600 15px "DM Mono", monospace; color: var(--ink); }
.pm-motion-lbl { font-size: 9.5px; color: var(--g-2); text-align: center; line-height: 1.1; }

.pm-segs { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.pm-segs button { flex: 1; padding: 7px 4px; border: 0; background: transparent; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--g-2); }
.pm-segs button.on { background: var(--solid); color: #fff; }
.pm-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pm-check input { accent-color: var(--accent); }
.pm-focal { margin: 0; color: var(--g-3); font-size: 11px; }
.pm-link { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 11px; font-weight: 700; padding: 0; }

.pm-color { border: 0; margin: 0; padding: 0; }
.pm-color legend { color: var(--g-2); text-transform: uppercase; letter-spacing: .5px; font-size: 11px; font-weight: 700; margin-bottom: 6px; }
.pm-color-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-pick { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: none; cursor: pointer; }
.pm-pick::-webkit-color-swatch-wrapper { padding: 3px; } .pm-pick::-webkit-color-swatch { border: none; border-radius: 6px; } .pm-pick::-moz-color-swatch { border: none; border-radius: 6px; }
.pm-hex { width: 86px; text-transform: uppercase; font-family: "DM Mono", monospace; }
.pm-swatches { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }
.pm-swatches button { width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; background: var(--sw); cursor: pointer; }

.pm-btn { padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 700; }
.pm-btn:hover { border-color: var(--line-2); }
.pm-btn.primary { background: var(--solid); color: #fff; border-color: var(--solid); }
.pm-btn:disabled { opacity: .5; cursor: default; }
.pm-note { color: var(--g-3); font-size: 11px; line-height: 1.5; margin: 0; }
.pm-dims { color: var(--g-2); font: 11px "DM Mono", monospace; margin: 4px 0 0; }

.pm-stage-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pm-suggest { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 13px; border-radius: 11px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); font-size: 13px; }
.pm-stage { border: 1px solid var(--line); border-radius: 14px; background: repeating-conic-gradient(#0000 0 25%, rgba(255,255,255,.04) 0 50%) 0/20px 20px, var(--surface-2); display: grid; place-items: center; padding: 12px; overflow: hidden; }
.pm-stage canvas { max-width: 100%; max-height: 64vh; border-radius: 4px; box-shadow: 0 8px 30px rgba(0,0,0,.25); display: block; }
.pm-previewnote { margin: 0; color: var(--g-3); font-size: 11.5px; text-align: center; }
.pm-render { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pm-prog { flex: 1; min-width: 120px; height: 8px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pm-prog span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }
.pm-status { color: var(--g-2); font-size: 12px; }
.pm-status.err { color: var(--danger, #ff6a5f); }
.pm-format { color: var(--g-3); font-size: 11.5px; line-height: 1.5; margin: 0; }
#dl { display: inline-block; text-decoration: none; }

/* batch */
.pm-batch { margin-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.pm-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px; }
.pm-thumb { position: relative; flex: none; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--surface-2); display: flex; flex-direction: column; }
.pm-thumb.on { border-color: var(--accent); }
.pm-thumb canvas { display: block; width: 96px; height: 54px; }
.pm-thumb-m { font-size: 9px; color: var(--g-2); text-align: center; padding: 2px 2px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.pm-thumb-x { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
.pm-batch-ctrls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pm-results { display: flex; flex-direction: column; gap: 6px; }
.pm-result { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); font-size: 13px; }
.pm-result-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pm-result-prog { flex: none; width: 80px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pm-result-prog b { display: block; height: 100%; width: 0; background: var(--accent); }
.pm-result a.pm-btn { flex: none; }
