#crop-workspace{width:100%;max-width:1240px;margin:0 auto;padding:16px 0 28px;font:15px/1.5 var(--font);color:var(--ink);box-sizing:border-box}
#crop-workspace *{box-sizing:border-box}
#crop-workspace .crop-topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 20px;padding:4px 0 12px;border-bottom:1px solid var(--line);font-size:18px}
#crop-workspace .crop-title{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;margin-bottom:18px}
#crop-workspace .crop-title h2{font-family:var(--font-display,var(--font));font-size:36px;line-height:1.3;font-weight:400;font-synthesis:none;letter-spacing:0}
#crop-workspace .crop-title p{grid-column:1/-1;font-size:14px;color:var(--muted);margin:0}
#crop-workspace #crop-original{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 15px;border:1px solid var(--line);border-radius:999px;color:var(--primary);background:var(--surface);font:600 13px var(--font)}
#crop-workspace #crop-original svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7}
#crop-workspace .crop-icon{position:static;display:grid;place-items:center;flex:none;width:var(--control-height);height:var(--control-height);padding:0;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);box-shadow:none;transform:none}
#crop-workspace .crop-icon svg{height:22px;width:22px}
#crop-workspace .crop-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(285px,31%);align-items:start;gap:24px}
#crop-workspace .crop-preview{min-width:0}
#crop-workspace .crop-stage{position:relative;display:block;width:100%;height:clamp(320px,58vh,620px);min-height:0;max-height:none;margin:0;padding:0;overflow:hidden;isolation:isolate;border:0;border-radius:16px;background:#383139;touch-action:none;user-select:none;cursor:move;box-shadow:none}
#crop-workspace #native-crop-image{position:absolute;display:block;margin:0;max-width:none;max-height:none;object-fit:fill;transform:none;pointer-events:none;user-select:none}
#crop-workspace #native-crop-frame{position:absolute;display:block;z-index:1;inset:auto;transform:none;min-width:0;min-height:0;border:2px solid #fff;box-shadow:0 0 0 9999px #21152280;background:none;cursor:move;touch-action:none;pointer-events:auto;outline-offset:6px}
#crop-workspace .crop-thirds{position:absolute;inset:0;pointer-events:none;background:linear-gradient(to right,transparent calc(33.333% - .5px),#ffffff70 calc(33.333% - .5px),#ffffff70 calc(33.333% + .5px),transparent calc(33.333% + .5px),transparent calc(66.666% - .5px),#ffffff70 calc(66.666% - .5px),#ffffff70 calc(66.666% + .5px),transparent calc(66.666% + .5px)),linear-gradient(to bottom,transparent calc(33.333% - .5px),#ffffff70 calc(33.333% - .5px),#ffffff70 calc(33.333% + .5px),transparent calc(33.333% + .5px),transparent calc(66.666% - .5px),#ffffff70 calc(66.666% - .5px),#ffffff70 calc(66.666% + .5px),transparent calc(66.666% + .5px))}
#crop-workspace .crop-handle{position:absolute;display:grid;place-items:center;z-index:2;width:44px;height:44px;min-width:0;min-height:0;padding:0;margin:0;border:0;border-radius:8px;background:transparent;box-shadow:none;transform:translate(-50%,-50%);touch-action:none;pointer-events:auto;color:#fff}
#crop-workspace .crop-handle::after{content:"";display:block;width:12px;height:12px;border:2px solid #fff;border-radius:3px;background:var(--primary);box-shadow:0 1px 5px #0006}
#crop-workspace .crop-handle[data-handle=nw]{left:0;top:0;cursor:nwse-resize}
#crop-workspace .crop-handle[data-handle=n]{left:50%;top:0;cursor:ns-resize}
#crop-workspace .crop-handle[data-handle=ne]{left:100%;top:0;cursor:nesw-resize}
#crop-workspace .crop-handle[data-handle=e]{left:100%;top:50%;cursor:ew-resize}
#crop-workspace .crop-handle[data-handle=se]{left:100%;top:100%;cursor:nwse-resize}
#crop-workspace .crop-handle[data-handle=s]{left:50%;top:100%;cursor:ns-resize}
#crop-workspace .crop-handle[data-handle=sw]{left:0;top:100%;cursor:nesw-resize}
#crop-workspace .crop-handle[data-handle=w]{left:0;top:50%;cursor:ew-resize}
#crop-workspace .crop-handle:is([data-handle=n],[data-handle=s])::after{width:22px;height:7px}
#crop-workspace .crop-handle:is([data-handle=e],[data-handle=w])::after{width:7px;height:22px}
#crop-workspace .crop-handle:focus-visible{outline:2px solid #fff;background:#ce4b8766}
#crop-workspace .crop-preview-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 2px;font-size:12px;color:var(--muted)}
#crop-workspace #crop-selection-size{font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--ink)}
#crop-workspace .crop-preview-meta p{margin:0}
#crop-workspace .crop-controls{padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--surface)}
#crop-workspace .crop-scroll-hint{display:none}
#crop-workspace .crop-controls:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
#crop-workspace .crop-control-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}
#crop-workspace h2{font-size:16px;font-weight:700}
#crop-workspace .crop-history{display:flex;gap:4px}
#crop-workspace .crop-history button{display:inline-flex;justify-content:center;align-items:center;gap:5px;min-height:44px;padding:6px 8px;margin:0;border:0;border-radius:12px;background:none;box-shadow:none;font:13px var(--font);color:var(--ink)}
#crop-workspace .crop-history svg{width:16px;height:16px}
#crop-workspace .crop-history button:hover{background:var(--bg)}
#crop-workspace .crop-ratios{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
#crop-workspace .crop-ratios button{height:44px;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--muted);font:13px var(--font);box-shadow:none}
#crop-workspace .crop-ratios button[aria-pressed=true]{color:var(--primary);background:var(--primary-soft,var(--bg));border-color:var(--primary);font-weight:700}
#crop-workspace .crop-move-modes{display:flex;padding:2px;margin:12px 0 8px;border-radius:10px;background:var(--bg)}
#crop-workspace .crop-move-modes button{flex:1;min-height:44px;padding:6px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--muted);box-shadow:none;font:13px var(--font)}
#crop-workspace .crop-move-modes button[aria-pressed=true]{border-color:var(--line);background:var(--surface);color:var(--ink);font-weight:700}
#crop-workspace .crop-zoom-row{display:grid;grid-template-columns:auto minmax(0,1fr) 4ch;align-items:center;gap:12px;margin:0 0 8px;font-size:13px}
#crop-workspace #crop-zoom-value{color:var(--ink);font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right}
#crop-workspace #crop-zoom{width:100%;min-width:0;height:44px;margin:0;accent-color:var(--primary)}
#crop-workspace .crop-precise{border-top:1px solid var(--line);padding-top:16px;font-size:13px}
#crop-workspace .crop-precise summary{min-height:32px;cursor:pointer;color:var(--ink);font-weight:600}
#crop-workspace .crop-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:12px 0}
#crop-workspace .crop-fields label{display:grid;gap:5px;color:var(--muted)}
#crop-workspace .crop-fields label>span{display:flex;align-items:center;gap:4px}
#crop-workspace .crop-fields input{width:100%;min-width:0;height:42px;padding:6px;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--surface);font:14px var(--mono)}
#crop-workspace .crop-precise p,#crop-workspace .crop-original-note{margin:12px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
#crop-workspace .crop-footer{display:flex;justify-content:flex-end;gap:12px;margin-top:12px;padding-top:16px;border-top:1px solid var(--line)}
#crop-workspace .crop-footer button{position:static;display:inline-flex;align-items:center;justify-content:center;gap:12px;width:auto;min-width:150px;height:50px;margin:0;padding:10px 22px;border-radius:999px;font:600 15px var(--font);box-shadow:none}
#crop-workspace .crop-footer #crop-confirm{background:var(--primary);color:var(--surface);border:1px solid transparent}
#crop-workspace .crop-footer #crop-confirm:hover{background:var(--primary-hover)}
#crop-workspace .crop-image-error{position:absolute;inset:0;display:grid;place-content:center;padding:24px;color:#fff;font-size:15px}
#crop-workspace .crop-image-error[hidden]{display:none}
#crop-workspace[data-intent="chart"] .crop-topbar{justify-content:flex-start}
#crop-workspace[data-intent="chart"] .crop-title h2{font:700 28px/1.3 var(--font)}
#crop-workspace[data-intent="chart"] .crop-controls{margin-top:0}
#crop-workspace[data-intent="chart"] .crop-footer #crop-original{justify-content:center}
@media(max-width:800px){
 #crop-workspace{padding:0 16px}
 #crop-workspace .crop-topbar{height:60px;margin:0 -16px 14px;padding:0 10px;background:var(--surface)}
 #crop-workspace .crop-icon:not(.task-back){background:transparent;border:0}
 #crop-workspace .crop-title h2{font:700 26px/1.3 var(--font)}
 #crop-workspace .crop-title{margin:0 0 14px}
 #crop-workspace .crop-title p{font-size:13px}
 #crop-workspace .crop-content{display:block}
 #crop-workspace .crop-stage{height:clamp(230px,35svh,380px)}
 #crop-workspace .crop-preview-meta{gap:4px;font-size:11px;padding:10px 2px}
 #crop-workspace .crop-controls{padding:8px 14px}
 #crop-workspace .crop-control-heading{margin-bottom:4px}
 #crop-workspace .crop-move-modes{margin:8px 0 4px}
 #crop-workspace .crop-precise{padding-top:7px}
 #crop-workspace .crop-precise summary{line-height:36px}
 #crop-workspace .crop-footer{position:sticky;bottom:0;z-index:4;padding:12px 16px max(12px,env(safe-area-inset-bottom));background:var(--surface);margin:16px -16px 0}
 #crop-workspace .crop-footer button{flex:1;min-width:0;padding:10px 14px;border-radius:14px}
 #crop-workspace[data-intent="chart"] .crop-title h2{font-size:22px}
 #crop-workspace[data-intent="chart"] .crop-stage{height:clamp(200px,40svh,400px)}
 #crop-workspace[data-intent="chart"] .crop-footer{gap:8px}
}
@media(max-height:500px) and (orientation:landscape){
 #crop-workspace[data-intent="chart"]{padding:4px 14px 0}
 #crop-workspace[data-intent="chart"] .crop-topbar{height:auto;margin:0 0 6px;padding:0 0 4px}
 #crop-workspace[data-intent="chart"] .crop-title{grid-template-columns:auto minmax(0,1fr);margin-bottom:8px}
 #crop-workspace[data-intent="chart"] .crop-title h2{font-size:18px}
 #crop-workspace[data-intent="chart"] .crop-title p{grid-column:2;font-size:12px}
 #crop-workspace[data-intent="chart"] .crop-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(224px,33%);gap:12px;height:max(120px,calc(100dvh - 166px))}
 #crop-workspace[data-intent="chart"] .crop-preview{height:100%;display:flex;flex-direction:column}
 #crop-workspace[data-intent="chart"] .crop-stage{flex:1;height:auto}
 #crop-workspace[data-intent="chart"] .crop-preview-meta{gap:8px;padding:6px 2px}
 #crop-workspace[data-intent="chart"] .crop-controls{max-height:100%;overflow:auto;overscroll-behavior:contain;padding:8px 12px}
 #crop-workspace[data-intent="chart"] .crop-control-heading{margin-bottom:4px}
 #crop-workspace[data-intent="chart"] .crop-footer{position:sticky;bottom:0;z-index:4;margin:8px 0 0;padding:8px 0 max(8px,env(safe-area-inset-bottom));background:var(--surface)}
}
@media(max-width:800px) and (max-height:650px) and (orientation:portrait){
 #crop-workspace .crop-topbar{height:48px;margin-bottom:8px}
 #crop-workspace .crop-title{gap:2px 8px;margin-bottom:8px}
 #crop-workspace .crop-title h2{font-size:22px}
 #crop-workspace .crop-title p{font-size:12px;line-height:1.5}
 #crop-workspace[data-intent] .crop-stage{height:clamp(184px,30svh,208px)}
 #crop-workspace .crop-preview-meta{padding:6px 2px}
 #crop-workspace .crop-controls{max-height:224px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;scroll-padding-block:8px}
 #crop-workspace .crop-scroll-hint{display:block;margin:6px 0 0;font-size:11px;line-height:1.5;color:var(--muted)}
 #crop-workspace .crop-footer{margin-top:8px;padding-top:8px}
}
@media(prefers-reduced-motion:no-preference){#crop-workspace .crop-controls button,#crop-workspace .crop-footer button{transition:background-color 120ms,color 120ms,border-color 120ms}}
