/* A self-contained photo workspace above the current task draft. */
.spe-dialog { --spe-bg:#10151f;--spe-panel:#19212e;--spe-text:#edf2fc;--spe-muted:#c0cad9;--spe-line:#354155;--spe-accent:#2456d8;position:fixed;inset:0;z-index:1000;width:min(940px,calc(100vw - 40px));height:min(900px,calc(100dvh - 40px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid var(--spe-line);border-radius:22px;overflow:hidden;background:var(--spe-bg);color:var(--spe-text);box-shadow:0 18px 70px #0007; }
.spe-dialog::backdrop { background:rgba(0,0,0,.75); }
.spe-dialog [hidden] { display:none!important; }
.spe-shell { display:flex;flex-direction:column;height:100%;min-height:0; }
.spe-header { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 20px;border-bottom:1px solid var(--spe-line);flex-shrink:0; }
.spe-header h2 { font-size:21px;line-height:1.3;font-weight:600;letter-spacing:-.025em; }
.spe-header p { font-size:13px;line-height:1.4;color:var(--spe-muted);margin:4px 0 0; }
.spe-dialog button { color:var(--spe-text);font:inherit;cursor:pointer;touch-action:manipulation;transition:background .15s ease,transform .15s ease; }
.spe-dialog button:active:not(:disabled) { transform:scale(.97); }
.spe-dialog button:focus-visible,.spe-canvas:focus-visible { outline:3px solid #759bff;outline-offset:2px; }
.spe-dialog button:disabled { opacity:.4;cursor:default; }
.spe-dialog svg { display:block;width:22px;height:22px;flex-shrink:0; }
.spe-close { display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;border:0;border-radius:50%;background:var(--spe-panel); }
.spe-stage { display:flex;align-items:center;justify-content:center;position:relative;flex:1;min-height:100px;overflow:hidden;background:#080c13; }
.spe-loading { padding:24px;color:var(--spe-muted);font-size:15px;line-height:1.5;text-align:center;max-width:380px; }
.spe-canvas { display:block;max-width:100%;max-height:100%;touch-action:none;cursor:crosshair;user-select:none;-webkit-user-select:none; }
.spe-controls { padding:12px 20px 8px;border-top:1px solid var(--spe-line);flex-shrink:0; }
.spe-tools { display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;max-width:520px;margin:0 auto; }
.spe-tools button { min-height:54px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:7px 4px;border:1px solid transparent;border-radius:12px;background:transparent;font-size:12px;font-weight:500;line-height:1.2; }
.spe-tools button[aria-pressed="true"] { background:#24365c;border-color:#759bff;color:#c9d8ff; }
.spe-options { min-height:56px;display:flex;align-items:center;justify-content:center;margin-top:6px; }
.spe-colors,.spe-ratios { display:flex;justify-content:center;gap:8px; }
.spe-color { display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:5px;border:2px solid transparent;border-radius:50%;background:transparent; }
.spe-color > span { width:27px;height:27px;border-radius:50%;border:1px solid #b5becb;box-shadow:0 0 0 2px #10151f; }
.spe-color[data-spe-color="#000000"] > span { background:#000000; }
.spe-color[data-spe-color="#ffffff"] > span { background:#ffffff; }
.spe-color[data-spe-color="#ff3b30"] > span { background:#ff3b30; }
.spe-color[data-spe-color="#34c759"] > span { background:#34c759; }
.spe-color[data-spe-color="#ffcc00"] > span { background:#ffcc00; }
.spe-color[aria-pressed="true"] { border-color:#759bff; }
.spe-ratios button { min-height:44px;min-width:52px;padding:7px 10px;border:1px solid var(--spe-line);border-radius:9px;background:var(--spe-panel);font-size:13px;font-weight:500; }
.spe-ratios button[aria-pressed="true"] { background:#24365c;border-color:#759bff; }
.spe-history { display:flex;justify-content:center;gap:12px;margin-top:4px; }
.spe-history button { min-height:44px;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;border:0;background:transparent;border-radius:8px;font-size:12px; }
.spe-history svg { width:18px;height:18px; }
.spe-error { flex-shrink:0;margin:0;padding:8px 20px;color:#ffd6cc;font-size:13px;line-height:1.45;background:#462b29; }
.spe-footer { display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px 18px;border-top:1px solid var(--spe-line);flex-shrink:0; }
.spe-footer button { min-height:48px;padding:11px 24px;border:0;border-radius:12px;font-size:16px;font-weight:600; }
.spe-cancel { background:var(--spe-panel); }
.spe-next { min-width:130px;background:var(--spe-accent);color:#fff!important; }
@media(max-width:700px) {
 .spe-dialog { inset:0;width:100%;height:100dvh;margin:0;border:0;border-radius:0; }
 .spe-header { padding:calc(12px + env(safe-area-inset-top)) 14px 12px; }
 .spe-header h2 { font-size:20px; }
 .spe-header p { font-size:12px; }
 .spe-controls { padding:10px 12px 4px; }
 .spe-tools { gap:4px; }
 .spe-colors,.spe-ratios { gap:6px; }
 .spe-history { gap:5px; }
 .spe-history button { padding:8px 5px;font-size:12px; }
 .spe-footer { padding:10px 14px calc(12px + env(safe-area-inset-bottom)); }
 .spe-footer button { min-height:48px;padding:10px 18px; }
 .spe-error { padding:8px 14px; }
}
@media(max-height:650px) and (min-width:701px) {
 .spe-dialog { height:calc(100dvh - 16px); }
 .spe-header { padding:8px 16px; }
 .spe-controls { padding:6px 16px; }
 .spe-tools button { min-height:44px;flex-direction:row; }
 .spe-options { min-height:44px;margin-top:2px; }
 .spe-history { margin:0; }
 .spe-footer { padding:8px 16px; }
}
@media(prefers-reduced-motion:reduce) { .spe-dialog button { transition:none; }.spe-dialog button:active:not(:disabled) { transform:none; } }
