:root {
    color-scheme: light;
    --ink: #211f20;
    --muted: #595357;
    --red: #b50c22;
    --border: #e3dcdd;
    --paper: #fff;
    --surface: #f7f5f3;
    font-family: "Segoe UI", "Leelawadee UI", Tahoma, system-ui, sans-serif;
    line-height: 1.55;
    color: var(--ink);
    background: var(--surface);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.17; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.15rem); letter-spacing: -.03em; }
h3 { font-size: 1.2rem; }
a { color: var(--red); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid #8e1022; outline-offset: 3px; }
button, input, select { font: inherit; }
.thai { display: block; color: var(--muted); font-size: .88em; line-height: 1.65; letter-spacing: 0; }
.topbar { background: var(--paper); border-bottom: 1px solid var(--border); }
.topbar-inner, .public-shell, .footer-inner, .footer-base, .admin-shell, .admin-nav > div {
    max-width: 1250px;
    width: min(100% - 64px, 1250px);
    margin-inline: auto;
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 84px; }
.topbar-inner img { display: block; object-fit: contain; }
.header-caption { text-align: right; font-size: .9rem; font-weight: 650; }
.header-caption .thai { font-weight: 500; }
.public-shell {
    display: grid;
    grid-template-columns: minmax(300px, .68fr) minmax(0, 1.32fr);
    align-items: start;
    gap: 28px;
    margin-block: 40px 56px;
}
.hero {
    position: sticky;
    top: 20px;
    isolation: isolate;
    overflow: hidden;
    border-radius: 16px;
    background: #211f20;
    color: white;
    min-height: 475px;
    padding: clamp(27px, 3.2vw, 44px);
}
.hero::before { content: ""; display: block; width: 44px; height: 4px; margin-bottom: 1.25rem; background: #ee3049; border-radius: 100px; }
.hero h1 { font-size: clamp(2rem, 3.05vw, 2.55rem); margin: 0 0 .85rem; text-wrap: balance; }
.hero-kicker { text-transform: uppercase; font-size: .8rem; font-weight: 750; letter-spacing: .13em; color: #ff8292; margin-bottom: .8rem; }
.hero-th { display: block; font-size: 1.16rem; font-weight: 600; line-height: 1.65; }
.hero p:last-child { color: #e1dadd; margin: 1.4rem 0 0; }
.hero .thai { color: #cec3c8; }
.hero-mark { position: absolute; z-index: -1; right: -14px; bottom: -54px; font-size: 12rem; font-weight: 900; line-height: 1; letter-spacing: -.14em; color: #342729; user-select: none; }
.card { border: 1px solid var(--border); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 30px #39262608; min-width: 0; }
.registration, .success, .privacy, .login, .admin-card { padding: clamp(21px, 4vw, 44px); }
.registration h2 { margin-bottom: .45rem; }
.registration h2 .thai, .success h2 .thai, .privacy h1 .thai { color: var(--red); font-size: .58em; margin-top: .4rem; }
.form-note { color: var(--muted); font-size: .875rem; }
.required { color: var(--red); font-weight: 750; }
.form-section { border-top: 1px solid var(--border); padding-top: 1.35rem; margin-top: 1.5rem; }
.form-section h3 { margin-bottom: 1.2rem; }
.form-section h3 .thai { margin-top: .25rem; font-weight: 500; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.1rem; }
.field label, legend { display: block; font-size: .95rem; font-weight: 650; margin-bottom: .38rem; }
.field label .thai, legend .thai { font-weight: 500; }
.field :is(input, select) {
    width: 100%;
    min-height: 46px;
    padding: .58rem .75rem;
    border: 1px solid #cfc6c9;
    background-color: white;
    color: var(--ink);
    border-radius: 7px;
}
.field select { appearance: none; padding-right: 2rem; background-image: linear-gradient(45deg, transparent 50%, #645c61 50%), linear-gradient(135deg, #645c61 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; }
.field input::placeholder { color: #736970; }
fieldset { margin: 1.25rem 0 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }
fieldset .form-note { margin-bottom: .65rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; }
.choice { display: flex; gap: .65rem; align-items: start; cursor: pointer; font-size: .92rem; }
.choices .choice { border: 1px solid var(--border); border-radius: 8px; padding: .65rem .7rem; }
.choices .choice:has(input:checked) { border-color: #c57583; background: #fff5f6; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--red); flex: 0 0 auto; width: 1.15rem; height: 1.15rem; margin: .16rem 0 0; }
.consent { margin: 1.5rem 0 1.15rem; padding: .95rem; background: var(--surface); border-radius: 8px; }
.consent a { display: inline-block; margin: .45rem 0 0 1.8rem; font-size: .87rem; }
.submit, .ghost {
    display: inline-block; border: 1px solid transparent; border-radius: 7px;
    min-height: 44px; padding: .58rem 1.1rem; cursor: pointer;
    font-weight: 650; line-height: 1.25;
}
.submit { background: var(--red); color: white; }
.submit:hover { background: #920a1a; }
.submit .thai { color: #fff; }
.registration > .submit { width: 100%; padding-block: .72rem; }
.ghost { color: var(--ink); background: white; border-color: #cfc6c9; }
.ghost:hover { background: var(--surface); }
.trap { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.alert, .field-error { color: #901023; }
.alert { border: 1px solid #e4b5bd; background: #fff3f4; border-radius: 8px; padding: .7rem .85rem; margin-bottom: 1rem; }
.alert.neutral { border-color: #b8cfbc; background: #f4faf3; color: #285235; }
.field-error { display: block; margin-top: .3rem; font-size: .86rem; }
.field-error .thai, .alert .thai { color: inherit; }
.field [aria-invalid="true"] { border-color: #b50c22; }
.success { min-height: 475px; }
.success-mark { display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1rem; border-radius: 50%; color: #215838; background: #e6f4eb; font-size: 1.6rem; font-weight: 750; }
.success p .thai, .privacy p .thai { margin-top: .45rem; }
.reference { background: var(--surface); padding: .9rem 1.1rem; border-radius: 8px; font-size: .9rem; }
.reference strong { display: block; margin-top: .22rem; letter-spacing: .04em; overflow-wrap: anywhere; }
.privacy, .login { width: min(100% - 32px, 800px); margin: 40px auto 56px; }
.login { width: min(100% - 32px, 460px); }
.login .field { margin-bottom: 1rem; }
.site-footer { background: #211f20; color: #fff; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.5rem 3.2rem; padding-block: 1.7rem; }
.endorsement { display: flex; gap: .9rem; align-items: center; }
.endorsement img { object-fit: contain; flex: 0 0 auto; background: white; border-radius: 4px; }
.endorsement p { margin: 0; font-size: .9rem; }
.training-marks .academy-logo { padding: .3rem; }
.site-footer .thai, .footer-base { color: #e0d8dd; }
.footer-base { border-top: 1px solid #4c4248; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding-block: 1rem; font-size: .84rem; }
.footer-base a { color: inherit; }
.admin-nav { background: white; border-bottom: 1px solid var(--border); }
.admin-nav > div { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem 1.4rem; padding-block: .55rem; }
.admin-nav a { padding: .55rem 0; color: var(--ink); text-decoration: none; font-weight: 650; }
.admin-nav a[aria-current] { color: var(--red); border-bottom: 2px solid var(--red); }
.admin-nav form { margin-left: auto; }
.admin-shell { margin-block: 32px 52px; min-height: 50vh; }
.admin-card { margin-top: 1rem; }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .65rem; }
.stat { display: block; background: white; border: 1px solid var(--border); border-radius: 10px; padding: .8rem 1rem; text-decoration: none; color: var(--ink); font-size: .9rem; }
.stat strong { display: block; font-size: 1.65rem; color: var(--red); }
.toolbar, .filters, .recipient-row, .status-form { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; }
.toolbar { justify-content: space-between; margin-bottom: 1rem; }
.filters .field:first-child { width: min(46vw, 320px); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .93rem; }
td, th { border-bottom: 1px solid var(--border); padding: .72rem; vertical-align: top; }
th { background: var(--surface); }
td small { display: block; color: var(--muted); margin-top: .18rem; overflow-wrap: anywhere; }
.status { display: inline-block; white-space: nowrap; padding: .15rem .55rem; background: #f1edef; border-radius: 99px; font-size: .86rem; }
.status-approved { background: #e7f4eb; color: #205437; }
.status-declined { background: #fcecef; color: #8c1124; }
.pagination { display: flex; gap: 1rem; margin-top: 1rem; }
.recipient-row { padding-block: .8rem; border-top: 1px solid var(--border); }
.recipient-row .field { flex: 1 1 230px; }
.check { display: flex; gap: .45rem; align-items: center; min-height: 44px; }
.eyebrow { color: var(--red); letter-spacing: .05em; font-weight: 650; margin-bottom: .55rem; }
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem 1.15rem; margin-block: 1.4rem; }
.details div { padding: .7rem 0; border-top: 1px solid var(--border); }
.details dt { font-weight: 650; }
.details dd { margin: .18rem 0 0; overflow-wrap: anywhere; }
.history { padding-left: 1.2rem; overflow-wrap: anywhere; }
@media (max-width: 880px) {
    .public-shell { grid-template-columns: 1fr; gap: 17px; }
    .hero { position: relative; top: 0; min-height: auto; }
    .hero h1 { max-width: 650px; }
    .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .success { min-height: unset; }
}
@media (max-width: 550px) {
    .topbar-inner, .public-shell, .footer-inner, .footer-base, .admin-shell, .admin-nav > div { width: min(100% - 32px, 1250px); }
    .public-shell { margin-block: 20px 36px; }
    .topbar-inner { min-height: 66px; }
    .topbar-inner img { width: 122px; height: auto; }
    .header-caption { font-size: .76rem; }
    .fields, .choices, .details { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .filters .field:first-child { width: 100%; }
    .footer-inner { gap: 1rem; }
}
