:root {
  color-scheme: light;
  --ink: #162322;
  --muted: #62706e;
  --paper: #fbfaf7;
  --white: #ffffff;
  --line: #dce3df;
  --soft: #f0f4f1;
  --forest: #174d3c;
  --forest-dark: #0f372c;
  --mint: #dcece4;
  --amber: #e99045;
  --amber-soft: #fff0df;
  --red: #a93d3d;
  --red-soft: #fff0ef;
  --blue-soft: #e9f1f5;
  --shadow: 0 18px 50px rgba(22, 35, 34, 0.09);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid rgba(233, 144, 69, 0.75); outline-offset: 3px; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; transform: translateY(-160%); background: var(--ink); color: white; padding: 10px 14px; border-radius: 8px; }
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; max-width: 1280px; margin: 0 auto; padding: 18px 32px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(220, 227, 223, 0.75); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 780; letter-spacing: -0.02em; font-size: 1.15rem; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px 10px 14px 10px; background: var(--forest); color: white; font-family: Georgia, serif; font-style: italic; }
nav { display: flex; align-items: center; gap: 28px; font-size: 0.91rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--ink); }
.text-button { border: 0; background: none; color: var(--forest); padding: 7px 0; cursor: pointer; font-weight: 700; }

main { overflow: hidden; }
.hero { max-width: 1220px; margin: 0 auto; min-height: 650px; padding: 92px 48px 110px; display: grid; grid-template-columns: 1.08fr 0.92fr; align-items: center; gap: 80px; }
.hero-copy, .flow-card { min-width: 0; }
.eyebrow { margin: 0 0 12px; color: var(--forest); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { max-width: 700px; margin-bottom: 24px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.6rem, 7vw, 6.6rem); font-weight: 500; letter-spacing: -0.062em; line-height: 0.92; }
h2 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.25rem, 4.8vw, 4rem); font-weight: 500; line-height: 1; letter-spacing: -0.045em; }
h3 { margin-bottom: 8px; font-size: 1.14rem; letter-spacing: -0.015em; }
.hero-lead { max-width: 610px; margin-bottom: 32px; color: var(--muted); font-size: 1.17rem; }
.hero-actions, .panel-actions, .dialog-actions, .queue-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 11px 18px; border: 1px solid transparent; border-radius: 10px; text-decoration: none; font-weight: 760; cursor: pointer; transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button-primary { background: var(--forest); color: white; box-shadow: 0 8px 22px rgba(23, 77, 60, 0.18); }
.button-primary:hover:not(:disabled) { background: var(--forest-dark); }
.button-secondary { background: transparent; border-color: var(--line); color: var(--ink); }
.button-secondary:hover:not(:disabled) { background: var(--white); }
.button-danger { background: var(--red); color: white; }
.trust-list { display: flex; gap: 22px; flex-wrap: wrap; list-style: none; padding: 0; margin: 30px 0 0; color: var(--muted); font-size: 0.88rem; }
.trust-list li::before { content: "✓"; color: var(--forest); font-weight: 900; margin-right: 7px; }

.flow-card { position: relative; padding: 28px; border: 1px solid var(--line); border-radius: 24px; background: var(--white); box-shadow: var(--shadow); transform: rotate(1.2deg); }
.flow-card::before { content: ""; position: absolute; inset: -18px 18px 18px -18px; z-index: -1; border-radius: 24px; background: var(--mint); transform: rotate(-3deg); }
.flow-card-header { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.live-dot { color: var(--forest); font-size: 0.78rem; }
.live-dot::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #36a36f; box-shadow: 0 0 0 4px #dff3e8; }
.flow-steps { list-style: none; padding: 8px 0; margin: 0; }
.flow-steps li { display: flex; align-items: center; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.flow-steps li > span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--forest); font-weight: 800; font-size: 0.78rem; }
.flow-steps strong, .flow-steps small { display: block; }
.flow-steps small { color: var(--muted); margin-top: 2px; }
.route-motif { display: flex; align-items: center; padding-top: 22px; }
.route-point { width: 11px; height: 11px; border-radius: 50%; background: var(--amber); }
.route-line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, var(--amber) 0 7px, transparent 7px 13px); }
.route-pin { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50% 50% 50% 10px; transform: rotate(-45deg); background: var(--forest); color: white; }
.route-pin::first-letter { transform: rotate(45deg); }

.workflow-intro { background: var(--forest); color: white; padding: 96px max(32px, calc((100vw - 1120px) / 2)); }
.workflow-intro .eyebrow { color: #a8d1bd; }
.workflow-intro h2 { max-width: 720px; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 60px; background: rgba(255,255,255,0.16); }
.principle-grid article { min-height: 220px; padding: 30px; background: var(--forest); }
.principle-grid span { color: #a8d1bd; font-size: 0.76rem; font-weight: 800; }
.principle-grid h3 { margin-top: 48px; font-size: 1.3rem; }
.principle-grid p { color: #c8ddd3; }

.workspace-section { max-width: 1220px; margin: 0 auto; padding: 100px 48px; }
.section-heading { display: flex; justify-content: space-between; gap: 42px; align-items: end; margin-bottom: 38px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 460px; color: var(--muted); }
.message { margin-bottom: 20px; padding: 14px 16px; border-radius: 10px; background: var(--amber-soft); border: 1px solid #f0c690; }
.message.error { background: var(--red-soft); border-color: #efc0bd; color: #762d2d; }
.message.success { background: var(--mint); border-color: #b9d7c7; color: var(--forest-dark); }
.setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { display: flex; gap: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: 0 6px 24px rgba(22,35,34,0.04); }
.destination-panel { grid-column: 1 / -1; }
.panel-number { flex: 0 0 auto; display: grid; place-items: center; align-self: flex-start; width: 38px; height: 30px; border-radius: 20px; background: var(--mint); color: var(--forest); font-size: 0.72rem; font-weight: 850; }
.panel-content { flex: 1; min-width: 0; }
.panel-content > p, .field-hint { color: var(--muted); font-size: 0.9rem; }
label { display: block; margin-bottom: 7px; font-weight: 760; font-size: 0.87rem; }
select, textarea, input[type="text"] { width: 100%; border: 1px solid #cbd5d0; border-radius: 9px; background: var(--white); color: var(--ink); padding: 11px 12px; }
select { min-height: 46px; }
textarea { resize: vertical; min-height: 96px; }
textarea:focus, select:focus, input[type="text"]:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(23,77,60,0.1); outline: 0; }
#single-address-form .button { margin-top: 12px; }
.file-drop { display: grid; justify-items: center; gap: 5px; padding: 24px; border: 1.5px dashed #aebdb6; border-radius: 12px; background: var(--soft); cursor: pointer; text-align: center; }
.file-drop:hover { border-color: var(--forest); background: var(--mint); }
.file-icon { font-size: 1.5rem; color: var(--forest); }
.file-drop small { color: var(--muted); font-weight: 500; overflow-wrap: anywhere; }
.csv-preview { display: block; margin-top: 18px; }
.preview-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.inline-field { width: min(100%, 300px); }
.validation-list { margin: 18px 0; padding: 14px 16px; border-radius: 10px; background: var(--red-soft); color: #762d2d; }
.validation-list ul { margin: 8px 0 0; padding-left: 20px; }
.table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: white; font-size: 0.84rem; }
caption { text-align: left; padding: 10px 12px; color: var(--muted); }
th, td { padding: 10px 12px; border-top: 1px solid var(--line); text-align: left; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
th { background: var(--soft); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.panel-actions { justify-content: space-between; color: var(--muted); }

.queue-section { margin-top: 64px; }
.queue-header { display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.queue-header h3 { font-family: Georgia, serif; font-size: 2.3rem; font-weight: 500; margin-bottom: 0; }
.status-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 22px 0 16px; }
.status-tab { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; background: white; color: var(--muted); cursor: pointer; }
.status-tab span { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 5px; padding: 0 6px; border-radius: 999px; background: var(--soft); font-size: 0.72rem; }
.status-tab.active { background: var(--ink); border-color: var(--ink); color: white; }
.status-tab.active span { background: rgba(255,255,255,0.16); }
.progress { margin: 6px 0 16px; padding: 12px 14px; border-radius: 10px; background: var(--blue-soft); }
.empty-state { display: grid; place-items: center; min-height: 280px; padding: 40px; border: 1px dashed #b9c5bf; border-radius: 18px; color: var(--muted); text-align: center; }
.empty-state > div { font-size: 2.5rem; color: var(--forest); }
.empty-state h4 { margin: 8px 0 4px; color: var(--ink); font-size: 1.1rem; }
.record-list { display: grid; gap: 16px; }
.record-card { border: 1px solid var(--line); border-radius: 17px; background: white; overflow: hidden; box-shadow: 0 7px 24px rgba(22,35,34,0.04); }
.record-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 19px 21px; }
.record-index { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--soft); color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.record-address { min-width: 0; }
.record-address strong, .record-address small { display: block; }
.record-address strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-address small { margin-top: 3px; color: var(--muted); }
.status-badge { display: inline-flex; align-items: center; gap: 7px; border-radius: 999px; padding: 7px 10px; font-size: 0.75rem; font-weight: 800; }
.status-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-needs_review { background: var(--amber-soft); color: #945018; }
.status-ready { background: var(--mint); color: var(--forest); }
.status-no_match, .status-check_failed { background: var(--red-soft); color: var(--red); }
.status-pending { background: var(--blue-soft); color: #315e70; }
.record-detail { padding: 0 21px 22px 71px; }
.record-note { color: var(--muted); font-size: 0.9rem; }
.candidate-list { display: grid; gap: 10px; margin: 16px 0; }
.candidate { display: grid; grid-template-columns: auto 1fr 180px; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; }
.candidate:has(input:checked) { border-color: var(--forest); box-shadow: 0 0 0 2px rgba(23,77,60,0.08); }
.candidate input { margin-top: 4px; }
.candidate-title { font-weight: 770; }
.candidate-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 7px; color: var(--muted); font-size: 0.77rem; }
.candidate-meta span { padding: 3px 7px; border-radius: 5px; background: var(--soft); }
.geo-preview { position: relative; min-height: 92px; overflow: hidden; border-radius: 9px; background-color: #edf3ef; background-image: linear-gradient(rgba(23,77,60,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(23,77,60,.08) 1px, transparent 1px); background-size: 18px 18px; }
.geo-marker { position: absolute; width: 16px; height: 16px; transform: translate(-50%,-50%) rotate(-45deg); border-radius: 50% 50% 50% 8%; background: var(--amber); border: 2px solid white; box-shadow: 0 3px 8px rgba(0,0,0,.18); }
.geo-coordinates { position: absolute; left: 7px; bottom: 6px; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,.88); font-size: 0.65rem; }
.review-controls { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; padding: 15px; border-radius: 12px; background: var(--soft); }
.confirm-check { display: flex; align-items: flex-start; gap: 9px; font-weight: 600; color: var(--ink); }
.confirm-check input { margin-top: 4px; }
.recheck-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }
details.history { margin-top: 15px; }
details.history summary { cursor: pointer; color: var(--forest); font-weight: 720; }
.history-list { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.82rem; }
.history-list strong { color: var(--ink); }
.error-box { padding: 13px; border-radius: 10px; background: var(--red-soft); color: #762d2d; }

.privacy-section { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; padding: 90px max(32px, calc((100vw - 1120px) / 2)); background: var(--amber-soft); }
.privacy-section h2 { margin-bottom: 0; }
.privacy-copy { color: #6d5b4a; font-size: 1.02rem; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 42px max(32px, calc((100vw - 1120px) / 2)); background: var(--ink); color: white; }
.footer-brand { color: white; }
footer p { margin: 10px 0 0; color: #afbfbc; }
.attribution { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; color: #afbfbc; font-size: 0.82rem; }
.attribution a { color: white; }
dialog { max-width: 480px; border: 0; border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(15, 32, 29, 0.54); }
.dialog-actions { justify-content: flex-end; margin-top: 24px; }

@media (max-width: 860px) {
  .site-header { padding: 14px 20px; }
  nav a { display: none; }
  .hero { min-height: auto; grid-template-columns: minmax(0, 1fr); padding: 68px 24px 90px; gap: 62px; }
  h1 { font-size: clamp(3.3rem, 15vw, 5.3rem); }
  .flow-card { max-width: 600px; }
  .principle-grid { grid-template-columns: 1fr; }
  .principle-grid article { min-height: auto; }
  .principle-grid h3 { margin-top: 24px; }
  .workspace-section { padding: 76px 22px; }
  .section-heading, .privacy-section { grid-template-columns: 1fr; display: grid; gap: 22px; }
  .setup-grid { grid-template-columns: 1fr; }
  .destination-panel { grid-column: auto; }
  .candidate { grid-template-columns: auto 1fr; }
  .geo-preview { grid-column: 2; }
}

@media (max-width: 600px) {
  .site-header nav { gap: 10px; }
  .hero { padding-top: 54px; }
  h1 { max-width: 100%; font-size: clamp(3rem, 14vw, 4.2rem); line-height: 0.97; }
  .hero-actions .button { width: 100%; }
  .trust-list { display: grid; gap: 8px; }
  .workflow-intro { padding: 70px 22px; }
  .section-heading, .queue-header, .preview-heading, footer { align-items: stretch; flex-direction: column; display: flex; }
  .panel { padding: 20px; }
  .panel-number { display: none; }
  .queue-actions .button { flex: 1; }
  .status-tabs { flex-wrap: wrap; overflow-x: visible; }
  .record-summary { grid-template-columns: auto 1fr; }
  .record-summary .status-badge { grid-column: 2; justify-self: start; }
  .record-detail { padding-left: 20px; }
  .candidate { grid-template-columns: auto 1fr; }
  .geo-preview { grid-column: 1 / -1; }
  .review-controls, .recheck-form { grid-template-columns: 1fr; }
  .review-controls .button, .recheck-form .button { width: 100%; }
  .privacy-section { padding: 70px 22px; }
  .attribution { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
