:root {
  color-scheme: light;
  --canvas: #f7f8f4;
  --surface: #fff;
  --rail: #f2f4ef;
  --wash: #edf3ed;
  --ink: #192922;
  --muted: #53635a;
  --line: #d8e0d8;
  --strong-line: #9daea1;
  --forest: #204b39;
  --deep: #163c2e;
  --lime: #d9efac;
  --radius: 14px;
  --gutter: clamp(24px, 3.5vw, 60px);
  --sans: Inter, "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  font: 15px/1.6 var(--sans);
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
a { color: var(--forest); text-underline-offset: .2em; }
button, a, summary, input, select, textarea { touch-action: manipulation; }
:where(a, button, input, textarea, select, summary):focus-visible {
  outline: 3px solid #3976a5;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
p, h1, h2, h3, h4, blockquote { margin: 0; }
p, h1, h2, h3, h4, label, summary, blockquote { overflow-wrap: anywhere; }
.skip {
  position: fixed;
  left: 12px;
  top: -100px;
  z-index: 15;
  padding: 10px 16px;
  border-radius: 6px;
  color: white;
  background: var(--deep);
}
.skip:focus { top: 12px; }

/* The rail and the top bar share a baseline across all eight sections. */
.app { display: grid; grid-template-columns: 234px minmax(0, 1fr); min-height: 100dvh; }
#sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--rail);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 0 23px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  line-height: 1.12;
  font-weight: 730;
  letter-spacing: -.045em;
}
.brand span { display: block; margin-top: 3px; font-size: 12px; font-weight: 560; letter-spacing: .045em; color: var(--muted); }
.mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 33px;
  height: 34px;
  border-radius: 8px;
  background: var(--deep);
}
.mark::before, .mark::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 15px;
  border: 1.5px solid var(--lime);
  border-radius: 1.5px;
  transform: skewY(-15deg);
}
.mark::before { left: 8px; top: 11px; opacity: .65; }
.mark::after { left: 13px; top: 7px; background: var(--deep); }
nav { padding: 12px 12px 28px; }
nav p {
  margin: 23px 12px 7px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .095em;
  color: var(--muted);
}
nav p:lang(th) { font-size: 12px; letter-spacing: 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  margin: 2px 0;
  padding: 7px 12px;
  border-radius: 8px;
  color: #47594e;
  text-decoration: none;
  line-height: 1.45;
  font-size: 14px;
  font-weight: 510;
}
.nav-item:hover { background: #e6ece5; color: var(--deep); }
.nav-item[aria-current="page"] { background: var(--deep); color: #fff; font-weight: 620; }
.nav-icon, .nav-item > span:first-child {
  width: 20px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-icon svg, .nav-item > svg, header svg, .source-tabs svg, .actions svg, .privacy-card svg, .scope-card svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.nav-item[aria-current="page"] .nav-icon { color: var(--lime); }
.side-foot { margin: auto 20px 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-foot a { display: inline-flex; align-items: center; min-height: 37px; font-size: 13px; font-weight: 610; text-decoration: none; }
.side-foot a:hover { text-decoration: underline; }
.side-foot span { display: block; font-size: 10px; color: var(--muted); }
.main-wrap { min-width: 0; }
.main-wrap > header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 8px var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.crumb, .slash { color: var(--muted); }
.slash { opacity: .75; }
#crumb { font-weight: 610; }
.header-end { display: flex; align-items: center; gap: 16px; min-width: 0; margin-left: auto; }
.header-end a { text-decoration: none; }
#lang-link, .account-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 610;
  color: var(--ink);
}
#lang-link { min-width: 37px; padding: 0 5px; }
#lang-link:hover { text-decoration: underline; }
.account-chip { padding: 4px 11px; border: 1px solid var(--line); border-radius: 8px; }
.account-chip:hover { border-color: var(--strong-line); }
#identity { max-width: 164px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-brand, #menu, #menu-scrim { display: none; }
#main { min-width: 0; max-width: 1450px; margin-inline: auto; padding: clamp(32px, 4.3vw, 66px) var(--gutter) 64px; }
#main:focus { outline: none; }

/* The document is the primary task. The criteria remain beside it for reference. */
.hero, .section-head { margin: 0 0 clamp(23px, 2.7vw, 36px); }
.eyebrow {
  margin-bottom: 9px;
  color: var(--forest);
  font-size: 11px;
  font-weight: 710;
  letter-spacing: .1em;
}
.eyebrow:lang(th) { font-size: 12px; letter-spacing: .01em; }
.hero h1, .section-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(34px, 3.25vw, 53px);
  font-weight: 640;
  line-height: 1.12;
  letter-spacing: -.058em;
}
.hero h1:lang(th), .section-title:lang(th) { font-size: clamp(32px, 3.06vw, 49px); line-height: 1.36; letter-spacing: -.032em; }
.hero p:last-child:not(.eyebrow), .section-head > p:not(.eyebrow) {
  max-width: 85ch;
  text-wrap: pretty;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.72;
}
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(245px, 1fr);
  align-items: start;
  gap: 22px;
}
.grid > *, .stack > *, #panel, .card, .offer-grid > * { min-width: 0; }
.grid > .scan-input-card { grid-column: 1; grid-row: 1; }
.grid > .stack { grid-column: 2; grid-row: 1 / span 2; }
.grid > #results { grid-column: 1; grid-row: 2; }
.stack { display: grid; align-content: start; gap: 15px; }
.card, .gate, .scanner-offer, #panel > .scanner-form {
  padding: clamp(22px, 2.3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
h2, #panel h3 { font-size: 21px; line-height: 1.35; font-weight: 650; letter-spacing: -.035em; }
h2:lang(th), #panel h3:lang(th) { line-height: 1.52; letter-spacing: -.02em; }
h3, h4 { font-size: 16px; line-height: 1.5; font-weight: 660; }
.sub, .small, .hint, .note { color: var(--muted); }
.sub { margin-top: 5px; font-size: 14px; }
.small, .hint, .note { font-size: 13px; }
.source-tabs {
  display: flex;
  align-items: stretch;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  margin: 19px 0 16px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--rail);
}
.source-tabs [role="tab"] {
  flex: 1 1 auto;
  gap: 7px;
  min-height: 36px;
  padding: 4px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}
.source-tabs [role="tab"]:hover { color: var(--ink); }
.source-tabs [aria-selected="true"] { border-color: var(--line); color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px #152a1810; }
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 176px;
  padding: 18px;
  text-align: center;
  border: 1.5px dashed var(--strong-line);
  border-radius: 10px;
  background: #f6f8f3;
  cursor: pointer;
}
.drop:hover, .drop.drag { background: var(--wash); border-color: var(--forest); }
.drop:focus-within { outline: 3px solid #3976a5; outline-offset: 3px; }
.drop .upload-mark, .drop .dot-icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 3px;
  color: var(--forest);
  background: var(--surface);
  border: 1px solid #cbd9ca;
  border-radius: 11px;
  box-shadow: 0 2px 2px #17271b08;
}
.upload-mark svg { width: 21px; height: 21px; }
.drop strong { font-weight: 640; font-size: 15px; }
.file-types { color: var(--muted); font-weight: 460; font-size: 12px; }
.drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.pdf-input { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.pdf-input input[type="number"] { width: 74px; min-height: 38px; padding: 5px 8px; }
#file-pane > p, #text-pane > p { margin-top: 8px; }
#text-pane > label { margin-bottom: 6px; }
#file-preview { margin-top: 12px; font-size: 14px; }
#file-excerpt {
  max-height: 16rem;
  overflow: auto;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--rail);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: inherit;
}
#source-name:not(:empty) { margin-top: 12px; font-weight: 600; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  max-width: 100%;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 14px;
  font-weight: 610;
  line-height: 1.45;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .button:hover { border-color: var(--strong-line); }
.primary, button[type="submit"], .button.primary { color: #fff; border-color: var(--forest); background: var(--forest); }
.primary:hover, button[type="submit"]:hover, .button.primary:hover { border-color: var(--deep); background: var(--deep); }
button:disabled { cursor: default; opacity: .6; }
#reset { color: var(--muted); border-color: transparent; background: transparent; }
#reset:hover { color: var(--ink); background: var(--rail); }

.scope-card, .card.tint {
  background: var(--deep);
  border-color: var(--deep);
  color: white;
}
.scope-card { position: relative; overflow: hidden; }
.scope-card::before {
  content: "";
  position: absolute;
  width: 17px;
  height: 3px;
  inset: 0 80px auto auto;
  background: #bfdb9b;
  box-shadow: 17px 0 #b2cec0, 34px 0 #acb9d1, 51px 0 #c8aabc, 68px 0 #dbb79a;
}
.scope-card h2, .scope-card h3 { color: #fff; }
.scope-card .eyebrow, .card.tint .eyebrow { color: #c8d9cd; }
.scope-stat { display: flex; align-items: baseline; gap: 8px; margin: 3px 0 8px; }
.scope-number {
  display: inline-block;
  font-size: clamp(42px, 4vw, 66px);
  font-weight: 500;
  font-variant-numeric: lining-nums tabular-nums;
  line-height: 1.08;
  letter-spacing: -.07em;
  color: var(--lime);
}
.scope-card p:not(.eyebrow), .card.tint > p:not(.eyebrow) { margin: 7px 0 0; color: #d4e3d9; font-size: 14px; }
.scope-card .manifest, .card.tint .manifest { color: #e1eee5; }
.scope-card details, .card.tint details { margin-top: 17px; border-top: 1px solid #506c5d; }
.scope-card summary, .card.tint summary { padding-block: 12px 0; color: var(--lime); }
summary { cursor: pointer; font-weight: 610; }
#scope { padding-inline-start: 19px; margin: 13px 0 0; font-size: 14px; }
#scope li + li { margin-top: 7px; }
.meta-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; }
.manifest { font-size: 12px; font-family: ui-monospace, monospace; }
.privacy-card h2, .privacy-card h3 { display: flex; align-items: center; gap: 9px; font-size: 17px; }
.privacy-card p { margin: 8px 0; font-size: 13px; color: var(--muted); }
.privacy-card a, .scanner-offer a { display: inline-flex; align-items: center; min-height: 37px; gap: 7px; color: var(--forest); font-size: 13px; font-weight: 640; }
.results { scroll-margin-top: 20px; }
#content > .results { margin-top: 20px; }
.results-head { margin-bottom: 17px; }
.results > p, .results-head p { margin: 7px 0; color: var(--muted); }
.result { padding: 18px 0; border-top: 1px solid var(--line); }
.result strong { font-size: 16px; }
.result blockquote, #panel blockquote {
  margin: 11px 0 6px;
  padding: 12px 16px;
  border-left: 3px solid #7d9e81;
  border-radius: 0 6px 6px 0;
  background: #f2f6ef;
  color: #294534;
  white-space: pre-wrap;
}
.result small, #panel small { color: var(--muted); }
.results > div:not(.results-head) > button { margin: 6px 0; }
.results > button { margin-top: 12px; }
.notice:not(:empty), #panel [role="status"]:not(:empty) { margin: 12px 0; padding: 10px 12px; border-left: 3px solid #92a892; background: var(--wash); border-radius: 0 6px 6px 0; font-size: 14px; }
#notice:not(:empty) { border-left-color: #b78b50; color: #603e17; background: #faf3e7; }

/* Organization, services and reviewer tools. */
label { display: block; font-size: 14px; font-weight: 580; }
input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea {
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  border: 1px solid var(--strong-line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  padding: 9px 11px;
  line-height: 1.55;
}
textarea { display: block; width: 100%; min-height: 138px; resize: vertical; }
textarea::placeholder, input::placeholder { color: #66756a; opacity: 1; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; accent-color: var(--forest); }
input[type="file"] { max-width: 100%; font-size: 14px; }
input[type="file"]::file-selector-button { border: 1px solid var(--line); border-radius: 6px; background: var(--rail); color: var(--ink); padding: 8px; margin-right: 7px; }
#panel > .gate, #panel > .scanner-form { max-width: 640px; }
#panel p { margin: 8px 0; }
#panel > h3, #panel > section > h3 { margin-top: 22px; }
.gate .button { margin-top: 13px; }
#panel form { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
#panel form > label, #panel form > h2, #panel form > h3, #panel form > h4, #panel form > p, #panel form > div, #panel form > fieldset { flex-basis: 100%; }
#panel form > div:not(.actions) > * + * { margin-top: 12px; }
#panel label > input:not([type="checkbox"], [type="radio"]), #panel label > select, #panel label > textarea {
  display: block;
  width: 100%;
  margin: 5px 0 0;
}
#panel label > br { display: none; }
#panel label:has(input[type="checkbox"]) { display: flex; flex-direction: row-reverse; align-items: baseline; justify-content: flex-end; gap: 8px; }
#panel .account-signin .actions { width: 100%; margin: 2px 0 0; padding: 0; border: 0; }
#panel .assessment-responses { margin: 24px 0 0; }
#panel .response-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr);
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}
.response-row dt { font-weight: 580; }
.response-row dd { margin: 0; color: var(--muted); }
#panel .workflow-finding h3 { font-size: 18px; }
#panel .source-excerpt { font-family: inherit; line-height: 1.7; }
#panel [value="signup"] { background: var(--surface); color: var(--forest); border-color: var(--line); }
#panel [value="signup"]:hover { background: var(--wash); }
#panel > form + form, #panel > section + form { margin-top: 16px; }
#panel section.card > form { margin: 18px 0; }
#panel section.card article, #panel > section > form {
  margin: 16px 0;
  padding: 19px 0 0;
  border-top: 1px solid var(--line);
}
#panel article form { margin-top: 13px; }
#panel pre { max-width: 100%; overflow-wrap: anywhere; border-radius: 8px; background: var(--rail); padding: 15px; }
.purchase-process { background: var(--deep); color: white; border-radius: var(--radius); padding: clamp(17px, 2.5vw, 28px); margin-bottom: 18px; }
.purchase-process h2 { font-size: 20px; }
.purchase-process ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin: 14px 0 0; padding: 0; list-style: none; }
.purchase-process li { border-top: 1px solid #638071; padding-top: 9px; }
.purchase-process h3 { font-size: 15px; color: var(--lime); }
#panel .purchase-process p { margin: 4px 0 0; color: #dbe8df; font-size: 13px; }
.offer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.scanner-offer { display: flex; flex-direction: column; align-items: flex-start; }
#panel .scanner-offer :is(h2, h3) { margin: 0; font-size: 19px; }
#panel .offer-description { color: var(--muted); font-size: 14px; }
#panel .offer-price { margin-top: auto; padding-top: 12px; font-size: 15px; font-weight: 640; }
.scanner-offer details { width: 100%; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.scanner-offer > a { text-align: left; }
.scanner-offer > button[aria-expanded="true"] { background: var(--wash); border-color: var(--forest); }
.purchase-request { max-width: 690px; margin-top: 18px; }
.purchase-request h2 { scroll-margin-top: 78px; }
#panel .purchase-product { color: var(--muted); }
#panel .purchase-request > form { border-top: 0; margin: 13px 0 0; padding-top: 0; }
#panel .purchase-request .small { margin: 0; }
.purchase-request textarea[name="note"] { min-height: 86px; }
.purchase-draft { margin-top: 21px; padding-top: 9px; border-top: 1px solid var(--line); }
.purchase-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 10px 0; }
#panel .catalogue-account { margin-top: 16px; }

@media (max-width: 1170px) {
  .app { grid-template-columns: 204px minmax(0, 1fr); }
  .brand { padding-inline: 17px; }
  .grid { grid-template-columns: minmax(0, 1.5fr) minmax(215px, 1fr); gap: 15px; }
  .card, .gate, .scanner-offer, #panel > .scanner-form { padding: 21px; }
}
@media (max-width: 960px) {
  :root { --gutter: 24px; }
  .app { grid-template-columns: 191px minmax(0, 1fr); }
  .nav-item { padding-inline: 9px; gap: 8px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid > .scan-input-card, .grid > .stack, .grid > #results { grid-column: 1; grid-row: auto; }
  .grid > .scan-input-card { order: 0; }
  .grid > #results { order: 1; }
  .grid > .stack { order: 2; }
  .stack { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 720px) {
  :root { --gutter: 16px; }
  .app { display: block; }
  .main-wrap > header { min-height: 60px; padding-block: 7px; gap: 8px; position: sticky; top: 0; z-index: 8; }
  #menu { display: inline-flex; flex: none; width: 42px; min-height: 42px; padding: 0; }
  .mobile-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 710; letter-spacing: -.035em; }
  .mobile-brand .mark { display: none; }
  .main-wrap > header .crumb, .main-wrap > header .slash, .main-wrap > header #crumb { display: none; }
  .header-end { gap: 5px; }
  #identity { max-width: 96px; }
  .account-chip { min-height: 42px; }
  #sidebar {
    display: none;
    position: fixed;
    z-index: 9;
    inset: 60px auto 0 0;
    width: min(290px, 88vw);
    height: calc(100dvh - 60px);
    box-shadow: 10px 10px 30px #102c1824;
  }
  #sidebar.open { display: flex; }
  body:has(#sidebar.open) { overflow: hidden; }
  #sidebar .brand { display: none; }
  #sidebar nav { padding-top: 0; }
  #menu-scrim:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 7;
    inset: 60px 0 0;
    width: 100%;
    height: calc(100dvh - 60px);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #142b2057;
  }
  #main { padding-top: 25px; padding-bottom: 38px; }
  .hero, .section-head { margin-bottom: 20px; }
  .hero p:last-child:not(.eyebrow) { font-size: 14px; }
  .results { scroll-margin-top: 73px; }
}
@media (max-width: 580px) {
  .stack, .offer-grid, .purchase-process ol { grid-template-columns: minmax(0, 1fr); }
  .purchase-process ol { gap: 9px; }
  .card, .gate, .scanner-offer, #panel > .scanner-form { padding: 18px; }
  .drop { min-height: 146px; }
  .source-tabs { width: 100%; margin: 14px 0; }
  .source-tabs [role="tab"] { padding-inline: 7px; }
  .actions { margin-top: 16px; padding-top: 14px; }
  .grid, .stack { gap: 12px; }
  #panel input, #panel select, #panel textarea, #excerpt, #pdf-page { font-size: 16px; }
}
@media (max-width: 360px) {
  :root { --gutter: 12px; }
  #identity { max-width: 70px; }
  .mobile-brand { font-size: 14px; }
  .header-end { gap: 2px; }
}
@media print {
  #sidebar, .main-wrap > header, #menu, #menu-scrim, .skip, .actions, button, .drop, .source-tabs { display: none !important; }
  :root, body, .app, #main { color: #111; background: #fff; }
  .app, .grid, .stack { display: block; }
  #main { max-width: none; padding: 0; }
  .result, #panel article { break-inside: avoid; }
  .scope-card, .card.tint { color: #111; border-color: #888; background: #fff; }
  .scope-card *, .card.tint * { color: inherit !important; }
}
