:root {
  --ink: #172033;
  --muted: #6d788d;
  --line: #e3e8f0;
  --surface: #ffffff;
  --bg: #f4f7fb;
  --accent: #ff5b3d;
  --accent2: #ff8a52;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background:
  radial-gradient(circle at 50% -20%, #fff3ec 0, transparent 34rem), var(--bg);
  background-size:140% 140%; animation:ambient 14s ease-in-out infinite alternate; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; max-width: 1440px; margin: auto; padding: 0 34px; }
.brand { text-decoration: none; color: var(--ink); font-weight: 800; font-size: 21px; display: flex; align-items: center; gap: 10px; }
.brand b { color: var(--accent); }
.brand-mark { display:grid; place-items:center; width:34px; height:34px; border-radius:11px; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 8px 22px #ff5b3d42; }
.local-pill { display:flex; align-items:center; gap:7px; font-size: 13px; color: #445068; background: #fff; border:1px solid var(--line); padding:9px 13px; border-radius:999px; box-shadow:0 4px 16px #26364a0b; }
.local-pill b { font-weight:650; }
.local-pill span { display:inline-block; width:8px; height:8px; background:#22bf6d; border-radius:50%; margin-right:7px; box-shadow:0 0 0 4px #22bf6d1d; }
.local-pill.checking span { background:#ffb020; box-shadow:0 0 0 4px #ffb0201d; animation:autoPulse 1.6s ease-in-out infinite; }
.local-pill.offline span { background:#e54c4c; box-shadow:0 0 0 4px #e54c4c1d; }
.turnstile-host { position:fixed; right:12px; bottom:12px; z-index:50; }
main { max-width: 1440px; margin:auto; padding: 26px 34px 60px; }
.hero { text-align:center; max-width:900px; margin:28px auto 42px; }
.eyebrow { color:var(--accent); font-size:12px; font-weight:800; letter-spacing:.17em; }
h1 { font-size:clamp(38px,5vw,67px); line-height:1.04; letter-spacing:-.045em; margin:15px 0 18px; }
h1 em { font-style:normal; background:linear-gradient(100deg,var(--accent),#fd8d49); color:transparent; background-clip:text; }
.hero p { max-width:780px; margin:auto; font-size:18px; line-height:1.7; color:var(--muted); }
.workspace { max-width:1260px; margin:auto; }
.mode-tabs { display:flex; justify-content:center; gap:12px; margin-bottom:18px; }
.tab { position:relative; border:1px solid var(--line); background:#fff; border-radius:15px; padding:16px 26px; font-weight:700; color:#4c586d; box-shadow:0 7px 25px #2838500b; }
.tab.active { border-color:#ff765e; color:#e8462b; box-shadow:0 8px 25px #ff5b3d1c; }
.tab i { position:absolute; top:-10px; right:-8px; background:var(--accent); color:white; border-radius:7px; padding:3px 7px; font-size:10px; font-style:normal; }
.upload-layout { display:grid; grid-template-columns:1.03fr .97fr; gap:28px; align-items:stretch; }
.demo-card,.dropzone,.stage-card,.controls { background:rgba(255,255,255,.96); border:1px solid var(--line); border-radius:25px; box-shadow:0 18px 60px #23334c14; }
.demo-card { overflow:hidden; min-height:520px; display:flex; flex-direction:column; }
.demo-visual { position:relative; flex:1; overflow:hidden; background:linear-gradient(145deg,#292e36,#0f1218); }
.demo-visual::after { content:""; position:absolute; inset:0; background:radial-gradient(circle at 35% 40%,#9d9d9d40,transparent 35%),linear-gradient(145deg,transparent,#c9b49a18); }
.demo-before { position:absolute; z-index:2; left:12%; top:43%; font-size:clamp(56px,8vw,105px); color:#ffffff54; font-weight:700; letter-spacing:-.08em; }
.demo-clean { position:absolute; z-index:3; right:0; top:0; bottom:0; width:39%; backdrop-filter:contrast(1.1); background:#11151dd9; }
.demo-line { position:absolute; z-index:4; top:0; bottom:0; left:61%; width:3px; background:#fff; box-shadow:0 0 20px #0008; }
.demo-line span { position:absolute; top:50%; left:50%; translate:-50% -50%; display:grid; place-items:center; background:#fff; width:54px; height:54px; border-radius:50%; color:#43506a; font-weight:900; box-shadow:0 7px 25px #0004; }
.demo-caption { padding:22px 25px; display:flex; justify-content:space-between; gap:20px; align-items:center; }
.demo-caption span { color:var(--muted); font-size:13px; }
.dropzone { min-height:520px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; border:2px dashed #ffc2b7; padding:50px; transition:.2s; }
.dropzone.drag { border-color:var(--accent); background:#fff9f7; transform:translateY(-2px); }
.dropzone input { display:none; }
.upload-icon { display:grid; place-items:center; width:68px; height:68px; border-radius:22px; background:#fff0eb; color:var(--accent); font-size:36px; font-weight:500; margin-bottom:17px; }
.dropzone h2 { font-size:25px; line-height:1.35; margin:0 0 12px; }
.dropzone p { color:#95a1b6; margin:0 0 25px; }
.dropzone small { color:#9ba6b8; margin-top:16px; }
.primary,.secondary { border:0; border-radius:12px; padding:14px 21px; font-weight:750; }
.primary { position:relative; overflow:hidden; color:#fff; background:linear-gradient(110deg,var(--accent),var(--accent2)); box-shadow:0 10px 24px #ff5b3d35; transition:transform .2s,filter .2s,box-shadow .2s; }
.primary::after { content:""; position:absolute; top:-50%; bottom:-50%; left:-45%; width:32%; rotate:17deg; background:linear-gradient(90deg,transparent,#fff8,transparent); animation:buttonShine 4.5s ease-in-out infinite; }
.primary:hover { filter:brightness(1.04); transform:translateY(-1px); }
.secondary { color:#344157; background:#fff; border:1px solid var(--line); }
.editor { display:grid; grid-template-columns:285px 1fr; gap:20px; align-items:start; }
.hidden { display:none !important; }
.controls { padding:20px; position:sticky; top:18px; }
.step { display:flex; gap:12px; align-items:center; opacity:.48; padding:10px 4px; }
.step.active { opacity:1; }
.step b { display:grid; place-items:center; width:28px; height:28px; border-radius:9px; background:#f0f3f8; font-size:12px; }
.step.active b { color:#fff; background:var(--accent); }
.step div { display:flex; flex-direction:column; gap:3px; }
.step strong { font-size:13px; }
.step span { font-size:11px; color:var(--muted); }
.control-card { border-top:1px solid var(--line); margin-top:14px; padding-top:18px; }
.auto-badge { display:flex; align-items:center; gap:10px; padding:11px; margin-bottom:16px; border:1px solid #ffe0d8; border-radius:12px; background:linear-gradient(135deg,#fff8f5,#fff); }
.auto-badge > span { display:grid; place-items:center; width:31px; height:31px; flex:0 0 auto; border-radius:10px; color:#fff; background:linear-gradient(135deg,var(--accent),var(--accent2)); animation:autoPulse 2.3s ease-in-out infinite; }
.auto-badge div { display:flex; flex-direction:column; gap:2px; }.auto-badge b { font-size:12px; }.auto-badge small { color:var(--muted); font-size:10px; line-height:1.3; }
.control-card label { display:flex; justify-content:space-between; font-size:12px; font-weight:750; margin-bottom:10px; }
.control-card select { width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 11px; color:#344157; background:#fff; margin:0 0 16px; }
.control-card input[type=text] { width:100%; border:1px solid var(--line); border-radius:10px; padding:10px 11px; color:#344157; background:#fff; margin:0 0 8px; }
input[type=range] { accent-color:var(--accent); width:100%; }
.control-card .secondary { width:100%; margin-top:12px; padding:11px; font-size:12px; }
.segmented { display:grid; grid-template-columns:1fr 1fr; background:#f0f3f7; padding:4px; border-radius:11px; }
.segmented button { border:0; background:transparent; padding:9px; border-radius:8px; color:#657087; font-size:12px; font-weight:700; }
.segmented button.active { background:#fff; color:var(--accent); box-shadow:0 2px 8px #24334a12; }
.brush-label { margin-top:16px; }
.text-button { border:0; color:#69758a; background:transparent; font-size:12px; text-decoration:underline; padding:10px 0; }
.wide { width:100%; margin-top:13px; }
.stage-card { overflow:hidden; min-width:0; animation:stageIn .45s ease both; transition:box-shadow .3s,border-color .3s; }
.stage-card.processing { border-color:#ffb6a7; box-shadow:0 20px 70px #ff5b3d1f; }
.stage-toolbar { height:64px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; border-bottom:1px solid var(--line); }
.stage-toolbar > div:first-child { display:flex; align-items:center; gap:12px; }
.stage-toolbar small { color:var(--muted); }
.status-dot::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:#ffb020; margin-right:8px; }
.legend { color:var(--muted); font-size:11px; }
.legend i { display:inline-block; width:10px; height:10px; border-radius:3px; background:#ff3b4e88; margin-right:5px; }
.canvas-wrap { position:relative; min-height:620px; display:grid; place-items:center; overflow:hidden; background:
 linear-gradient(45deg,#eef1f5 25%,transparent 25%),linear-gradient(-45deg,#eef1f5 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#eef1f5 75%),linear-gradient(-45deg,transparent 75%,#eef1f5 75%),#f8fafc; background-size:22px 22px; background-position:0 0,0 11px,11px -11px,-11px 0; }
#imageCanvas { display:block; max-width:100%; max-height:72vh; cursor:crosshair; touch-action:none; }
.brush-cursor { position:absolute; z-index:7; border:2px solid #ff4d44; border-radius:50%; pointer-events:none; box-shadow:0 0 0 1px #fff,0 2px 7px #0004; translate:0 0; will-change:left,top,width,height; }
.brush-cursor.erase { border-color:#1769ff; background:#1769ff18; }
.stage-hint { margin:0; padding:13px 20px; color:var(--muted); font-size:12px; border-top:1px solid var(--line); }
.busy { position:absolute; inset:0; z-index:8; overflow:hidden; background:#ffffffdc; backdrop-filter:blur(9px); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:9px; animation:fadeIn .22s ease both; }
.busy span { color:var(--muted); font-size:12px; }
.cancel-job { position:relative; z-index:2; margin-top:10px; padding:9px 16px; border:1px solid #dce2eb; border-radius:12px; background:#fff; color:#566176; font-weight:700; cursor:pointer; }
.cancel-job:hover { border-color:#ff8c77; color:var(--accent); }
.ai-loader { position:relative; width:74px; height:74px; display:grid; place-items:center; margin-bottom:9px; }
.ai-loader span { position:relative; z-index:2; display:grid; place-items:center; width:43px; height:43px; border-radius:15px; color:#fff; font-weight:900; background:linear-gradient(135deg,var(--accent),var(--accent2)); box-shadow:0 9px 25px #ff5b3d45; }
.ai-loader i { position:absolute; inset:2px; border:1.5px solid #ff725777; border-radius:24px; animation:orbit 2.6s linear infinite; }
.ai-loader i:nth-child(2) { inset:9px -4px; border-color:#ffab8970; animation-direction:reverse; animation-duration:2s; }
.ai-loader i:nth-child(3) { inset:-5px 13px; border-color:#ff5b3d40; animation-duration:3.2s; }
.scan-line { position:absolute; left:8%; right:8%; height:2px; top:8%; opacity:.65; background:linear-gradient(90deg,transparent,var(--accent),transparent); box-shadow:0 0 18px #ff5b3d; animation:scan 2.8s ease-in-out infinite; }
@keyframes orbit { to { rotate:360deg; } }
@keyframes scan { 0%,100% { top:8%; opacity:0; } 18%,82% { opacity:.65; } 50% { top:92%; } }
@keyframes fadeIn { from { opacity:0; } }
@keyframes ambient { to { background-position:50% 10%; } }
@keyframes buttonShine { 0%,64% { left:-45%; } 86%,100% { left:125%; } }
@keyframes autoPulse { 50% { scale:1.06; box-shadow:0 0 0 6px #ff5b3d12; } }
@keyframes stageIn { from { opacity:0; translate:0 10px; } }
.compare { position:absolute; inset:0; overflow:hidden; user-select:none; -webkit-user-select:none; touch-action:none; background:#fff; cursor:ew-resize; }
.compare * { user-select:none; -webkit-user-select:none; }
.compare img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; pointer-events:none; -webkit-user-drag:none; }
#afterClip { position:absolute; inset:0; overflow:hidden; clip-path:inset(0 0 0 50%); }
#divider { position:absolute; top:0; bottom:0; left:50%; width:3px; background:#fff; box-shadow:0 0 14px #0006; cursor:ew-resize; }
#divider span { position:absolute; top:50%; left:50%; translate:-50% -50%; display:grid; place-items:center; width:50px; height:50px; border-radius:50%; background:white; color:#38465d; box-shadow:0 5px 24px #1b27384c; font-size:20px; }
.badge { position:absolute; top:15px; border-radius:8px; padding:6px 10px; background:#162033c7; color:#fff; font-size:11px; }
.badge.before { left:15px; }.badge.after { right:15px; background:#ff5b3ddd; }
.info-section,.trust-section,.faq-section { max-width:1260px; margin:110px auto 0; }
.section-heading { max-width:720px; margin:0 auto 34px; text-align:center; }
.section-heading span,.trust-section > div > span { color:var(--accent); font-size:11px; font-weight:850; letter-spacing:.16em; }
.section-heading h2,.trust-section h2 { margin:9px 0 0; font-size:clamp(30px,4vw,46px); letter-spacing:-.035em; }
.feature-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:18px; }
.feature-grid article { padding:30px; border:1px solid var(--line); border-radius:22px; background:#fff; box-shadow:0 14px 45px #23334c0d; }
.feature-grid article > b { display:grid; place-items:center; width:44px; height:44px; border-radius:14px; color:var(--accent); background:#fff0eb; }
.feature-grid h3 { margin:22px 0 8px; font-size:18px; }
.feature-grid p,.trust-section p,.faq-section p { color:var(--muted); line-height:1.65; }
.trust-section { display:grid; grid-template-columns:1.1fr .9fr; gap:65px; align-items:center; padding:48px; border-radius:28px; background:linear-gradient(135deg,#182238,#2b3446); color:#fff; box-shadow:0 25px 70px #17203326; }
.trust-section p { color:#bdc7d8; }
.trust-section ul { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0; padding:0; list-style:none; }
.trust-section li { padding:17px; border:1px solid #ffffff19; border-radius:14px; background:#ffffff0b; }
.trust-section li::before { content:"✓"; color:#ff8a52; font-weight:900; margin-right:9px; }
.faq-section { max-width:900px; }
.faq-section details { background:#fff; border:1px solid var(--line); border-radius:16px; margin:10px 0; padding:0 20px; box-shadow:0 10px 35px #23334c08; }
.faq-section summary { cursor:pointer; list-style:none; padding:20px 0; font-weight:750; }
.faq-section summary::after { content:"+"; float:right; color:var(--accent); font-size:21px; }
.faq-section details[open] summary::after { content:"−"; }
.faq-section details p { margin:0 0 20px; }
footer { max-width:1260px; margin:90px auto 0; padding:35px 25px 45px; border-top:1px solid var(--line); text-align:center; color:#8994a7; font-size:12px; }
.footer-brand { color:var(--ink); font-size:18px; font-weight:850; }.footer-brand b { color:var(--accent); }
footer p { margin:12px auto; max-width:720px; }
footer nav { display:flex; justify-content:center; gap:18px; margin:14px 0; }
footer a { color:#657087; }
.legal-page { max-width:850px; margin:50px auto 100px; padding:42px; background:#fff; border:1px solid var(--line); border-radius:25px; box-shadow:0 18px 60px #23334c0e; }
.legal-page h1 { font-size:clamp(34px,5vw,52px); }.legal-page h2 { margin-top:30px; }.legal-page p,.legal-page li { color:var(--muted); line-height:1.75; }
@media (max-width:900px) {
 .upload-layout { grid-template-columns:1fr; }.demo-card { display:none; }
 .editor { grid-template-columns:1fr; }.controls { position:static; }
 .canvas-wrap { min-height:460px; }.topbar,main { padding-left:18px; padding-right:18px; }
 .mode-tabs { overflow:auto; justify-content:flex-start; }.tab { white-space:nowrap; }
 .feature-grid,.trust-section { grid-template-columns:1fr; }.trust-section { padding:30px; gap:28px; }
 .info-section,.trust-section,.faq-section { margin-top:70px; }
}
@media (max-width:560px) {
 .topbar { height:64px; }.local-pill { padding:8px 10px; }.local-pill b { display:none; }
 .hero { margin-top:18px; }.hero p { font-size:16px; }
 .dropzone { padding:30px 18px; min-height:430px; }
 .trust-section ul { grid-template-columns:1fr; }
 .legal-page { margin:25px 16px 70px; padding:24px; }
}
