.bar,.actions,.work,.buttons { display:flex; flex-wrap:wrap; align-items:center; gap:.7rem; }
.file { position:relative; overflow:hidden; background:var(--accent); color:#1a1206; font-weight:700; padding:.7rem 1.1rem; border-radius:10px; min-height:44px; display:inline-flex; align-items:center; }
.file input { position:absolute; inset:0; width:100%; opacity:0; cursor:pointer; }
.file:focus-within { outline:3px solid #f59e0b; outline-offset:3px; }
#source { overflow-wrap:anywhere; color:var(--text-2); font-size:.92rem; }
.work { align-items:flex-start; flex-wrap:nowrap; gap:1rem; margin:1.1rem 0; }
.work>div { flex:1; min-width:0; padding:1.2rem; background:#18191b; border:1px solid #393a3c; border-radius:14px; }
#frame { position:relative; width:fit-content; max-width:100%; margin:auto; }
#image { display:block; width:100%; height:auto; }
#outline { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
#outline polygon { fill:#edaf4b18; stroke:#edb35d; stroke-width:2px; vector-effect:non-scaling-stroke; }
.corner { position:absolute; transform:translate(-50%,-50%); border-radius:50%; background:#f1b456; color:#1c160d; border:2px solid #fff; width:38px; height:38px; min-height:0; padding:0; font-weight:800; touch-action:none; cursor:grab; box-shadow:0 2px 8px rgba(0,0,0,.45); }
.corner:hover:not(:disabled) { background:#f6c271; border-color:#fff; }
.hint { font-size:.9rem; margin:.8rem 0 0; }
#result { min-height:180px; display:grid; place-items:center; background:#232524; padding:.7rem; border-radius:10px; }
#output { max-width:100%; max-height:55vh; }
.actions { margin-top:1rem; }
.actions label { flex:1 1 140px; min-width:0; }
.actions label span { display:block; margin-bottom:.35rem; }
.actions select { width:100%; }
.buttons { margin-top:.9rem; }
#status { margin:.6rem 0 0; font-size:.9rem; }
@media(max-width:700px){.work{flex-direction:column;}.work>div{width:100%;padding:1rem;}}
[data-theme="light"] .work>div { background:var(--surface);border-color:var(--border); }
[data-theme="light"] #result { background:#e4e7e4; }
[data-theme="light"] select { background:#fff; color:var(--text); }
[data-theme="light"] .file { color:#fff; }
[data-theme="light"] button.primary { color:#fff; }
