@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600;9..40,700&family=Source+Serif+4:opsz,wght@8..60,600;8..60,700&display=swap');

:root {
  --bg: #090b10;
  --surface: #11151d;
  --surface2: #171c26;
  --line: rgba(255,255,255,.10);
  --muted: #96a0b5;
  --text: #f5f7fb;
  --lime: #bcf14d;
  --blue: #82aaff;
  --danger: #ff8d98;
  --shadow: 0 24px 70px rgba(0,0,0,.28);
}

body.light {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #eef2f7;
  --line: rgba(0,0,0,.10);
  --muted: #5c687c;
  --text: #111827;
  --shadow: 0 20px 50px rgba(15,23,42,.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 'DM Sans', Arial, sans-serif;
  overflow-x: hidden;
  transition: background .2s ease, color .2s ease;
}

body:before, body:after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(95px);
  pointer-events: none;
  z-index: -1;
  opacity: .14;
}
body:before { width: 420px; height: 420px; background: #4b66d7; top: -160px; left: -140px; }
body:after { width: 460px; height: 460px; background: #adcf4c; right: -210px; top: 290px; opacity: .08; }

.shell { max-width: 1170px; margin: auto; padding: 0 28px; }
header { height: 78px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.6px; }
.mark { width: 27px; height: 27px; background: var(--lime); color: #17200d; display: grid; place-items: center; border-radius: 8px; transform: rotate(-7deg); }
.mark svg { width: 16px; }

nav { display: flex; gap: 28px; align-items: center; }
nav a { text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600; }
nav a:hover { color: var(--text); }

.theme { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 9px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
.theme svg { width: 16px; }

.hero { padding: 82px 0 61px; text-align: center; position: relative; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(188,241,77,.27); border-radius: 20px; padding: 6px 11px; color: #d2ee91; background: rgba(188,241,77,.06); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }

h1 { font-family: 'Source Serif 4', Georgia, serif; font-size: clamp(42px, 6vw, 70px); line-height: 1.04; letter-spacing: -2.8px; max-width: 770px; margin: 17px auto 18px; font-weight: 600; }
h1 em { font-style: italic; color: var(--lime); }
.hero p { color: var(--muted); font-size: 16px; max-width: 595px; margin: 0 auto; line-height: 1.75; }

.actions { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
button { font: inherit; cursor: pointer; transition: .2s ease; }
.primary { border: 0; background: var(--lime); color: #142008; padding: 12px 17px; border-radius: 10px; font-weight: 800; box-shadow: 0 7px 22px rgba(188,241,77,.14); }
.primary:hover { transform: translateY(-2px); filter: brightness(1.05); }
.secondary { border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); padding: 11px 16px; border-radius: 10px; font-weight: 700; }
.secondary:hover { background: rgba(255,255,255,.07); }

.process { margin: 40px auto 0; display: flex; align-items: center; justify-content: center; gap: 11px; color: #a7b0c2; font: 11px 'DM Mono', monospace; }
.process span { display: flex; align-items: center; gap: 7px; }
.process b { width: 20px; height: 20px; border-radius: 5px; background: var(--surface2); display: grid; place-items: center; color: var(--lime); font-size: 11px; }
.process i { height: 1px; width: 26px; background: var(--line); display: block; }

.workspace { display: grid; grid-template-columns: 1.04fr .96fr; gap: 16px; align-items: start; padding-bottom: 44px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; }
.panel-title { font-size: 14px; font-weight: 800; letter-spacing: -.3px; display: flex; gap: 8px; align-items: center; }
.panel-title svg { width: 16px; color: var(--lime); }
.status { font: 10px 'DM Mono', monospace; color: var(--muted); letter-spacing: .03em; }

.dropzone { margin: 0 16px 15px; border: 1px dashed var(--line); border-radius: 12px; min-height: 337px; position: relative; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: var(--surface2); transition: .18s ease; overflow: hidden; }
.dropzone.drag { border-color: var(--lime); background: rgba(188,241,77,.045); transform: scale(1.015); }
.upload-icon { width: 47px; height: 47px; border-radius: 13px; display: grid; place-items: center; background: var(--bg); color: var(--lime); margin-bottom: 13px; }
.upload-icon svg { width: 22px; }
.dropzone h2 { margin: 0; font-size: 18px; letter-spacing: -.5px; }
.dropzone p { margin: 4px 0 15px; color: var(--muted); font-size: 12px; }
.file-note { margin-top: 17px; font: 10px 'DM Mono', monospace; color: var(--muted); }
.privacy { border-top: 1px solid var(--line); padding: 12px 19px 14px; color: var(--muted); font-size: 10px; line-height: 1.6; }

input[type=file] { display: none; }
.preview { display: none; width: 100%; height: 100%; position: absolute; inset: 0; background: #080a0e; }
.preview img { width: 100%; height: 100%; object-fit: contain; }
.preview .scan { display: none; position: absolute; left: 0; right: 0; height: 2px; background: var(--lime); box-shadow: 0 0 22px 6px rgba(188,241,77,.5); animation: scan 1.15s ease-in-out infinite; }
.analyzing .scan { display: block; }
@keyframes scan { 0%,100%{top:8%;opacity:.3}50%{top:90%;opacity:1} }

.image-actions { display: none; gap: 8px; padding: 0 16px 16px; }
.image-actions button { flex: 1; padding: 10px; border-radius: 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.replace { background: transparent; border: 1px solid var(--line); color: var(--text); }
.remove { background: transparent; border: 0; color: var(--muted); }
.analyze { background: var(--lime); border: 0; color: #142008; }

.has-file .dropzone { min-height: 337px; }
.has-file .dropzone > :not(.preview) { display: none; }
.has-file .preview, .has-file .image-actions { display: flex; }

.result-wrap { padding: 0 16px 16px; }
.empty-result { min-height: 337px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; padding: 25px; color: var(--muted); }
.empty-result svg { width: 29px; margin-bottom: 9px; color: var(--muted); }
.empty-result span { display: block; max-width: 200px; font-size: 12px; line-height: 1.65; }

.analysis { display: none; min-height: 337px; border: 1px solid var(--line); border-radius: 12px; padding: 36px 32px; }
.analysis h3 { margin: 0 0 7px; font-size: 16px; }
.analysis p { color: var(--muted); font-size: 12px; margin: 0 0 27px; }
.stages { display: grid; gap: 16px; }
.stage { display: flex; gap: 11px; align-items: center; color: var(--muted); font-size: 12px; transition: .3s; }
.stage b { width: 23px; height: 23px; border: 1px solid var(--line); border-radius: 50%; display: grid; place-items: center; font: 10px 'DM Mono'; }
.stage.active { color: var(--text); }
.stage.active b { border-color: var(--lime); color: #17200d; background: var(--lime); }
.stage.done { color: var(--text); }
.stage.done b { color: var(--lime); border-color: var(--lime); }

.result { display: none; }
.result-card { background: var(--surface2); border: 1px solid rgba(188,241,77,.26); border-radius: 12px; padding: 23px; position: relative; overflow: hidden; }
.result-card:after { content: ""; position: absolute; width: 130px; height: 130px; border-radius: 50%; background: var(--lime); filter: blur(75px); opacity: .08; right: -50px; top: -50px; }
.overline { font: 10px 'DM Mono'; color: var(--muted); text-transform: uppercase; letter-spacing: .13em; }
.value { font-size: 46px; line-height: 1.1; font-weight: 800; letter-spacing: -2.3px; margin: 7px 0 17px; }
.verified { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-size: 11px; font-weight: 700; }
.verified svg { width: 14px; color: var(--lime); }
.calcline { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font: 11px 'DM Mono'; }
.calcline strong { display: block; color: var(--text); font: 13px 'DM Mono'; margin-top: 6px; }

.detected { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.detected-head { padding: 13px 15px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.detected-head span { font-weight: 800; font-size: 12px; }
.detected-head button { border: 0; background: transparent; color: var(--lime); font-size: 11px; font-weight: 800; cursor: pointer; }
.data-row { display: grid; grid-template-columns: 1fr 105px 24px; gap: 9px; padding: 9px 12px; align-items: center; border-bottom: 1px solid var(--line); }
.data-row:last-child { border: 0; }
.data-row input { min-width: 0; width: 100%; color: var(--text); background: transparent; border: 0; outline: 0; font: 12px 'DM Sans'; }
.data-row .num { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px; text-align: right; font-family: 'DM Mono'; color: var(--text); }
.data-row .num:focus { border-color: var(--lime); }
.trash { border: 0; background: none; color: var(--muted); padding: 2px; cursor: pointer; }
.trash:hover { color: var(--danger); }

.manual { margin: 16px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface2); }
.manual label { font-size: 11px; font-weight: 800; display: flex; justify-content: space-between; margin-bottom: 8px; }
.manual label span { font-weight: 500; color: var(--muted); }
.manual-row { display: flex; gap: 8px; }
.manual input { min-width: 0; flex: 1; background: var(--bg); border: 1px solid var(--line); color: var(--text); padding: 9px 10px; border-radius: 7px; font: 12px 'DM Mono'; outline: 0; }
.manual input:focus { border-color: var(--lime); }
.manual button { border: 0; background: var(--lime); border-radius: 7px; padding: 0 12px; font-weight: 800; font-size: 11px; color: #17200d; cursor: pointer; }

.bottom { display: grid; grid-template-columns: 1.4fr .6fr; gap: 16px; padding: 0 0 26px; }
.how, .recent { padding: 19px 20px; }
.how h3, .recent h3 { margin: 0 0 14px; font-size: 14px; }
.steps { display: grid; gap: 10px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.step b { width: 20px; height: 20px; border-radius: 5px; background: var(--surface2); color: var(--lime); display: grid; place-items: center; font: 10px 'DM Mono'; }

.history-item { cursor: pointer; padding: 10px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 6px; font-size: 11px; color: var(--muted); }
.history-item strong { color: var(--text); font-family: 'DM Mono'; }
.clear { background: transparent; border: 0; color: var(--muted); font-size: 10px; padding: 0; float: right; cursor: pointer; }
.none { font-size: 11px; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 25px 0 34px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.footer-links { display: flex; gap: 17px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--lime); }

.recognized { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; color: var(--muted); font-size: 12px; }
.recognized summary { color: var(--text); cursor: pointer; font-weight: 700; }
.recognized textarea { display:block; width:100%; min-height:90px; resize:vertical; margin-top:10px; padding:9px; border:1px solid var(--line); border-radius:7px; background:var(--bg); color:var(--text); font:11px/1.55 'DM Mono',monospace; }
.recognized button { margin-top:8px; padding:8px 11px; border:0; border-radius:7px; background:var(--lime); color:#17200d; font-size:11px; font-weight:800; }
.ocr-confidence { min-height:16px; margin: -15px 0 12px; color:var(--muted); font:10px 'DM Mono',monospace; }
.privacy a { color: var(--lime); }
button:disabled { opacity: .6; cursor: wait; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 25px); opacity: 0; background: #eaf8be; color: #18200e; border-radius: 9px; padding: 10px 14px; font-size: 12px; font-weight: 700; transition: .25s; z-index: 10; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media(max-width: 780px) {
  .shell { padding: 0 16px; }
  header { height: 67px; }
  nav { display: none; }
  .hero { padding: 53px 0 40px; }
  h1 { letter-spacing: -2.4px; }
  .hero p { font-size: 14px; }
  .workspace, .bottom { grid-template-columns: 1fr; gap: 12px; }
  .dropzone { min-height: 300px; }
  .actions { flex-wrap: wrap; }
  .process { gap: 7px; }
  .process i { width: 10px; }
  footer { align-items: flex-start; gap: 14px; flex-direction: column; }
  .footer-links { flex-wrap: wrap; }
  .manual-row { flex-wrap: wrap; }
  .manual-row button { min-height: 38px; }
}
