:root {
  color-scheme: dark;
  --bg: #303238;
  --surface: #41444c;
  --soft: #4b4e57;
  --line: #41444b;
  --text: #f0f1f4;
  --muted: #adafb9;
  --blue: #7796ff;
  --green: #34c759;
  --red: #ff3b30;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}
body { --muted: #c2c5cd; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); }
button, select, input { font: inherit; }
button, a { cursor: pointer; }
main { width: min(1040px, calc(100% - 44px)); margin: 0 auto; padding: 22px 0 42px; }
.topbar { display: flex; justify-content: space-between; align-items: center; height: 34px; }
.brand { display: flex; align-items: center; gap: 9px; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 25px; height: 25px; border-radius: 7px; color: #fff; background: var(--text); font-size: 13px; }
.local-state { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.local-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.start-screen { width: min(700px, 100%); margin: 0 auto; padding: 38px 0 18px; }
.intro { text-align: center; }
.eyebrow { display: inline-block; color: #8a8a8f; font-size: 10px; font-weight: 700; letter-spacing: .17em; }
.intro h1 { margin: 14px 0 12px; font-size: clamp(42px, 7vw, 68px); line-height: .98; letter-spacing: -.065em; font-weight: 750; }
.intro h1 span { color: #77777d; }
.intro-copy { margin: 0 0 30px; color: var(--muted); font-size: 15px; }
.upload-card { padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 40px #0000000b; transition: border-color .2s, box-shadow .2s; }
.upload-card:hover, .upload-card.drag { border-color: #a9cfff; box-shadow: 0 18px 50px #007aff12; }
.upload-main { display: flex; align-items: center; gap: 15px; min-height: 98px; }
.upload-icon { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 14px; color: var(--blue); background: #eaf3ff; font-size: 29px; font-weight: 300; }
.upload-copy { display: grid; gap: 6px; min-width: 0; }
.upload-copy strong { font-size: 16px; font-weight: 650; }
.upload-copy span { color: var(--muted); font-size: 12px; }
.upload-preview { position: relative; width: 82px; height: 82px; flex: 0 0 auto; overflow: hidden; border-radius: 12px; background: var(--soft); }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview span { position: absolute; right: 4px; bottom: 4px; padding: 3px 5px; border-radius: 5px; color: #fff; background: #0009; font-size: 9px; }
.upload-bottom { display: flex; justify-content: space-between; align-items: end; gap: 14px; padding-top: 18px; border-top: 1px solid var(--line); }
.mode-line { display: grid; grid-template-columns: auto minmax(260px, 1fr); align-items: center; gap: 7px 10px; min-width: 0; }
.mode-line label { color: var(--muted); font-size: 11px; }
.quality-buttons { display: flex; gap: 7px; }
.advanced-mode { position: relative; }
.advanced-mode summary { cursor: pointer; padding: 8px 4px; color: var(--muted); font-size: 11px; list-style: none; }
.advanced-mode summary::-webkit-details-marker { display: none; }
.advanced-mode summary::after { content: "⌄"; margin-left: 4px; }
.advanced-mode[open] summary::after { content: "⌃"; }
.advanced-mode[open] .quality-button { position: absolute; z-index: 4; top: 32px; right: 0; min-width: 150px; box-shadow: 0 8px 24px #0002; }
.quality-button { display: grid; gap: 2px; min-width: 122px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--surface); text-align: left; font-size: 12px; transition: border-color .15s, background .15s, color .15s, transform .15s; }
.quality-button small { color: inherit; font-size: 9px; opacity: .75; }
.quality-button.active { border-color: #8dc1ff; color: #075ca8; background: #eaf3ff; box-shadow: 0 3px 10px #007aff14; }
.mode-line > #quality-note { grid-column: 2; color: var(--muted); font-size: 10px; }
.primary-action, .download-button, .apply-action { border: 0; border-radius: 9px; color: #fff; background: var(--blue); box-shadow: 0 6px 15px #007aff2b; font-weight: 650; text-decoration: none; }
.primary-action { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 142px; padding: 10px 12px 10px 14px; }
.primary-action b { opacity: .55; font-size: 10px; font-weight: 500; }
.filename { min-height: 16px; margin-top: 11px; overflow: hidden; color: var(--blue); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
button:hover, a:hover { filter: brightness(.96); transform: translateY(-1px); }
button:disabled { opacity: .42; cursor: default; transform: none; }
button:focus-visible, select:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #80bfff; outline-offset: 2px; }
.progress-panel { margin-top: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.progress-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.progress-top div { display: grid; gap: 4px; }
.progress-top strong { font-size: 12px; font-weight: 650; }
.progress-top small { color: var(--muted); font-size: 11px; }
.progress-top output { color: var(--blue); font-size: 13px; font-variant-numeric: tabular-nums; }
.progress-track { height: 5px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: #e7e7eb; }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blue); transition: width .35s ease; }
.status { margin: 14px 0; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); font-size: 12px; }
.status.error { color: #b42318; border-color: #ffc7c2; background: #fff5f4; }
.workspace { margin-top: 20px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 14px 40px #00000009; }
.workspace-head { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.workspace-head h2 { margin: 5px 0 3px; font-size: 25px; letter-spacing: -.045em; }
.workspace-head small { color: var(--muted); font-size: 11px; }
.download-button { display: inline-flex; align-items: center; gap: 8px; padding: 10px 13px; font-size: 12px; white-space: nowrap; }
.download-button span { opacity: .65; font-size: 15px; }
.actions { display: flex; align-items: center; gap: 9px; }
.quiet { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; }
.danger { color: var(--red); }
.compare-card { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.compare-view { --compare-position: 50%; position: relative; min-height: min(68vh, 690px); overflow: hidden; background: repeating-conic-gradient(#fff 0 25%,#ebebee 0 50%) 50%/28px 28px; }
.compare-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; user-select: none; pointer-events: none; }
.compare-image.original { z-index: 1; background: #e5e5e7; clip-path: inset(0 calc(100% - var(--compare-position)) 0 0); }
.compare-clip { position: absolute; inset: 0; z-index: 2; overflow: hidden; background: repeating-conic-gradient(#fff 0 25%,#ebebee 0 50%) 50%/28px 28px; clip-path: inset(0 0 0 var(--compare-position)); }
.compare-clip .compare-image { width: 100%; height: 100%; max-width: 100%; }
.compare-divider { position: absolute; top: 0; bottom: 0; left: var(--compare-position); z-index: 3; width: 2px; transform: translateX(-1px); background: #fff; box-shadow: 0 0 0 1px #0002; pointer-events: none; }
.compare-divider span { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 31px; height: 31px; transform: translate(-50%,-50%); border-radius: 50%; color: #333; background: #fff; box-shadow: 0 2px 10px #0003; font-size: 14px; }
.compare-range { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.compare-label { position: absolute; bottom: 12px; z-index: 3; padding: 5px 8px; border-radius: 6px; color: #fff; background: #0008; font-size: 10px; pointer-events: none; }
.compare-label.left { left: 12px; }.compare-label.right { right: 12px; }
.compare-tip { padding: 10px; color: var(--muted); text-align: center; font-size: 11px; }
.editor-details { margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.editor-details > summary, .diagnostic > summary { padding: 15px 1px 2px; cursor: pointer; list-style: none; }.editor-details > summary::-webkit-details-marker, .diagnostic > summary::-webkit-details-marker { display: none; }.editor-details summary span, .diagnostic summary span { float: right; color: var(--blue); font-size: 17px; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 13px; margin: 15px 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); }.tool-group { display: grid; gap: 6px; }.tool-label, .range { color: var(--muted); font-size: 11px; }.segmented { display: flex; padding: 3px; border-radius: 9px; background: #e5e5e9; }.segmented button { border: 0; border-radius: 7px; padding: 7px 10px; color: var(--muted); background: transparent; font-size: 11px; }.segmented .active.keep { color: #16853a; background: #dff7e7; }.segmented .active.erase { color: #b42318; background: #ffe5e2; }.segmented .active.object-add { color: #075ca8; background: #dceeff; }.segmented .active.object-remove { color: #a12a71; background: #ffe0f1; }.range { display: flex; align-items: center; gap: 7px; padding-bottom: 5px; white-space: nowrap; }.range input { width: 100px; accent-color: var(--blue); }.range output { width: 24px; color: var(--text); text-align: right; }.tool-spacer { flex: 1; }.apply-action { padding: 9px 12px; font-size: 11px; }
.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.pane { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); }.pane-title { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 12px; }.pane-title small { color: var(--muted); font-size: 10px; }.legend-dot { display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; }.edit-dot { background: var(--green); }.result-dot { background: var(--blue); }.canvas-wrap, .result-wrap { height: min(56vh, 600px); display: grid; place-items: center; overflow: hidden; }.result-wrap { background: #ececf0; }.result-wrap img { max-width: 100%; max-height: 100%; object-fit: contain; }.checker { background-color: #d7d7d7; background-image: linear-gradient(45deg,#b5b5b5 25%,transparent 25%),linear-gradient(-45deg,#b5b5b5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#b5b5b5 75%),linear-gradient(-45deg,transparent 75%,#b5b5b5 75%); background-size: 30px 30px; background-position: 0 0,0 15px,15px -15px,-15px 0; }
#editorCanvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; }.preview { display: block; max-width: 100%; margin: 14px auto 0; border-radius: 10px; }.diagnostic { margin-top: 12px; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px; }.batch-item { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }.batch-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }.batch-item img { width: 100%; height: 170px; object-fit: contain; border-radius: 8px; background: #ddd; }.batch-item a { color: var(--blue); font-size: 11px; }.batch-item.failed { color: var(--red); border-color: #ffc7c2; }.batch-item.failed small { font-size: 10px; }
footer { display: flex; justify-content: space-between; margin-top: 26px; padding: 0 2px; color: #8a8a8f; font-size: 10px; }
.topbar { height: 52px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.brand strong { font-size: 21px; letter-spacing: -.8px; }
.brand-mark { width: 31px; height: 31px; border-radius: 10px; background: var(--blue); font-weight: 800; font-size: 19px; }
.upload-card, .workspace { box-shadow: none; border-radius: 20px; }
.upload-main { min-height: 120px; }
.result-display { display: grid; grid-template-columns: minmax(0,1fr) 96px; gap: 16px; }
.background-tabs { display: flex; flex-direction: column; gap: 8px; }
.background-tabs small { font-size: 10px; color: var(--muted); margin-top: 5px; }
.background-card { display: flex; align-items: center; gap: 8px; padding: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); color: var(--text); text-align: left; font-size: 12px; }
.background-card.selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.preview-stage { height: 190px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.preview-stage img { width: 100%; height: 100%; object-fit: contain; }
.background-card > span { padding: 10px 6px 6px; display: flex; gap: 7px; align-items: center; font-size: 12px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid #0002; }
.bg-green { background: #54ed00; }.bg-black { background: #111; }.bg-white { background: #fff; }
.preview-note { font-size: 11px; color: var(--muted); margin: 12px 0 20px; }
.compare-view { min-height: min(48vh,480px); }
.toolbar { background: var(--soft); margin-top: 0; align-items: center; }
#editStatus { color: var(--muted); font-size: 11px; }
.pane-title { gap: 8px; flex-wrap: wrap; }
#editorCanvas { display: block; cursor: none; }
#editorBackground { cursor: none; touch-action: none; padding: 24px; }
#brushCursor { position: fixed; z-index: 1000; pointer-events: none; border: 2px solid #4be68b; background: #4be68b22; border-radius: 50%; transform: translate(-50%,-50%); box-shadow: 0 0 0 1px #0008; }
.segmented { background: #24262b; }
.segmented .active.keep { background: #234536; color: #70efa6; }
.segmented .active.erase { background: #542b32; color: #ff939c; }
.quality-button.active { background: #334164; color: #c5d4ff; border-color: #7796ff; }
.upload-icon { background: #35415e; }
.progress-track { background: #454850; }
.compare-image.original, .result-wrap { background: #34363b; }
.status.error { color: #ffb2b2; border-color: #743e46; background: #422b30; }
/* The landing canvas is centred in the space below the full-width header. */
main { padding-top: 0; }
.topbar { position: relative; z-index: 1; height: 76px; padding: 0; border: 0; }
.topbar::before { content: ""; position: absolute; z-index: -1; inset: 0 calc((min(1040px, 100vw - 44px) - 100vw) / 2); background: #26282d; }
.start-screen { min-height: calc(100svh - 142px); display: flex; flex-direction: column; justify-content: center; padding: 44px 0; gap: 42px; }
.product-intro { position: relative; isolation: isolate; text-align: center; }
.product-intro::before { content: ""; position: absolute; z-index: -1; width: min(620px,100%); height: 260px; left: 50%; top: 50%; transform: translate(-50%,-50%); background: radial-gradient(ellipse,#8272ec16,transparent 68%); pointer-events: none; }
.product-intro h1 { margin: 0; font-family: -apple-system,BlinkMacSystemFont,"SF Pro Display","PingFang SC",sans-serif; font-size: clamp(38px,5.5vw,68px); line-height: 1.14; letter-spacing: -.055em; font-weight: 750; }
.headline-top { display: block; color: #f5f6fa; }
.headline-gradient { display: block; padding: 5px 0 10px; color: #b6a4ff; background: linear-gradient(105deg,#7ac9ff 10%,#8ca6ff 35%,#c08bff 59%,#f1abd5 86%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.upload-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
.upload-card:hover, .upload-card.drag { box-shadow: none; border: 0; }
.upload-main { min-height: 230px; flex-direction: column; justify-content: center; padding: 28px; border-radius: 12px; background: #484b54; cursor: pointer; outline-offset: 4px; transition: background .2s, box-shadow .2s; box-shadow: 0 16px 40px #181a2015; }
.upload-main:hover, .upload-card.drag .upload-main { background: #565a65; }
.upload-icon { color: #d9dfff; background: linear-gradient(145deg,#656e87,#535967); border-radius: 13px; width: 48px; height: 48px; font-weight: 200; }
.upload-copy { text-align: center; gap: 10px; }
.upload-copy strong { font-size: 20px; }.upload-copy span { font-size: 13px; }
.upload-bottom { justify-content: center; border: 0; padding-top: 24px; }
.primary-action { min-width: 190px; justify-content: center; padding: 14px 24px; background: #829aff; border-radius: 10px; box-shadow: none; }
.primary-action b { display: none; }
.filename { text-align: center; color: var(--muted); margin-top: 12px; }
.workspace, .compare-card, .toolbar, .pane, .status, .progress-panel { border: 0; box-shadow: none; }
.pane-title { border: 0; }.editor-details { border: 0; }
.has-result .start-screen { min-height: auto; padding: 36px 0 18px; gap: 20px; }
.has-result .upload-main { min-height: 150px; flex-direction: row; }
.has-result .product-intro h1 { font-size: 28px; }
.has-result .headline-top, .has-result .headline-gradient { display: inline-block; }
.has-result .headline-gradient { padding-left: .2em; }
.has-result .upload-copy { text-align: left; }
@media(max-width:700px) { .start-screen { min-height: calc(100svh - 140px); }.topbar::before { inset-inline: -12px; }.upload-main { min-height: 220px; }.has-result .upload-main { flex-wrap: wrap; }.upload-card { padding: 0 !important; } }
@media(max-width:700px) { .result-display { grid-template-columns: minmax(0,1fr); }.background-tabs { flex-direction: row; flex-wrap: wrap; align-items: center; }.background-tabs > .tool-label { display: none; }.background-tabs small { flex-basis: 100%; } }
@media (max-width: 700px) { main { width: min(100% - 24px, 600px); padding-top: 15px; }.start-screen { padding-top: 24px; }.intro h1 { font-size: 48px; }.upload-card { padding: 19px; }.upload-bottom { align-items: stretch; flex-direction: column; }.mode-line { grid-template-columns: auto 1fr; }.quality-buttons { flex-wrap: wrap; }.quality-button { flex: 1 1 120px; }.mode-line > #quality-note { grid-column: 2; }.primary-action { width: 100%; }.workspace { padding: 15px; }.workspace-head { align-items: start; flex-direction: column; }.workspace-head .download-button { width: 100%; justify-content: center; }.compare-view { min-height: 58vh; }.panes { grid-template-columns: 1fr; }.toolbar { align-items: stretch; }.tool-spacer { display: none; }footer { flex-direction: column; gap: 5px; } }
