:root {
  --ink: #17221e;
  --muted: #64706a;
  --paper: #f7f6f1;
  --surface: #ffffff;
  --line: #dfe4dc;
  --forest: #124336;
  --forest-dark: #0c3328;
  --lime: #d9e96e;
  --clay: #f2ebe2;
  --danger: #a7372c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: linear-gradient(180deg, #eef1e9 0, var(--paper) 340px); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.site-header { max-width: 1200px; min-height: 92px; margin: 0 auto; padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--forest); color: var(--lime); font-weight: 800; font-size: 13px; letter-spacing: .04em; }
.brand h1, h2, h3, p { margin-top: 0; }
.brand h1 { margin-bottom: 0; font-size: 17px; line-height: 1.1; }
.eyebrow { margin-bottom: 5px; color: var(--forest); font-weight: 750; font-size: 11px; letter-spacing: .11em; text-transform: uppercase; }
.brand .eyebrow { margin-bottom: 3px; font-size: 9px; }
.privacy-note { margin: 0; color: var(--muted); font-size: 13px; }

.page-shell { max-width: 1200px; margin: 0 auto; padding: 38px 28px 64px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin: 0 0 32px; }
.intro > div { max-width: 690px; }
.intro h2 { margin-bottom: 12px; max-width: 620px; font: 700 clamp(30px, 4vw, 50px)/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.intro p:not(.eyebrow) { margin-bottom: 0; color: #47544d; font-size: 16px; line-height: 1.6; }
.steps { display: flex; flex: 0 0 auto; gap: 14px; margin: 0 0 4px; padding: 0; color: #4d5b53; font-size: 12px; font-weight: 650; list-style: none; }
.steps li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.steps span { display: grid; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: #dce6d3; color: var(--forest); font-size: 11px; }

.workspace { display: grid; grid-template-columns: minmax(310px, .82fr) minmax(450px, 1.18fr); gap: 22px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 25px rgba(23, 34, 30, .045); }
.scanner-panel, .review-panel { padding: 26px; }
.panel-heading, .contacts-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel h2 { margin-bottom: 0; font-size: 20px; letter-spacing: -.025em; }
.pill { border-radius: 99px; padding: 5px 9px; background: #e9f0e3; color: var(--forest); font-size: 11px; font-weight: 700; }

.drop-zone { display: flex; min-height: 225px; margin-top: 23px; padding: 27px; flex-direction: column; align-items: center; justify-content: center; border: 1.5px dashed #a9b9ac; border-radius: 13px; background: #fafcf8; color: var(--muted); text-align: center; transition: .18s ease; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--forest); background: #f1f7ed; }
.drop-zone strong { margin: 11px 0 6px; color: var(--ink); font-size: 15px; }
.drop-zone span:not(.upload-icon) { font-size: 12px; line-height: 1.5; }
.upload-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: var(--lime); color: var(--forest); font-size: 24px; font-weight: 800; }
.preview-wrap { position: relative; margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #eff2eb; }
.preview-wrap img { display: block; width: 100%; max-height: 260px; object-fit: contain; }
.text-button { position: absolute; top: 10px; right: 10px; padding: 7px 10px; border: 1px solid rgba(23,34,30,.15); border-radius: 8px; background: rgba(255,255,255,.9); color: var(--ink); font-size: 12px; font-weight: 700; }
.scan-actions { display: flex; margin-top: 20px; align-items: center; gap: 14px; }
.helper-text { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.button { min-height: 40px; padding: 0 15px; border: 1px solid transparent; border-radius: 9px; font-weight: 750; font-size: 13px; transition: .18s ease; }
.button-primary { background: var(--forest); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--forest-dark); transform: translateY(-1px); }
.button-primary:disabled { background: #aab5ae; cursor: not-allowed; }
.button-secondary { border-color: #cbd4cb; background: #fff; color: var(--forest); }
.button-secondary:hover { background: #f4f7f2; }
.scan-status { margin-top: 17px; padding: 12px; border-radius: 9px; background: #f2f5ee; }
.scan-status p { margin: 7px 0 0; color: #4e5d54; font-size: 12px; }
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #d9e2d6; }
.progress-track span { display: block; width: 4%; height: 100%; border-radius: inherit; background: var(--forest); transition: width .25s ease; }
.raw-text { margin-top: 17px; color: var(--muted); font-size: 12px; }
.raw-text summary { cursor: pointer; font-weight: 700; }
.raw-text pre { max-height: 150px; margin: 10px 0 0; padding: 12px; overflow: auto; border-radius: 8px; background: #f4f6f2; color: #3f4c45; font: 12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }

.review-copy { margin: 11px 0 20px; }
.duplicate-warning { padding: 5px 8px; border-radius: 7px; background: #fff3d6; color: #79530b; font-size: 11px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-grid label { display: grid; gap: 6px; color: #34443b; font-size: 12px; font-weight: 700; }
.full-width { grid-column: 1 / -1; }
input, textarea { width: 100%; border: 1px solid #cfd8d0; border-radius: 8px; outline: none; background: #fff; color: var(--ink); font-size: 14px; }
input { height: 39px; padding: 0 10px; }
textarea { padding: 9px 10px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(18, 67, 54, .11); }
.form-actions { display: flex; gap: 10px; margin-top: 21px; }

.contacts-panel { margin-top: 22px; padding: 26px; }
.contacts-heading { align-items: center; }
.contacts-heading h2 span { display: inline-grid; min-width: 23px; height: 23px; margin-left: 5px; padding: 0 5px; place-items: center; border-radius: 99px; background: #e8eee4; color: var(--forest); font-size: 12px; vertical-align: 2px; }
.contact-tools { display: flex; gap: 10px; align-items: center; }
.search-label input { width: 190px; }
.empty-state { padding: 49px 20px 43px; text-align: center; }
.empty-state > span { display: inline-grid; width: 42px; height: 42px; margin-bottom: 8px; place-items: center; border-radius: 50%; background: var(--clay); color: var(--forest); font-size: 25px; }
.empty-state h3 { margin: 0 0 5px; font-size: 15px; }
.empty-state p { max-width: 440px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.55; }
.table-wrap { margin-top: 23px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { padding: 0 12px 10px; color: var(--muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid #edf0eb; vertical-align: top; }
td:first-child, th:first-child { padding-left: 0; }
td:last-child, th:last-child { padding-right: 0; text-align: right; }
.contact-name, .contact-company { display: block; color: var(--ink); }
.contact-email, .contact-title { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.delete-button { border: 0; background: transparent; color: var(--danger); font-size: 12px; font-weight: 700; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 5; max-width: 340px; padding: 12px 15px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.18); font-size: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .site-header { padding: 17px 20px; }
  .privacy-note { display: none; }
  .page-shell { padding: 28px 20px 48px; }
  .intro { display: block; margin-bottom: 24px; }
  .intro h2 { font-size: 35px; }
  .steps { margin-top: 22px; overflow-x: auto; }
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .scanner-panel, .review-panel, .contacts-panel { padding: 20px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .full-width { grid-column: auto; }
  .scan-actions, .contacts-heading, .contact-tools { align-items: stretch; flex-direction: column; }
  .contact-tools .button, .search-label input { width: 100%; }
  .steps { gap: 10px; font-size: 11px; }
}
