@charset "UTF-8";

@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  src: url("../fonts/ibm-plex-sans-thai/IBMPlexSansThai-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

/* A single, reading-first type system shared by public, auth and admin pages. */
:root {
  font-family: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", "Segoe UI", Tahoma, Arial, sans-serif;
  font-synthesis: none;
  --reg-font-body: "IBM Plex Sans Thai", "Noto Sans Thai", "Leelawadee UI", "Segoe UI", Tahoma, Arial, sans-serif;
  --reg-font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

html {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--reg-font-body);
  font-size: 16px;
  line-height: 1.62;
  letter-spacing: .002em;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1,
h2,
h3 {
  font-family: inherit;
  font-weight: 700;
  letter-spacing: -.018em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.65rem, 1.45rem + .7vw, 2.1rem); line-height: 1.28; }
h2 { font-size: clamp(1.2rem, 1.12rem + .3vw, 1.4rem); line-height: 1.38; }
h3 { font-size: 1.06rem; line-height: 1.45; }
p, li, dd, td { line-height: 1.65; }
small, .muted, .footnote, .environment { line-height: 1.55; }

.site-identity strong { font-size: 1.08rem; font-weight: 700; letter-spacing: -.01em; }
.site-identity small { font-size: .72rem; line-height: 1.35; letter-spacing: .04em; }
.docs-link, .service-name { font-size: .9rem; font-weight: 650; }

.auth-card { width: min(100%, 460px); padding: 32px; }
.eyebrow { font-size: .76rem; font-weight: 700; letter-spacing: .1em; }
.auth-heading h1 { font-size: 1.85rem; line-height: 1.25; margin: .5rem 0 .2rem; }
.auth-heading p { max-width: 360px; font-size: 1rem; line-height: 1.65; }
form { gap: 10px; }
label { font-size: .94rem; font-weight: 650; line-height: 1.45; }
input, select, textarea { font-size: 1rem; line-height: 1.45; }
input { min-height: 46px; }
.primary, .button, button { font-size: .94rem; font-weight: 650; }
.login-submit { min-height: 48px; font-size: 1rem; }
.trust-note p { font-size: .86rem; line-height: 1.45; }
.trust-note small { font-size: .78rem; line-height: 1.5; }
.site-footer { font-size: .82rem; line-height: 1.5; }
.metrics span, .ui-kpi span { font-size: .84rem; line-height: 1.45; }
.ui-panel__head { font-size: 1rem; font-weight: 700; }
.ui-badge { font-size: .8rem; font-weight: 700; }
code, .numeric-username { font-family: var(--reg-font-mono); }

/* Shared dialogs and controls. */
.reg-toast, .reg-confirm-box { font-family: var(--reg-font-body); }
.reg-toast { font-size: .94rem; line-height: 1.55; }
.reg-confirm-title { font-size: 1.1rem; line-height: 1.4; }
.reg-confirm-msg { font-size: .95rem; line-height: 1.65; }
.reg-confirm-btn { font-size: .94rem; font-weight: 650; }
.reg-form { gap: 14px; }
.reg-dialog-field { gap: 7px; }
.reg-dialog-field > label { font-size: .94rem; font-weight: 650; line-height: 1.45; color: var(--reg-text-secondary); }
.reg-dialog-field input,
.reg-dialog-field select,
.reg-dialog-field textarea { min-height: 46px; padding: 9px 12px; font-size: 1rem; line-height: 1.45; }
.reg-field-hint { font-size: .82rem; line-height: 1.55; }
.reg-btn, .reg-btn-secondary { min-height: 42px; font-size: .94rem; font-weight: 650; }
.reg-flash { font-size: .94rem; line-height: 1.6; }
.session-countdown__label { font-size: .76rem; }
.session-countdown strong { font-size: .86rem; }
.session-countdown small { font-size: .66rem; }

/* Dense administration screens remain compact but no longer use tiny labels. */
.field-hint, .optional { font-size: .84rem; line-height: 1.55; }
.policy-pill, .badge { font-size: .8rem; font-weight: 700; }
.admin-user-card__handle, .admin-user-card__login { font-size: .86rem; line-height: 1.55; }
.admin-module-tag__name { font-size: .88rem; font-weight: 700; }
.admin-module-tag__count { font-size: .78rem; }
.admin-quick-nav__item strong { font-size: 1rem; }
.admin-quick-nav__item span { font-size: .86rem; line-height: 1.55; }
th { font-size: .86rem; font-weight: 700; line-height: 1.45; }
td { font-size: .94rem; line-height: 1.58; }
td small { font-size: .82rem; line-height: 1.55; }
.action-btn { font-size: .82rem !important; font-weight: 650 !important; }
.badge--event { font-size: .75rem; }

/* Reading-focused scale for the landing page and documentation. */
.gateway-brand { font-family: var(--reg-font-body); font-weight: 750; line-height: 1.15; }
.gateway-hero h1 { font-weight: 650; line-height: 1.35; }
.gateway-lead { font-size: clamp(1.02rem, .98rem + .2vw, 1.12rem); line-height: 1.75; }
.gateway-section-label { font-size: .78rem; letter-spacing: .08em; }
.gateway-overview h2, .gateway-steps h2 { line-height: 1.38; }
.gateway-overview header p { font-size: 1rem; line-height: 1.75; }
.gateway-outcomes strong { font-size: 1.06rem; }
.gateway-outcomes span { font-size: .95rem; line-height: 1.7; }
.gateway-steps strong { font-size: 1rem; }
.gateway-steps p { font-size: .92rem; line-height: 1.65; }
.gateway-cta > div > span { font-family: var(--reg-font-mono); font-size: .7rem; }
.gateway-cta h2 { font-size: 1.3rem; line-height: 1.45; }
.docs-hero h1 { font-size: clamp(1.7rem, 1.5rem + .7vw, 2.1rem); }
.docs-hero p, .docs-content { font-size: 1rem; }
.docs-toc a { font-size: .88rem; font-weight: 650; }
.docs-content h2 { font-size: 1.35rem; }
.docs-content h3 { font-size: 1.08rem; }
.steps p, .endpoint-list p { font-size: .92rem; line-height: 1.65; }
.docs-table th { font-size: .88rem; }
.docs-table td { font-size: .94rem; line-height: 1.65; }
.method { font-size: .74rem; }
pre { font-size: .86rem; line-height: 1.65; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .docs-link { font-size: .9rem; }
  .site-identity strong { font-size: .98rem; }
  .auth-card { padding: 26px 20px; }
  .auth-heading h1 { font-size: 1.7rem; }
}

/* Identity source and connected-system tags. */
.user-source-legend { margin: 12px 0 4px; display: flex; flex-wrap: wrap; gap: 8px 18px; color: #64736b; font-size: .82rem; }
.user-source-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.source-dot { width: 8px; height: 8px; border-radius: 50%; }
.source-dot--identity { background: #08784b; }
.source-dot--client { background: #2563a6; }
.source-tags { min-width: 180px; max-width: 320px; display: flex; flex-wrap: wrap; gap: 6px; }
.source-tag { display: inline-flex; align-items: center; min-height: 27px; padding: 4px 9px; border: 1px solid; border-radius: 999px; font-size: .78rem; font-weight: 500; line-height: 1.25; }
.source-tag--identity { border-color: #aedcc2; background: #e8f7ef; color: #08633c; }
.source-tag--client { border-color: #bfd1e8; background: #eef5fd; color: #235b96; }
.source-tag--direct { border-color: #d8ddd9; background: #f5f7f6; color: #59675f; }
@media (max-width: 720px) {
  .user-source-legend { display: grid; }
  .source-tags { min-width: 150px; }
}

/* Searchable multi-select used by admin filters. */
.admin-system-filter { position: relative; z-index: 4; }
.filter-multiselect { position: relative; min-width: 280px; }
.filter-multiselect__trigger { width: 100%; min-height: 46px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--reg-border); border-radius: 10px; background: #fff; color: var(--reg-text); font-size: .92rem; font-weight: 400; text-align: left; white-space: normal; box-shadow: none; }
.filter-multiselect__trigger:hover { border-color: #8fa399; background: #fff; }
.filter-multiselect.has-selection .filter-multiselect__trigger { border-color: #8dc1a6; background: #f3faf6; color: #075f3c; }
.filter-multiselect__trigger > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-multiselect__panel { position: absolute; z-index: 20; top: calc(100% + 7px); left: 0; width: min(390px, calc(100vw - 32px)); padding: 10px; border: 1px solid #d5dfd9; border-radius: 14px; background: #fff; box-shadow: 0 18px 46px rgba(17, 48, 34, .18); }
.filter-multiselect__search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid #dce4df; border-radius: 10px; background: #f8faf9; }
.filter-multiselect__search:focus-within { border-color: #0a8a53; box-shadow: 0 0 0 3px rgba(10, 138, 83, .1); }
.filter-multiselect__search input { min-height: 40px; padding: 7px 0; border: 0; background: transparent; box-shadow: none; }
.filter-multiselect__search input:focus { box-shadow: none; }
.filter-multiselect__options { max-height: 248px; margin-top: 8px; overflow: auto; display: grid; gap: 3px; }
.filter-multiselect__option { margin: 0; padding: 9px 10px; display: flex; align-items: flex-start; gap: 9px; border-radius: 8px; color: #283b32; font-size: .88rem; font-weight: 400; cursor: pointer; }
.filter-multiselect__option[hidden], .filter-multiselect__empty[hidden], .filter-multiselect__panel[hidden] { display: none !important; }
.filter-multiselect__option:hover { background: #f0f7f3; }
.filter-multiselect__option:has(input:checked) { background: #e9f7ef; color: #075f3c; font-weight: 500; }
.filter-multiselect__option input { flex: 0 0 auto; width: 17px; min-height: 17px; margin: 2px 0 0; accent-color: #08784b; }
.filter-multiselect__empty { margin: 0; padding: 18px 10px; text-align: center; color: #75827b; font-size: .84rem; }
.filter-multiselect__footer { margin-top: 8px; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf1ee; }
.filter-multiselect__footer button { min-height: 34px; padding: 0 9px; border: 0; background: transparent; color: #596a61; font-size: .82rem; font-weight: 500; }
.filter-multiselect__footer button:last-child { color: #08784b; }
@media (max-width: 600px) {
  .admin-system-filter, .filter-multiselect { min-width: 100%; width: 100%; }
  .filter-multiselect__panel { position: fixed; top: 50%; left: 50%; width: calc(100vw - 28px); max-height: min(520px, calc(100vh - 40px)); transform: translate(-50%, -50%); }
  .filter-multiselect__options { max-height: min(340px, calc(100vh - 190px)); }
}

/* Institutional sign-in (A) + popup minimal (D). */
.shell:has(.auth-login) {
  position: relative;
  isolation: isolate;
  padding: clamp(24px, 4vh, 48px) 20px;
  background: var(--reg-bg, #eef2ef);
}
.auth-login {
  width: min(100%, 420px);
  padding: 28px 26px;
  display: grid;
  border: 1px solid var(--reg-panel-border, #d5ddd7);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(16, 40, 28, .08);
  background: #fff;
}
.auth-login__logo { display: block; width: auto; height: 64px; margin: 0 auto 10px; object-fit: contain; }
.auth-login .auth-heading { text-align: center; }
.auth-login__eyebrow { color: var(--reg-primary, #0a7a4b); font-size: .78rem; letter-spacing: .04em; font-weight: 700; }
.auth-login__title { margin: 6px 0 0; color: #102c21; font-size: 1.75rem; font-weight: 650; }
.auth-login__title--popup,
.auth-login__lead--popup,
.auth-login__trust--popup { display: none; }
.auth-login__lead { margin: .35rem auto 0; max-width: 28rem; color: #52635a; font-size: .94rem; line-height: 1.5; }
.auth-login .reg-form { margin-top: 22px; gap: 14px; }
.auth-login .reg-dialog-field { gap: 6px; }
.auth-login .reg-dialog-field > label { color: #1d3027; font-size: .9rem; font-weight: 600; text-align: left; }
.auth-login .reg-dialog-field input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--reg-border, #c9d2cb);
  border-radius: 8px;
  background: #fff;
  color: #102c21;
  box-shadow: none;
}
.auth-login .reg-dialog-field input::placeholder { color: #86928c; }
.auth-login .reg-dialog-field input:hover { border-color: #9fada4; }
.auth-login .reg-dialog-field input:focus { border-color: var(--reg-focus, #0a7a4b); box-shadow: 0 0 0 3px var(--reg-focus-ring, rgba(10, 122, 75, .18)); }
.auth-login .show-password { top: 7px; right: 6px; color: #16744b !important; font-size: .84rem; font-weight: 600; }
.auth-login .login-submit { width: 100%; min-height: 46px; margin-top: 4px; justify-content: center; border-radius: 8px; background: var(--reg-primary, #0a7a4b); border-color: var(--reg-primary, #0a7a4b); box-shadow: none; font-weight: 700; }
.auth-login .login-submit:hover { background: var(--reg-primary-hover, #08653e); border-color: var(--reg-primary-hover, #08653e); transform: none; box-shadow: none; }
.auth-login__trust--full { margin-top: 20px; padding-top: 16px; justify-content: flex-start; border-top: 1px solid var(--reg-divider, #e2e8e4); }
.auth-login__trust--full > span { width: 26px; height: 26px; flex: 0 0 26px; font-size: .78rem; border-radius: 6px; }
.auth-login__trust--full p { font-size: .8rem; }
.auth-login__trust--full strong { color: #2f443a; font-weight: 600; }
.auth-login__trust--full small { color: #66766d; font-size: .74rem; }
.auth-login .environment { margin: 12px 0 0; padding: 0; border: 0; background: transparent; color: #8a6a20; font-size: .7rem; text-align: left; }

html.login-mode-popup body.login-mode-popup,
html.login-mode-popup body {
  background: #f3f5f4;
}
html.login-mode-popup .site-header,
html.login-mode-popup .site-footer,
html.login-mode-popup .brand-rule { display: none !important; }
html.login-mode-popup .shell:has(.auth-login) {
  min-height: 100vh;
  padding: 32px 16px;
  background: #f3f5f4;
}
html.login-mode-popup .auth-login {
  width: min(100%, 360px);
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
html.login-mode-popup .auth-login__logo { height: 56px; margin-bottom: 14px; }
html.login-mode-popup .auth-login__eyebrow,
html.login-mode-popup .auth-login__title--full,
html.login-mode-popup .auth-login__lead--full,
html.login-mode-popup .auth-login__trust--full { display: none; }
html.login-mode-popup .auth-login__title--popup,
html.login-mode-popup .auth-login__lead--popup,
html.login-mode-popup .auth-login__trust--popup { display: block; }
html.login-mode-popup .auth-login__title--popup { font-size: 1.35rem; color: #083d29; }
html.login-mode-popup .auth-login__lead--popup { margin-top: 4px; color: var(--reg-brand, #064e31); font-weight: 700; font-size: .94rem; }
html.login-mode-popup .auth-login__trust--popup { margin: 14px 0 0; color: #66766d; font-size: .76rem; text-align: center; }
html.login-mode-popup .auth-login .reg-form { margin-top: 18px; }
html.login-mode-popup .auth-login .environment { text-align: center; }

@media (max-width: 600px) {
  .shell:has(.auth-login) { padding: 16px 12px; align-items: start; }
  .auth-login { padding: 22px 18px; border-radius: 10px; }
  .auth-login__title--full { font-size: 1.55rem; }
}

/* Signed-in landing. */
.shell:has(.home-card) {
  position: relative;
  isolation: isolate;
  padding: clamp(24px, 5vh, 56px) 20px;
  background: var(--reg-bg, #eef2ef);
}
.home-card {
  width: min(100%, 600px);
  padding: 28px;
  border: 1px solid var(--reg-panel-border, #d5ddd7);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(16, 40, 28, .08);
}
.home-card__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.home-brand { margin: 0; }
.home-brand .brand-logo { height: 48px; }
.home-brand strong { color: #123a2a; font-size: 1rem; font-weight: 650; }
.home-brand small { margin-top: 2px; color: #75827b; font-size: .76rem; letter-spacing: 0; }
.home-status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: #e9f7ef; color: #12643e; font-size: .76rem; font-weight: 600; }
.home-status i { width: 7px; height: 7px; border-radius: 50%; background: #18a561; box-shadow: 0 0 0 3px rgba(24, 165, 97, .12); }
.home-welcome { margin-top: 28px; }
.home-welcome > span { color: #07804d; font-size: .78rem; font-weight: 700; letter-spacing: .03em; }
.home-welcome h1 {
  margin: 6px 0 4px;
  padding: .12em 0 .06em;
  overflow: visible;
  color: #083d29;
  font-size: clamp(1.7rem, 1.5rem + .8vw, 2.2rem);
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}
.home-welcome p { margin: 0; color: #5d6e65; font-size: .94rem; }
.home-profile { margin: 22px 0 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.home-profile > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 12px 14px; border-bottom: 1px solid #e7ece9; }
.home-profile > div:first-child { border-top: 1px solid #e7ece9; }
.home-profile dt { color: #728078; font-size: .86rem; }
.home-profile dd { color: #142d22; font-size: .92rem; font-weight: 500; overflow-wrap: anywhere; }
.home-actions { margin-top: 22px; display: grid; gap: 10px; }
.home-actions .primary-link { width: 100%; min-height: 44px; justify-content: flex-start; padding-inline: 16px; border-radius: 8px; box-shadow: none; }
.home-actions .primary-link .home-action-arrow { margin-left: auto; }
.home-actions form { margin: 0; }
.home-actions form .reg-btn { width: 100%; min-height: 44px; border-radius: 8px !important; }

@media (max-width: 600px) {
  .shell:has(.home-card) { padding: 16px 12px; }
  .home-card { padding: 22px 18px; border-radius: 10px; }
  .home-card__head { align-items: flex-start; }
  .home-status { padding: 5px 8px; font-size: .72rem; }
  .home-welcome { margin-top: 22px; }
  .home-welcome h1 { font-size: 1.7rem; line-height: 1.4; }
  .home-profile > div { grid-template-columns: 96px minmax(0, 1fr); padding-inline: 0; }
}
