@font-face {
  font-family: 'Geist';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.7.0/dist/fonts/geist-sans/Geist-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Geist Mono';
  src: url('https://cdn.jsdelivr.net/npm/geist@1.7.0/dist/fonts/geist-mono/GeistMono-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root { color-scheme: light; --ink:#18181b; --muted:#71717a; --faint:#a1a1aa; --border:#e4e4e7; --surface:#fafafa; --accent:#2563eb; --accent-soft:#eff6ff; --danger:#dc2626; --radius:12px; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin:0; min-width:320px; color:var(--ink); background:#fff; font-family:'Geist',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif; -webkit-font-smoothing:antialiased; }
button,input { font:inherit; }
button { color:inherit; }
svg { fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.site-header { border-bottom:1px solid var(--border); }
.header-inner { width:min(1120px,calc(100% - 40px)); height:64px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; }
.brand { display:inline-flex; align-items:center; gap:10px; color:var(--ink); text-decoration:none; font-size:16px; font-weight:600; letter-spacing:-.02em; }
.brand-mark { width:22px; height:22px; display:flex; gap:3px; }
.brand-mark i { display:block; flex:1; border:1.7px solid currentColor; border-radius:2px; }
.tools-link { color:var(--muted); text-decoration:none; font-size:13px; font-weight:550; letter-spacing:-.01em; transition:color .16s ease; }
.tools-link:hover { color:var(--accent); }
main { width:min(1120px,calc(100% - 40px)); margin:0 auto; }
.hero { padding:72px 0 40px; text-align:center; }
.has-image .hero { display:none; }
h1 { margin:0; display:flex; align-items:center; justify-content:center; gap:14px; font-size:clamp(36px,5vw,56px); line-height:1.08; font-weight:600; letter-spacing:-.055em; text-wrap:balance; }
.title-icon { width:132px; height:72px; display:grid; place-items:center; flex:0 0 auto; color:var(--accent); }
.title-icon svg { width:120px; height:64px; stroke-width:1.6; }
.title-icon .cut-mark { stroke-width:1.4; stroke-dasharray:1 2.5; }
.tool { padding-bottom:72px; }
.drop-zone { min-height:280px; display:flex; flex-direction:column; align-items:center; justify-content:center; border:1px dashed #d4d4d8; border-radius:var(--radius); background:#fff; outline:none; cursor:pointer; transition:border-color .18s ease,background .18s ease; }
.drop-zone:hover,.drop-zone:focus-visible,.drop-zone.is-dragging { border-color:var(--accent); background:var(--accent-soft); }
.drop-zone:focus-visible { box-shadow:0 0 0 3px rgba(37,99,235,.18); }
.upload-icon { width:44px; height:44px; display:grid; place-items:center; margin-bottom:18px; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.04); }
.upload-icon svg { width:22px; }
.drop-zone strong { font-size:15px; font-weight:600; }
.editor { overflow:hidden; border:1px solid var(--border); border-radius:var(--radius); }
.editor-bar { min-height:72px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 16px; border-bottom:1px solid var(--border); overflow:hidden; }
.editor-actions { flex:0 0 auto; display:flex; align-items:center; gap:8px; }
.file-summary { min-width:0; flex:1 1 auto; display:flex; align-items:center; gap:12px; overflow:hidden; }
.thumb-wrap { flex:0 0 44px; width:44px; height:44px; overflow:hidden; border:1px solid var(--border); border-radius:7px; background:var(--surface); }
.thumb-wrap img { width:100%; height:100%; object-fit:cover; }
.file-summary>div:last-child { min-width:0; }
.file-summary strong,.file-summary span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-summary strong { font-size:13px; font-weight:550; }
.file-summary span { margin-top:4px; color:var(--muted); font:400 11px/1.2 'Geist Mono',monospace; font-variant-numeric:tabular-nums; }
.secondary-button,.primary-button { flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:8px; height:36px; padding:0 13px; border-radius:7px; cursor:pointer; font-size:12px; font-weight:550; transition:.16s ease; }
.secondary-button { border:1px solid var(--border); background:#fff; }
.secondary-button:hover { border-color:#a1a1aa; background:var(--surface); }
.secondary-button svg { width:15px; }
.preview-panel { min-width:0; padding:20px; }
.tool-row { min-height:44px; display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:14px; }
.interaction-help { flex:1 1 auto; min-width:180px; }
.interaction-help span { color:var(--muted); font-size:11px; }
.inline-controls { flex:0 1 auto; display:flex; align-items:center; justify-content:flex-end; gap:20px; }
.compact-control { display:grid; grid-template-columns:auto minmax(90px,150px) 54px; align-items:center; gap:10px; }
.compact-control label { color:var(--muted); font-size:11px; white-space:nowrap; }
.compact-control output { font:500 11px/1 'Geist Mono',monospace; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
h2 { margin:0; font-size:14px; font-weight:600; letter-spacing:-.02em; }
.reset-button { flex:0 0 auto; height:40px; padding:0 16px; border:1px solid #d4d4d8; border-radius:8px; color:var(--ink); background:#fff; box-shadow:0 1px 2px rgba(0,0,0,.04); cursor:pointer; font-size:13px; font-weight:550; transition:.16s ease; }
.reset-button:hover { border-color:#a1a1aa; background:var(--surface); }
.image-editor-dialog { width:min(960px,calc(100% - 32px)); max-width:none; padding:0; overflow:hidden; border:1px solid var(--border); border-radius:14px; background:#fff; box-shadow:0 24px 70px rgba(0,0,0,.2); }
.image-editor-dialog::backdrop { background:rgba(24,24,27,.48); backdrop-filter:blur(3px); }
.replace-drop-overlay { position:fixed; inset:16px; z-index:1000; display:grid; place-items:center; border:2px dashed var(--accent); border-radius:16px; color:var(--accent); background:rgba(239,246,255,.94); pointer-events:none; font-size:16px; font-weight:650; }
.image-editor-shell { display:flex; flex-direction:column; max-height:calc(100vh - 32px); }
.image-editor-header { height:60px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:0 18px; border-bottom:1px solid var(--border); }
.dialog-close { width:34px; height:34px; padding:0; border:0; border-radius:7px; color:var(--muted); background:transparent; cursor:pointer; font-size:22px; line-height:1; }
.dialog-close:hover { color:var(--ink); background:var(--surface); }
.crop-workspace { height:min(62vh,620px); min-height:360px; overflow:hidden; background-color:#f4f4f5; background-image:linear-gradient(45deg,#e4e4e7 25%,transparent 25%),linear-gradient(-45deg,#e4e4e7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e4e7 75%),linear-gradient(-45deg,transparent 75%,#e4e4e7 75%); background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0; }
#crop-image { display:block; width:100%; height:100%; object-fit:contain; }
.crop-workspace .cropper-container { width:100%!important; height:100%!important; }
.image-editor-footer { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 16px; border-top:1px solid var(--border); }
.transform-controls,.dialog-actions { display:flex; align-items:center; gap:8px; }
.transform-controls { min-width:0; flex:1 1 auto; }
.transform-button { height:40px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:0 12px; border:1px solid var(--border); border-radius:8px; background:#fff; cursor:pointer; font-size:12px; font-weight:550; white-space:nowrap; }
.transform-button:hover { border-color:#a1a1aa; background:var(--surface); }
.transform-button svg { width:16px; }
.angle-control { min-width:240px; flex:1 1 280px; display:grid; grid-template-columns:auto minmax(120px,1fr) 48px; align-items:center; gap:10px; margin-left:8px; }
.angle-control label { color:var(--muted); font-size:11px; }
.angle-control output { font:500 11px/1 'Geist Mono',monospace; text-align:right; }
.image-stage { position:relative; min-height:520px; display:grid; place-items:center; overflow:hidden; border-radius:8px; background-color:#f4f4f5; background-image:linear-gradient(45deg,#e4e4e7 25%,transparent 25%),linear-gradient(-45deg,#e4e4e7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e4e7 75%),linear-gradient(-45deg,transparent 75%,#e4e4e7 75%); background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0; cursor:crosshair; }
#source-image { display:block; max-width:100%; max-height:720px; user-select:none; }
.line-layer { position:absolute; pointer-events:none; }
.split-line { position:absolute; top:0; bottom:0; width:32px; margin-left:-16px; pointer-events:auto; touch-action:none; cursor:ew-resize; }
.split-line::before { content:''; position:absolute; left:15px; top:0; bottom:0; width:2px; background:var(--accent); box-shadow:0 0 0 1px rgba(255,255,255,.8); }
.remove-line { position:absolute; z-index:2; left:50%; top:8px; width:24px; height:24px; padding:0; transform:translateX(-50%); border:2px solid #fff; border-radius:50%; color:#fff; background:var(--ink); box-shadow:0 2px 8px rgba(0,0,0,.2); cursor:pointer; font:500 16px/18px 'Geist',sans-serif; }
.remove-line:hover,.remove-line:focus-visible { background:var(--danger); }
.split-line span { position:absolute; left:50%; top:50%; width:26px; height:26px; display:grid; place-items:center; transform:translate(-50%,-50%); border:2px solid #fff; border-radius:50%; color:#fff; background:var(--accent); box-shadow:0 2px 8px rgba(0,0,0,.2); font:600 10px/1 'Geist Mono',monospace; }
.split-line:focus-visible span,.split-line.is-active span { box-shadow:0 0 0 3px rgba(37,99,235,.25),0 2px 8px rgba(0,0,0,.18); transform:translate(-50%,-50%) scale(1.08); }
.padding-band { position:absolute; top:0; bottom:0; background:rgba(37,99,235,.16); border-left:1px dashed rgba(37,99,235,.65); border-right:1px dashed rgba(37,99,235,.65); pointer-events:none; }
.status { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.status.is-error { position:static; width:auto; height:auto; margin-top:10px; overflow:visible; clip:auto; white-space:normal; color:var(--danger); font-size:11px; }
input[type='range'] { width:100%; height:4px; appearance:none; border-radius:2px; background:linear-gradient(to right,var(--accent) 0 var(--progress,0%),#d4d4d8 var(--progress,0%) 100%); }
input[type='range']::-webkit-slider-thumb { width:16px; height:16px; appearance:none; border:3px solid #fff; border-radius:50%; background:var(--accent); box-shadow:0 0 0 1px rgba(0,0,0,.1),0 1px 3px rgba(0,0,0,.15); cursor:grab; }
.results-section { padding:0 0 88px; }
.results-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:20px; }
.primary-button { border:1px solid var(--ink); color:#fff; background:var(--ink); }
.primary-button:hover { border-color:var(--accent); background:var(--accent); }
.primary-button:disabled { opacity:.5; cursor:wait; }
.primary-button svg,.download-button svg { width:16px; }
.result-grid { width:100%; display:flex; align-items:stretch; overflow:visible; border-radius:8px; background-color:#f4f4f5; background-image:linear-gradient(45deg,#e4e4e7 25%,transparent 25%),linear-gradient(-45deg,#e4e4e7 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e4e4e7 75%),linear-gradient(-45deg,transparent 75%,#e4e4e7 75%); background-size:16px 16px; background-position:0 0,0 8px,8px -8px,-8px 0; }
.result-segment { position:relative; min-width:0; flex-basis:0; overflow:visible; }
.result-segment>img { display:block; width:100%; height:100%; object-fit:fill; }
.result-gap { min-width:1px; flex-basis:0; border-left:1px solid var(--accent); background:rgba(37,99,235,.08); }
.download-button { position:absolute; right:8px; bottom:8px; z-index:2; width:34px; height:34px; display:grid; place-items:center; border:1px solid var(--border); border-radius:7px; background:rgba(255,255,255,.94); box-shadow:0 1px 4px rgba(0,0,0,.1); cursor:pointer; }
.download-button:hover { color:#fff; border-color:var(--accent); background:var(--accent); }
button:focus-visible,input:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
@media (max-width:900px) { .tool-row{align-items:flex-start;flex-direction:column}.inline-controls{width:100%;justify-content:space-between}.compact-control{flex:1 1 0}.image-stage{min-height:420px}.image-editor-footer{align-items:stretch;flex-direction:column}.transform-controls,.dialog-actions{width:100%}.dialog-actions{justify-content:flex-end} }
@media (max-width:560px) { .header-inner,main{width:min(100% - 24px,1120px)}.hero{padding:52px 0 32px}h1{gap:10px;font-size:38px}.title-icon{width:96px;height:56px}.title-icon svg{width:92px;height:52px}.drop-zone{min-height:240px}.tool{padding-bottom:56px}.editor-bar{align-items:flex-start}.file-summary strong{max-width:42vw}.editor-actions .secondary-button{width:36px;padding:0;font-size:0}.preview-panel{padding:12px}.inline-controls{align-items:stretch;flex-direction:column;gap:12px}.compact-control{width:100%;grid-template-columns:98px minmax(0,1fr) 54px}.reset-button{width:100%}.image-stage{min-height:300px}.image-editor-dialog{width:calc(100% - 16px)}.crop-workspace{height:50vh;min-height:280px}.transform-controls{display:grid;grid-template-columns:repeat(3,1fr)}.transform-button{padding:0 8px;font-size:11px}.angle-control{min-width:0;grid-column:1/-1;margin:4px 0 0}.dialog-actions .secondary-button,.dialog-actions .primary-button{flex:1 1 0}.download-button{right:4px;bottom:4px;width:30px;height:30px} }
@media (prefers-reduced-motion:reduce) { *{scroll-behavior:auto!important;transition:none!important} }
