/* Thai text is set in Noto Sans Thai, the brand's Thai typeface (WAI Brand Guidelines, August 2026). Lato has no Thai glyphs. */
@font-face { font-family: "Noto Sans Thai"; font-weight: 300; font-display: swap; src: url("/fonts/thai/NotoSansThai-Light.ttf") format("truetype"); }
@font-face { font-family: "Noto Sans Thai"; font-weight: 400; font-display: swap; src: url("/fonts/thai/NotoSansThai-Regular.ttf") format("truetype"); }
@font-face { font-family: "Noto Sans Thai"; font-weight: 700; font-display: swap; src: url("/fonts/thai/NotoSansThai-Bold.ttf") format("truetype"); }
:lang(th), .th { font-family: "Noto Sans Thai", Lato, sans-serif; }
.th { color: var(--navy-70); font-weight: 400; }

/* App-50 Vendor Application: the few things this app needs that keystone-app.css does not already give.
   Loaded after the kit. Tokens come from the kit (var(--navy) and so on); no hex values of its own, and no inline
   styles anywhere in the app, because the Content-Security-Policy forbids them. */

.skip { position: absolute; left: -9999px; top: 8px; background: var(--navy); color: var(--grey); padding: 8px 14px; border-radius: var(--radius); z-index: 10; }
.skip:focus { left: 8px; }

/* The menu strip is full width in the kit, while the bar and the page sit in a centred 1180px column. Pad the strip so the
   first tab's text lines up with the content below it. */
.tabs { padding-left: max(4px, calc((100% - 1180px) / 2 + 4px)); padding-right: 14px; }
@media (max-width: 720px) { .tabs { padding-left: 0; padding-right: 0; } }
.tabs__badge { display: inline-block; min-width: 20px; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 0.75rem; font-weight: 700; line-height: 20px; text-align: center; }

/* Lined icons (Lucide, 1.5px stroke): sit on the text baseline and never shrink. */
svg.icon { flex: none; vertical-align: -0.2em; }
.icon-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.icon-title svg { color: var(--gold-deep); }
.btn svg.icon { margin-right: 6px; vertical-align: -0.25em; }
.appbar__side form button, .appbar__side a { display: inline-flex; align-items: center; gap: 6px; }

code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: var(--grey-soft); padding: 1px 5px; border-radius: 4px; word-break: break-word; }
.muted { color: var(--navy-50); }
.nowrap { white-space: nowrap; }
td.num, th.num { text-align: right; }
.subhead { font-size: 0.9rem; font-weight: 700; margin: 20px 0 8px; color: var(--navy-70); }
.section-title { font-size: 1.15rem; font-weight: 700; margin: 30px 0 12px; }
.count { font-size: 0.8rem; font-weight: 700; color: var(--navy-70); background: var(--grey-soft); border: 1px solid var(--grey-warm); border-radius: 999px; padding: 1px 9px; margin-left: 6px; vertical-align: 2px; }
.pill { white-space: nowrap; }
.inline { display: inline-block; margin: 0 6px 6px 0; }
.stack { display: grid; gap: 14px; }
.row--gap { gap: 10px; align-items: center; margin-top: 16px; }
.btn--small { padding: 6px 12px; font-size: 0.85rem; width: auto; }
.btn.btn--small + .btn { margin-left: 0; }
blockquote { margin: 0 0 14px; padding: 4px 0 4px 16px; border-left: 2px solid var(--gold); color: var(--navy-70); max-width: 72ch; }
.prose p, .prose li { max-width: 72ch; }
.prose h2 { margin-top: 28px; }

.page-head--row { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page-head + .rule { margin-top: 0; }
.page-head .inline-form { margin: 0; }

.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 18px; }
.stat-sub { display: block; font-size: 0.8rem; color: var(--navy-70); margin-top: 2px; }
.split { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); margin: 16px 0; align-items: start; }
.split--wide { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.split > .card, .card + .card { margin-top: 0; }
section.card, form.card { margin-bottom: 16px; }
.card h3 { margin: 0 0 10px; font-size: 1.05rem; }
.card--action { border-left: 3px solid var(--gold); }
.card--flag { border-left: 3px solid var(--warn); }

/* ---- notices */
.note--ok { border-left-color: var(--ok); background: #EAF3E4; }
.note { margin: 0 0 14px; }

/* ---- banners (the supplier's status) */
.banner { display: flex; gap: 16px; align-items: flex-start; background: var(--white); border: 1px solid var(--navy-10); border-left: 4px solid var(--navy-50); border-radius: var(--radius-card); padding: 18px 20px; margin: 0 0 18px; }
.banner h2 { margin: 0 0 4px; font-size: 1.2rem; }
.banner p { margin: 0; max-width: 70ch; }
.banner svg { flex: none; margin-top: 2px; }
.banner--ok { border-left-color: var(--ok); } .banner--ok svg { color: var(--ok); }
.banner--warn { border-left-color: var(--gold); } .banner--warn svg { color: var(--gold-deep); }
.banner--critical { border-left-color: var(--critical); } .banner--critical svg { color: var(--critical); }
.banner--off svg { color: var(--navy-50); }

/* ---- progress steps */
.steps { list-style: none; display: flex; gap: 0; margin: 0 0 22px; padding: 0; }
.steps__item { flex: 1; display: flex; align-items: center; gap: 10px; position: relative; font-size: 0.9rem; color: var(--navy-50); }
.steps__item + .steps__item::before { content: ""; flex: 1; height: 1px; background: var(--navy-20); margin-right: 10px; }
.steps__dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--navy-20); background: var(--white); font-weight: 700; font-size: 0.8rem; flex: none; }
.steps__item--done { color: var(--navy); } .steps__item--done .steps__dot { background: var(--navy); border-color: var(--navy); color: var(--grey); }
.steps__item--now { color: var(--navy); font-weight: 700; } .steps__item--now .steps__dot { border-color: var(--gold); background: var(--gold-soft); color: var(--navy); }
.steps__label { white-space: nowrap; }
@media (max-width: 640px) { .steps__label { display: none; } .steps__item--now .steps__label { display: inline; } }

.checks { list-style: none; margin: 0; padding: 0; }
.check-row { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--navy-10); }
.check-row > span:not(.pill) { flex: 1; }
.check-row svg { color: var(--gold-deep); } .check-row svg[aria-hidden] { flex: none; }

.sectionnav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 20px; }
.sectionnav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--navy-10); border-radius: 999px; background: var(--white); color: var(--navy-70); text-decoration: none; font-size: 0.9rem; }
.sectionnav a:hover { background: var(--grey-soft); }
.sectionnav a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--grey); }
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 22px; border-bottom: 1px solid var(--navy-10); }
.subnav a { padding: 8px 14px; color: var(--navy-70); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--navy); }
.subnav a[aria-current="page"] { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }

/* ---- forms */
.form { max-width: 760px; }
.form--narrow { max-width: 560px; }
form.card.form { padding: 22px; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--critical); }
.field select, .field input[type="email"], .field input[type="tel"], .field input[type="url"], .field input[type="search"] { width: 100%; font: inherit; padding: 10px 13px; color: var(--navy); background: var(--white); border: 1px solid var(--navy-20); border-radius: var(--radius); }
.field select { max-width: 100%; }
.field textarea { width: 100%; font: inherit; }
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--gold-deep); box-shadow: 0 0 0 3px var(--gold-soft); }
.req { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-70); background: var(--grey-soft); border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 1px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); flex: none; }
.check--block { display: flex; align-items: flex-start; padding: 6px 0; }
.check--block input { margin-top: 3px; }
fieldset.choice { border: 0; padding: 0; margin: 0 0 4px; }
fieldset.choice legend { font-weight: 700; font-size: 0.95rem; padding: 0; margin-bottom: 6px; }
fieldset.choice .check { margin-right: 22px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 8px; }
.inline-form select, .inline-form input { width: auto; min-width: 180px; max-width: 100%; font: inherit; padding: 7px 10px; border: 1px solid var(--navy-20); border-radius: var(--radius); background: var(--white); color: var(--navy); }
.tools { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: flex-end; margin: 6px 0 12px; }
.tools .field { margin: 0; }
.tools__search { flex: 1 1 280px; }
.chips--nav { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip--btn { cursor: pointer; font: inherit; }
.chip--btn:hover { background: var(--grey-soft); }
.chip--btn[aria-pressed="true"] { background: var(--navy); color: var(--grey); border-color: var(--navy); }
.chip--btn[aria-pressed="true"] .count { background: var(--navy-90); color: var(--grey); border-color: var(--navy-90); }

/* ---- key / value lists */
.kv { margin: 0; }
.kv__row { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--navy-10); }
.kv__row:last-child { border-bottom: 0; }
.kv dt { color: var(--navy-70); font-size: 0.9rem; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv--roles .kv__row { grid-template-columns: 110px 1fr; }
@media (max-width: 560px) { .kv__row, .kv--roles .kv__row { grid-template-columns: 1fr; gap: 2px; } }

/* ---- tables */
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--navy-10); vertical-align: top; }
.table thead th { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--navy-70); background: var(--grey-soft); white-space: nowrap; position: sticky; top: 0; }
.table tbody tr:hover { background: var(--paper); }
.table-wrap { overflow-x: auto; border: 1px solid var(--navy-10); border-radius: var(--radius-card); background: var(--white); margin-bottom: 14px; }
.table--grid th, .table--grid td { text-align: center; }
.table--grid th:first-child, .table--grid td:first-child { text-align: left; }
.table--audit td { font-size: 0.86rem; }
.sorter { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.sorter:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }
.sorter__arrow::after { content: "\2195"; opacity: 0.4; }
th[aria-sort="ascending"] .sorter__arrow::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] .sorter__arrow::after { content: "\2193"; opacity: 1; }
.diff__bank td { background: #FBEDED; }
.diff td { overflow-wrap: anywhere; }

/* ---- decisions */
.decide { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 14px; }
.decide .inline { margin: 0; }
.decide__more { flex: 0 0 auto; }
.decide__more[open] { flex: 1 1 100%; order: 5; }
.decide__more > summary { list-style: none; cursor: pointer; display: inline-block; }
.decide__more > summary::-webkit-details-marker { display: none; }
.decide__more[open] { padding: 12px 0 0; }
.decide__more .form { margin-top: 10px; }
.flaglist { list-style: none; margin: 0; padding: 0; }
.flaglist li { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--navy-10); }

/* ---- documents and uploads */
.files { list-style: none; margin: 10px 0 0; padding: 0; }
.files li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--navy-10); flex-wrap: wrap; }
.files li > span:not(.pill) { flex: 1; min-width: 160px; overflow-wrap: anywhere; }
.files li svg { color: var(--gold-deep); }
.doc__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.doc__head h3 { margin: 0; }
.upload { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.upload input[type="file"] { flex: 1 1 240px; font: inherit; max-width: 100%; }

.empty { text-align: center; padding: 34px 12px; color: var(--navy-70); }
.empty svg { color: var(--navy-20); }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--navy-20); }
.timeline li { position: relative; padding: 0 0 16px 22px; }
.timeline li::before { content: ""; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; background: var(--gold); }
.timeline__date { display: block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--navy-70); }
.timeline p { margin: 2px 0 0; max-width: 80ch; }

/* ---- charts */
.bars { margin: 10px 0 6px; }
.bar { display: grid; grid-template-columns: minmax(120px, 210px) 1fr 56px; gap: 12px; align-items: center; padding: 5px 0; }
.bar__label { font-size: 0.9rem; overflow-wrap: anywhere; }
.bar__svg { width: 100%; height: 14px; display: block; }
.bar__track { fill: var(--navy-10); }
.bar__fill--navy { fill: var(--navy); }
.bar__fill--gold { fill: var(--gold); }
.bar__fill--grey { fill: var(--grey-warm); }
.bar__value { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; font-size: 0.9rem; }
@media (max-width: 560px) { .bar { grid-template-columns: 1fr 52px; } .bar__label { grid-column: 1 / -1; } }
.cols { width: 100%; height: 150px; display: block; }
.cols__axis { stroke: var(--navy-20); stroke-width: 0.3; }
.cols__labels { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--navy-70); }
.key { display: inline-block; width: 10px; height: 10px; margin: 0 4px 0 12px; vertical-align: -1px; }
.key--navy { background: var(--navy); } .key--gold { background: var(--gold); }

/* ---- a message on its own screen */
.message { max-width: 460px; text-align: left; }
.message__crest { width: 200px; height: auto; display: block; margin-bottom: 16px; }
.message h1 { margin-bottom: 8px; }
.message .btn { margin-top: 6px; }

.page-foot { max-width: 1180px; margin: 0 auto; padding: 0 20px 36px; color: var(--navy-70); font-size: 0.85rem; }
.page-foot p { margin: 0; border-top: 1px solid var(--navy-10); padding-top: 14px; }

@media print {
  .appbar, .tabs, .page-foot, .tools, .skip, .btn, .subnav { display: none !important; }
  body { background: #fff; }
}

/* ---- text size: A- / A / A+ (textsize.js changes the root font size; the kit's rem sizes follow it) */
body { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.appbar__side .textsize { display: inline-flex; align-items: stretch; gap: 3px; }
.appbar__side .textsize button { display: inline-flex; align-items: baseline; justify-content: center; gap: 0; min-width: 40px; padding: 4px 8px; line-height: 1.2; font-weight: 700; color: var(--grey); }
.appbar__side .textsize button:nth-of-type(1) { font-size: 12px; }
.appbar__side .textsize button:nth-of-type(2) { font-size: 15px; }
.appbar__side .textsize button:nth-of-type(3) { font-size: 18px; }
.textsize__sign { font-size: 0.8em; }
.textsize__level { font-size: 10px; font-weight: 700; color: var(--gold); margin-left: 2px; align-self: flex-start; line-height: 1; min-width: 0; }
.appbar__side .textsize button[aria-pressed="true"] { border-color: var(--gold); background: var(--navy-90); color: var(--white); }
.appbar__side .textsize button:disabled { opacity: 0.35; cursor: default; }

/* On a phone the bar's right-hand group (name, text size, launcher, sign out) is wider than the screen: let it wrap. */
@media (max-width: 640px) { .appbar__side { flex-wrap: wrap; row-gap: 8px; } .appbar__who { flex: 1 0 100%; } }
.table--grid th:first-child { min-width: 230px; }
.table--grid thead th { white-space: normal; }

/* ---- the form: Thai beside English, choice groups, terms, the signature pad */
body, input, select, textarea, button { font-family: Lato, "Noto Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; }
.field > label .th, fieldset.choice legend .th, .check .th, .doc__head h3 .th { font-size: 0.88em; margin-left: 4px; }
.th-title { margin: -6px 0 14px; font-size: 1rem; }
fieldset.choice--wrap { display: flex; flex-wrap: wrap; gap: 4px 20px; }
fieldset.choice--wrap legend { flex: 1 1 100%; }
blockquote.terms { margin: 0 0 10px; padding: 12px 16px; background: var(--grey-soft); border-left: 2px solid var(--gold); color: var(--navy); max-width: 72ch; font-size: 0.95rem; }
.field-label { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-70); margin: 0 0 6px; }
.sigpad canvas { display: block; width: 100%; max-width: 480px; aspect-ratio: 3 / 1; background: var(--white); border: 1px solid var(--navy-20); border-radius: var(--radius); touch-action: none; cursor: crosshair; }
.sigpad__tools { margin: 6px 0 0; }
img.signature { display: block; max-width: 240px; height: auto; background: var(--white); border: 1px solid var(--navy-10); border-radius: var(--radius); padding: 4px; }
/* Thai must not be letter-spaced or upper-cased the way the kit styles English labels: tracking breaks Thai letter clusters. */
.th, :lang(th) { letter-spacing: normal; text-transform: none; }
.field > label .th, .field-label .th { font-size: 0.82rem; font-weight: 400; }
/* A tick-box sentence is body text, not a field label: the kit's tracked capitals are for short labels only. */
.field > label.check, .field > label.check span, label.check { text-transform: none; letter-spacing: normal; font-size: 0.95rem; font-weight: 400; color: var(--navy); }
.field > label.check .req, label.check .req { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.68rem; font-weight: 700; color: var(--navy-70); }
fieldset.choice .check span { text-transform: none; letter-spacing: normal; }

/* ---- the supplier table: every field, wide, landscape-friendly */
.page-shell--full { max-width: none; padding-left: 20px; padding-right: 20px; }
.orient-hint { display: none; }
@media (orientation: portrait) and (max-width: 700px) { .orient-hint { display: block; } }
.chips__label { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--navy-70); align-self: center; margin-right: 4px; }
.table-wrap--grid { max-height: calc(100vh - 260px); min-height: 320px; overflow: auto; }
.table--grid-wide { width: max-content; min-width: 100%; }
.table--grid-wide th, .table--grid-wide td { min-width: 120px; max-width: 340px; vertical-align: top; overflow-wrap: anywhere; }
.table--grid-wide td.col--wide, .table--grid-wide th.col--wide { min-width: 280px; }
.table--grid-wide thead th { top: 0; z-index: 3; }
/* The reference and the supplier name stay in view while the rest scrolls sideways. */
.table--grid-wide th:nth-child(1), .table--grid-wide td:nth-child(1) { position: sticky; left: 0; min-width: 88px; max-width: 88px; background: var(--white); z-index: 2; }
.table--grid-wide th:nth-child(2), .table--grid-wide td:nth-child(2) { position: sticky; left: 88px; min-width: 230px; background: var(--white); z-index: 2; box-shadow: 1px 0 0 var(--navy-10); }
.table--grid-wide thead th:nth-child(1), .table--grid-wide thead th:nth-child(2) { background: var(--grey-soft); z-index: 4; }
.table--grid-wide tbody tr:hover td:nth-child(1), .table--grid-wide tbody tr:hover td:nth-child(2) { background: var(--paper); }
.table--grid-wide[data-hide~="contact"] .col-contact, .table--grid-wide[data-hide~="company"] .col-company, .table--grid-wide[data-hide~="bank"] .col-bank,
.table--grid-wide[data-hide~="dates"] .col-dates, .table--grid-wide[data-hide~="notes"] .col-notes { display: none; }
.table-wrap--grid:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 2px; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  .page-shell--full { padding: 0; }
  .table-wrap--grid { max-height: none; overflow: visible; border: 0; }
  .table--grid-wide { width: 100%; font-size: 8pt; }
  .table--grid-wide th, .table--grid-wide td { min-width: 0; max-width: none; padding: 3px 5px; }
  .table--grid-wide th:nth-child(1), .table--grid-wide td:nth-child(1), .table--grid-wide th:nth-child(2), .table--grid-wide td:nth-child(2) { position: static; }
  .chips, .tools, [data-result-count], .page-head__actions { display: none !important; }
}
