:root {
  --ink: #15211d;
  --muted: #718078;
  --line: #dce5df;
  --paper: #fbfdfb;
  --green: #27a56e;
  --green-dark: #19855a;
  --green-pale: #e8f7ef;
  --orange: #ff965c;
  --shadow: 0 24px 60px rgba(35, 76, 57, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: #f5f8f5;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }

.page-glow {
  position: fixed;
  z-index: -1;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  filter: blur(4px);
  pointer-events: none;
}
.page-glow--one { left: -180px; top: 80px; background: radial-gradient(circle, rgba(116, 217, 171, .2), transparent 68%); }
.page-glow--two { right: -160px; bottom: -130px; background: radial-gradient(circle, rgba(255, 181, 118, .18), transparent 68%); }

.topbar {
  height: 76px;
  padding: 0 max(28px, calc((100vw - 1240px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, .78);
  border-bottom: 1px solid rgba(207, 218, 211, .7);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: "DM Sans", sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.5px;
}
.brand b { color: var(--green); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border-radius: 11px;
  color: white;
  background: var(--green);
  box-shadow: 0 8px 18px rgba(39, 165, 110, .25);
}
.brand-mark svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid #dce9e1;
  border-radius: 999px;
  color: #5f7167;
  background: #f8fbf9;
  font-size: 12px;
}
.privacy-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(39, 165, 110, .11); }

main { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding-bottom: 54px; }
.hero { padding: 54px 0 35px; text-align: center; }
.eyebrow { color: var(--green); font: 700 11px/1 "DM Sans", sans-serif; letter-spacing: 2.3px; }
.hero h1 { margin: 14px 0 12px; font-size: clamp(34px, 4.3vw, 55px); line-height: 1.13; letter-spacing: -2px; }
.hero h1 em { color: var(--green); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 3px; right: 0; bottom: -4px; height: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 8'%3E%3Cpath d='M2 6c57-5 125-5 196-2' fill='none' stroke='%23ff965c' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center/100% 100% no-repeat; }
.hero p { max-width: 620px; margin: 0 auto; color: var(--muted); font-size: 15px; line-height: 1.8; }

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(211, 222, 215, .9);
  border-radius: 24px;
  background: rgba(255, 255, 255, .85);
  box-shadow: var(--shadow);
}
.input-column, .result-column { padding: 30px; }
.input-column { border-right: 1px solid var(--line); }
.result-column { background: rgba(250, 252, 250, .72); }
.section-heading { min-height: 34px; display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-heading > div { display: flex; align-items: center; gap: 11px; }
.section-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.step { color: var(--green); font: 700 11px "DM Sans", sans-serif; letter-spacing: 1px; }
.text-button { padding: 5px 0; border: 0; color: var(--green-dark); background: transparent; cursor: pointer; font-size: 12px; }
.count-pill { padding: 5px 10px; border-radius: 999px; color: #567064; background: #edf3ef; font-size: 11px; }

.drop-zone {
  width: 100%;
  height: 350px;
  padding: 0;
  overflow: hidden;
  position: relative;
  border: 1.5px dashed #a8c8b6;
  border-radius: 17px;
  background: linear-gradient(145deg, #f7fcf9, #f1f8f4);
  cursor: pointer;
  transition: .22s ease;
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--green); background: var(--green-pale); transform: translateY(-1px); }
.drop-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.paste-icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 19px; border-radius: 23px; color: var(--green); background: #dcf3e7; transform: rotate(-3deg); }
.paste-icon svg { width: 43px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.drop-empty h3 { margin: 0 0 11px; font-size: 16px; }
kbd { display: inline-block; min-width: 29px; padding: 3px 7px; border: 1px solid #cfdad3; border-bottom-width: 2px; border-radius: 6px; color: #405149; background: white; font: 600 12px "DM Sans", sans-serif; box-shadow: 0 2px 4px rgba(23, 51, 37, .07); }
.drop-empty p { margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.formats { color: #95a39c; font: 600 9px "DM Sans", sans-serif; letter-spacing: 1.2px; }
.preview-wrap { width: 100%; height: 100%; background: #18201c; }
.preview-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-badge { position: absolute; right: 12px; bottom: 12px; padding: 6px 9px; border-radius: 7px; color: white; background: rgba(11, 17, 14, .72); backdrop-filter: blur(8px); font-size: 10px; }
.tips { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; color: #78867f; font-size: 11px; line-height: 1.6; }
.tips p { margin: 0; }
.tips strong { color: #526159; }
.tip-icon { flex: 0 0 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--green-dark); background: #ddf2e7; font: 700 11px serif; }

.result-panel { height: 350px; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: white; }
.empty-state, .progress-state { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.radar-icon { color: #b6c8bd; }
.radar-icon svg { width: 80px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; opacity: .7; }
.empty-state h3, .progress-state h3 { margin: 13px 0 7px; font-size: 15px; }
.empty-state p, .progress-state p { margin: 0; color: #9aa69f; font-size: 11px; }

.scanner { position: relative; width: 94px; height: 70px; overflow: hidden; border: 1px solid #b7d8c5; border-radius: 9px; background: repeating-linear-gradient(0deg, #f1faf5, #f1faf5 6px, #e6f5ed 7px); }
.scanner::before, .scanner::after { content: ""; position: absolute; width: 14px; height: 14px; border-color: var(--green); border-style: solid; }
.scanner::before { left: -1px; top: -1px; border-width: 2px 0 0 2px; }
.scanner::after { right: -1px; bottom: -1px; border-width: 0 2px 2px 0; }
.scanner span { position: absolute; left: 5px; right: 5px; height: 2px; background: var(--orange); box-shadow: 0 0 8px var(--orange); animation: scan 1.7s ease-in-out infinite alternate; }
@keyframes scan { from { top: 8px; } to { top: 59px; } }
.progress-track { width: 210px; height: 5px; margin-top: 20px; overflow: hidden; border-radius: 5px; background: #e7eee9; }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--green), #52c88f); transition: width .25s; }
.progress-state strong { margin-top: 8px; color: var(--green-dark); font: 600 10px "DM Sans", sans-serif; }

.results { height: 100%; display: flex; flex-direction: column; }
.result-toolbar { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid #e8eeea; }
.search-field { flex: 1; height: 34px; display: flex; gap: 8px; align-items: center; padding: 0 10px; border-radius: 8px; background: #f4f7f5; }
.search-field svg { width: 15px; fill: none; stroke: #94a199; stroke-width: 2; stroke-linecap: round; }
.search-field input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.icon-button { width: 34px; border: 1px solid #e0e8e3; border-radius: 8px; color: #89978f; background: white; cursor: pointer; }
.icon-button:hover { color: #d45e5e; border-color: #efcccc; }
.icon-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.sku-list { flex: 1; overflow-y: auto; padding: 6px 12px; }
.sku-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 26px; gap: 8px; align-items: center; min-height: 48px; border-bottom: 1px solid #edf1ee; }
.sku-row:last-child { border-bottom: 0; }
.row-index { color: #a2aea7; font: 600 10px "DM Sans", sans-serif; }
.sku-input { width: 100%; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; outline: 0; color: #233a2f; background: transparent; font: 700 14px "DM Sans", sans-serif; letter-spacing: .5px; text-transform: uppercase; }
.sku-input:focus { border-color: #b7dac7; background: #f2faf6; }
.confidence { padding: 4px 7px; border-radius: 6px; color: var(--green-dark); background: #eaf8f0; font: 600 9px "DM Sans", sans-serif; }
.delete-row { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; color: #a3afa8; background: transparent; cursor: pointer; font-size: 16px; }
.delete-row:hover { color: #cf5e5e; background: #fff0f0; }
.no-filter-results { padding: 40px 10px; color: #97a49d; text-align: center; font-size: 11px; }
.raw-text-wrap { border-top: 1px solid #e8eeea; }
.raw-toggle { width: 100%; height: 31px; display: flex; gap: 5px; align-items: center; justify-content: center; border: 0; color: #829088; background: #fbfcfb; cursor: pointer; font-size: 10px; }
.raw-toggle svg { width: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.raw-toggle.open svg { transform: rotate(180deg); }
.raw-text { max-height: 140px; margin: 0; padding: 12px; overflow: auto; white-space: pre-wrap; color: #536159; background: #f7f9f7; font: 10px/1.7 ui-monospace, monospace; }

.actions { display: grid; grid-template-columns: 1fr 1.55fr; gap: 10px; margin-top: 16px; }
.actions button { height: 44px; border-radius: 11px; font-size: 12px; font-weight: 600; cursor: pointer; transition: .2s; }
.actions button:disabled { opacity: .45; cursor: not-allowed; }
.secondary-button { border: 1px solid #d9e3dd; color: #526159; background: white; }
.secondary-button:not(:disabled):hover { border-color: #a7c7b5; background: #f6faf7; }
.primary-button { display: flex; gap: 8px; align-items: center; justify-content: center; border: 0; color: white; background: var(--green); box-shadow: 0 9px 18px rgba(39, 165, 110, .2); }
.primary-button:not(:disabled):hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.toast { position: fixed; left: 50%; bottom: 28px; z-index: 10; padding: 10px 17px; border-radius: 10px; color: white; background: #1e2d26; box-shadow: 0 10px 30px rgba(13, 29, 21, .25); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 800px) {
  .topbar { height: 66px; padding: 0 20px; }
  .privacy-pill { display: none; }
  main { width: min(100% - 24px, 620px); }
  .hero { padding: 38px 12px 27px; }
  .hero h1 { letter-spacing: -1px; }
  .workspace { grid-template-columns: 1fr; }
  .input-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .input-column, .result-column { padding: 20px; }
  .drop-zone, .result-panel { height: 330px; }
}

@media (max-width: 420px) {
  main { width: calc(100% - 16px); }
  .input-column, .result-column { padding: 16px; }
  .workspace { border-radius: 18px; }
  .actions { grid-template-columns: 1fr; }
}
