:root {
  --ink: #142c27;
  --muted: #66736f;
  --green: #176b55;
  --green-dark: #0f4c3c;
  --lime: #d8f06a;
  --paper: #f6f8f5;
  --white: #fff;
  --line: #dce4df;
  --soft: #eaf1ec;
  --orange: #f29b72;
  --shadow: 0 22px 60px rgba(19, 57, 47, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: auto;
  padding: 0 28px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-family: Manrope, sans-serif; font-size: 18px; font-weight: 600; letter-spacing: -.4px; }
.brand b { font-weight: 800; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--green); }
.brand-mark svg { width: 18px; fill: none; stroke: white; stroke-width: 2.6; stroke-linecap: round; }
.all-models-link { border: 0; background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; padding: 10px 0; border-bottom: 1px solid var(--ink); }
.all-models-link span { margin-left: 6px; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.raw-pages-link { border: 0; border-radius: 8px; padding: 9px 13px; background: #e4ede7; color: var(--green-dark); font-size: 12px; font-weight: 800; cursor: pointer; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 28px 96px;
  text-align: center;
  background:
    radial-gradient(circle at 10% 10%, rgba(216,240,106,.4), transparent 24%),
    radial-gradient(circle at 88% 88%, rgba(242,155,114,.26), transparent 22%),
    var(--green-dark);
  color: white;
}
.hero::before, .hero::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.hero::before { width: 520px; height: 520px; left: -240px; bottom: -390px; }
.hero::after { width: 390px; height: 390px; right: -190px; top: -230px; }
.eyebrow, .section-kicker { text-transform: uppercase; letter-spacing: 1.8px; font-size: 11px; font-weight: 800; }
.eyebrow { display: inline-flex; gap: 9px; align-items: center; color: #dceae4; }
.eyebrow span { width: 7px; height: 7px; background: var(--lime); border-radius: 50%; box-shadow: 0 0 0 5px rgba(216,240,106,.12); }
h1, h2, h3 { font-family: Manrope, sans-serif; }
h1 { margin: 23px 0 20px; font-size: clamp(48px, 7vw, 82px); line-height: .98; letter-spacing: -4.5px; }
h1 em { color: var(--lime); font-style: normal; }
.intro { max-width: 620px; margin: 0 auto 36px; color: #d4dfdb; line-height: 1.7; font-size: 17px; }
.search-box {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 760px;
  margin: auto;
  padding: 8px 8px 8px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0,0,0,.26);
}
.search-icon { flex: 0 0 23px; width: 23px; fill: none; stroke: #5d6b67; stroke-width: 1.8; stroke-linecap: round; }
.search-box input { min-width: 0; flex: 1; height: 48px; border: 0; outline: 0; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: #8b9692; }
.search-box kbd { padding: 5px 8px; border: 1px solid #dde3df; border-radius: 6px; color: #8b9692; background: #f7f8f7; font-size: 11px; white-space: nowrap; }
.search-box button, .empty-state button { height: 48px; border: 0; border-radius: 11px; padding: 0 24px; background: var(--lime); color: #213b32; font-weight: 800; cursor: pointer; }
.quick-searches { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; align-items: center; margin-top: 22px; color: #aebdb8; font-size: 12px; }
.quick-searches button { padding: 7px 12px; color: #edf4f1; border: 1px solid rgba(255,255,255,.18); border-radius: 99px; background: rgba(255,255,255,.06); cursor: pointer; transition: .2s ease; }
.quick-searches button:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-1px); }
.recent-searches { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 12px; color: #9fb2ab; font-size: 11px; }
.recent-searches button { border: 0; border-bottom: 1px dotted rgba(255,255,255,.45); padding: 3px 1px; background: transparent; color: #d6e2de; cursor: pointer; }

.results-shell { max-width: 1180px; min-height: 490px; padding: 74px 28px 82px; margin: auto; }
.results-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.section-kicker { margin: 0 0 10px; color: var(--green); }
.results-heading h2, .how-it-works h2 { margin: 0; font-size: clamp(29px, 4vw, 43px); line-height: 1.08; letter-spacing: -2px; }
.result-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.results-tools { display: flex; align-items: center; gap: 14px; }
.share-search { display: inline-flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px; background: white; color: var(--green); font-size: 12px; font-weight: 800; cursor: pointer; }
.share-search svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 24px; scrollbar-width: none; }
.category-tabs::-webkit-scrollbar { display: none; }
.category-tabs button { white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; padding: 9px 15px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.category-tabs button.active { color: white; border-color: var(--green); background: var(--green); }
.results-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.result-card { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 245px; padding: 23px; border: 1px solid var(--line); border-radius: 18px; background: white; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; animation: rise .35s both; }
.result-card:hover { transform: translateY(-4px); border-color: #bad0c5; box-shadow: var(--shadow); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.category-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.category-badge::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--orange); }
.page-number { color: #89948f; font-size: 11px; font-weight: 700; }
.result-card h3 { margin: 22px 0 9px; font-size: 21px; line-height: 1.15; letter-spacing: -.7px; }
.match-copy { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.match-copy mark { padding: 1px 3px; color: var(--green-dark); background: #e9f5b7; border-radius: 3px; }
.card-action { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; padding-top: 18px; border-top: 1px solid #edf0ee; }
.card-action span { color: #7c8984; font-size: 12px; }
.open-model { border: 0; background: transparent; color: var(--green); font-size: 13px; font-weight: 800; cursor: pointer; padding: 4px 0; }
.open-model:hover { color: var(--green-dark); }
.card-buttons { display: flex; align-items: center; gap: 4px; }
.icon-button { width: 33px; height: 33px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #77857f; cursor: pointer; }
.icon-button:hover { color: var(--green); background: var(--soft); }
.icon-button.active { color: var(--green); background: #e5f0ea; }
.icon-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button.active .bookmark-shape { fill: currentColor; }
.empty-state { max-width: 520px; margin: 40px auto; text-align: center; }
.empty-icon { width: 55px; height: 55px; display: grid; place-items: center; margin: auto; border-radius: 50%; background: var(--soft); color: var(--green); font: 800 22px Manrope, sans-serif; }
.empty-state h3 { margin: 18px 0 7px; }
.empty-state p { color: var(--muted); }
.empty-state button { margin-top: 8px; }
.workflow-panel { margin-top: 58px; padding-top: 42px; border-top: 1px solid var(--line); }
.workflow-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 18px; }
.workflow-heading h2 { margin: 0; font-size: 25px; letter-spacing: -1px; }
.workflow-heading button { border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.history-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.6); cursor: pointer; text-align: left; }
.history-item:hover { border-color: #adc8bb; background: white; }
.history-item span { min-width: 0; }
.history-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px Manrope, sans-serif; }
.history-item small { color: var(--muted); font-size: 10px; }
.history-item b { color: var(--green); font-size: 18px; }

.how-it-works { display: grid; grid-template-columns: .8fr 1.2fr; gap: 80px; max-width: 1180px; margin: 0 auto 85px; padding: 62px; border-radius: 24px; background: #dfeae3; }
.how-it-works ol { list-style: none; margin: 0; padding: 0; }
.how-it-works li { display: grid; grid-template-columns: 48px 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid #c6d5cc; }
.how-it-works li:first-child { padding-top: 0; }
.how-it-works li:last-child { border: 0; padding-bottom: 0; }
.how-it-works li b { color: var(--green); font: 800 12px Manrope, sans-serif; }
.how-it-works li span { color: var(--muted); font-size: 13px; line-height: 1.5; }
.how-it-works li strong { display: block; margin-bottom: 4px; color: var(--ink); font: 700 16px Manrope, sans-serif; }

footer { display: flex; justify-content: space-between; align-items: center; gap: 40px; padding: 34px max(28px, calc((100vw - 1124px)/2)); background: var(--ink); color: white; }
.footer-brand { color: white; }
footer p { max-width: 530px; margin: 0; text-align: right; color: #9eb0aa; font-size: 12px; line-height: 1.5; }

.raw-library { width: min(1040px, calc(100vw - 32px)); height: min(820px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 20px; background: var(--paper); box-shadow: 0 40px 100px rgba(0,0,0,.4); overflow: hidden; }
.raw-library::backdrop { background: rgba(9,29,23,.76); backdrop-filter: blur(5px); }
.raw-header { display: flex; align-items: start; justify-content: space-between; gap: 24px; padding: 28px 32px 20px; background: white; }
.raw-header h2 { margin: 0; font-size: 29px; letter-spacing: -1.2px; }
.raw-header p:not(.section-kicker) { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.raw-close { width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--soft); font-size: 25px; cursor: pointer; }
.raw-search-wrap { display: flex; align-items: center; gap: 11px; margin: 18px 32px; padding: 0 15px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.raw-search-wrap svg { width: 19px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.raw-search-wrap input { min-width: 0; flex: 1; height: 46px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.raw-search-wrap span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.raw-page-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; height: calc(100% - 188px); padding: 0 32px 30px; overflow-y: auto; align-content: start; }
.raw-card { min-width: 0; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; }
.raw-card:hover { border-color: #acc7ba; box-shadow: 0 8px 25px rgba(19,57,47,.08); }
.raw-page-no { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); color: var(--green); font: 800 12px Manrope, sans-serif; }
.raw-card-copy { min-width: 0; }
.raw-card-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 12px Manrope, sans-serif; }
.raw-card-copy small { color: var(--muted); font-size: 10px; }
.raw-card-actions { display: flex; gap: 2px; }
.raw-open, .raw-share { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--green); cursor: pointer; }
.raw-open:hover, .raw-share:hover { background: var(--soft); }
.raw-open svg, .raw-share svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.raw-empty { padding: 60px 20px; text-align: center; color: var(--muted); }

.viewer { position: relative; width: min(1120px, calc(100vw - 32px)); height: min(880px, calc(100vh - 32px)); padding: 0; border: 0; border-radius: 18px; background: white; box-shadow: 0 40px 100px rgba(0,0,0,.4); overflow: hidden; }
.viewer::backdrop { background: rgba(9,29,23,.76); backdrop-filter: blur(5px); }
.viewer-bar { height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 18px 13px 24px; border-bottom: 1px solid var(--line); }
.viewer-bar h2 { margin: 2px 0 0; font-size: 19px; }
.viewer-category { color: var(--green); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; }
.viewer-actions { display: flex; align-items: center; gap: 12px; }
.viewer-actions a { color: var(--green); text-decoration: none; font-size: 12px; font-weight: 800; white-space: nowrap; }
.viewer-actions button { border: 0; border-radius: 10px; background: var(--soft); cursor: pointer; }
.viewer-actions #closeDialog { width: 40px; height: 40px; font-size: 25px; line-height: 1; }
.viewer-actions .viewer-share { height: 36px; padding: 0 13px; color: var(--green); font-size: 12px; font-weight: 800; }
.scan-viewer { height: calc(100% - 80px); overflow-y: auto; padding: 24px 100px 94px; background: #dfe5e1; scroll-behavior: smooth; }
.scan-page { position: relative; max-width: 760px; margin: 0 auto 20px; background: white; box-shadow: 0 10px 35px rgba(15,45,36,.14); }
.scan-page:last-child { margin-bottom: 0; }
.scan-page img { width: 100%; height: auto; display: block; }
.scan-page span { position: absolute; top: 10px; right: 10px; padding: 5px 8px; border-radius: 7px; background: rgba(20,44,39,.86); color: white; font-size: 10px; font-weight: 800; }
.document-actions { position: absolute; z-index: 4; right: 24px; bottom: 18px; display: flex; gap: 8px; padding: 7px; border: 1px solid rgba(255,255,255,.7); border-radius: 13px; background: rgba(255,255,255,.92); box-shadow: 0 12px 35px rgba(15,45,36,.2); backdrop-filter: blur(12px); }
.document-actions button, .document-actions a { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 0; border-radius: 9px; color: var(--green); background: var(--soft); text-decoration: none; font-size: 12px; font-weight: 800; cursor: pointer; }
.document-actions a { color: white; background: var(--green); }
.document-actions svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%, 20px); padding: 11px 17px; border-radius: 10px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-nav { display: none; }

@keyframes rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 880px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
  .history-list { grid-template-columns: 1fr 1fr; }
  .raw-page-grid { grid-template-columns: repeat(2, 1fr); }
  .how-it-works { margin-inline: 20px; padding: 42px; grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 600px) {
  body { padding-bottom: 68px; }
  .topbar { height: 60px; padding-inline: 14px; }
  .brand { gap: 8px; font-size: 15px; letter-spacing: -.5px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .all-models-link { font-size: 12px; }
  .topbar-actions { display: none; }
  .hero { padding: 42px 15px 47px; }
  .eyebrow { font-size: 9px; letter-spacing: 1.5px; }
  h1 { margin: 16px 0 13px; font-size: clamp(41px, 13vw, 52px); letter-spacing: -3.2px; }
  .intro { max-width: 340px; margin-bottom: 25px; font-size: 13px; line-height: 1.55; }
  .search-box { gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; }
  .search-icon { width: 20px; flex-basis: 20px; }
  .search-box input { height: 45px; font-size: 16px; }
  .search-box kbd { display: none; }
  .search-box button { width: 50px; height: 45px; padding: 0; font-size: 0; border-radius: 10px; }
  .search-box button::after { content: "→"; font-size: 21px; }
  .quick-searches { gap: 7px; margin-top: 16px; }
  .quick-searches span { width: 100%; }
  .quick-searches button { padding: 7px 11px; }
  .quick-searches button:nth-of-type(n+4) { display: none; }
  .recent-searches { margin-top: 9px; }
  .results-shell { min-height: 0; padding: 40px 14px 52px; }
  .results-heading { align-items: start; flex-direction: column; gap: 8px; }
  .results-heading h2 { font-size: 28px; letter-spacing: -1.4px; }
  .results-tools { width: 100%; justify-content: space-between; }
  .category-tabs { margin-inline: -14px; padding: 0 14px 18px; }
  .category-tabs button { padding: 8px 13px; }
  .results-grid { grid-template-columns: 1fr; }
  .history-list { grid-template-columns: 1fr; }
  .result-card { min-height: 205px; padding: 18px; border-radius: 15px; }
  .result-card h3 { margin: 17px 0 8px; font-size: 20px; }
  .card-action { margin-top: 17px; padding-top: 13px; }
  .card-action > span { display: none; }
  .card-buttons { width: 100%; }
  .icon-button { width: 41px; height: 41px; background: var(--soft); }
  .open-model { height: 41px; flex: 1; margin-left: 4px; border-radius: 9px; padding: 0 13px; background: var(--green); color: white; }
  .open-model:hover { color: white; }
  .workflow-panel { margin-top: 42px; padding-top: 34px; }
  .how-it-works { margin: 0 14px 48px; padding: 27px 20px; gap: 28px; border-radius: 18px; }
  .how-it-works h2 { font-size: 29px; }
  .how-it-works li { padding: 16px 0; }
  footer { padding: 28px 18px; flex-direction: column; align-items: start; }
  footer p { text-align: left; }
  .viewer { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
  .raw-library { width: 100vw; height: 100vh; max-width: none; max-height: none; border-radius: 0; }
  .raw-header { padding: 18px 15px 13px; }
  .raw-header h2 { font-size: 25px; }
  .raw-search-wrap { position: sticky; top: 0; z-index: 2; margin: 11px 14px; }
  .raw-page-grid { grid-template-columns: 1fr; height: calc(100% - 157px); padding: 0 14px 20px; }
  .raw-card { padding: 10px; }
  .raw-page-no { width: 38px; height: 38px; }
  .raw-open, .raw-share { width: 36px; height: 36px; }
  .viewer-bar { height: 72px; padding: 10px 12px 10px 14px; }
  .viewer-bar h2 { overflow: hidden; margin-top: 1px; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
  .viewer-actions { gap: 5px; }
  .viewer-actions a, .viewer-actions .viewer-share { display: none; }
  .viewer-actions #closeDialog { width: 36px; height: 36px; }
  .scan-viewer { height: calc(100% - 72px); padding: 10px 8px 85px; }
  .scan-page { margin-bottom: 10px; box-shadow: 0 5px 18px rgba(15,45,36,.13); }
  .scan-page span { top: 7px; right: 7px; }
  .document-actions { right: 10px; bottom: 10px; left: 10px; display: grid; grid-template-columns: 1fr 1fr; padding: 6px; }
  .document-actions button, .document-actions a { height: 46px; padding-inline: 8px; }
  .toast { bottom: 82px; width: max-content; max-width: calc(100vw - 30px); text-align: center; }
  .mobile-nav { position: fixed; z-index: 80; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(3, 1fr); height: 68px; padding: 7px max(10px, env(safe-area-inset-right)) max(7px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); box-shadow: 0 -8px 28px rgba(20,44,39,.1); backdrop-filter: blur(12px); }
  .mobile-nav button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 0; border-radius: 10px; background: transparent; color: #687670; font-size: 10px; font-weight: 700; cursor: pointer; }
  .mobile-nav button:active { background: var(--soft); color: var(--green); }
  .mobile-nav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mobile-nav b { position: absolute; top: 1px; left: calc(50% + 7px); min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; border-radius: 9px; background: var(--orange); color: white; font-size: 9px; }
}

@media (max-width: 370px) {
  .hero { padding-top: 35px; }
  h1 { font-size: 40px; }
  .quick-searches button { padding-inline: 9px; }
  .brand { font-size: 14px; }
}
