@font-face { font-family: 'Kanit'; font-weight: 500; font-style: normal; font-display: swap; src: url('fonts/Kanit-Medium.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-weight: 600; font-style: normal; font-display: swap; src: url('fonts/Kanit-SemiBold.ttf') format('truetype'); }
@font-face { font-family: 'Kanit'; font-weight: 900; font-style: normal; font-display: swap; src: url('fonts/Kanit-Black.ttf') format('truetype'); }

:root {
  --blue: #0B6BF0;
  --navy: #081C48;
  --yellow: #FFD60A;
  --review: #FFF4CC;
  --line: #d7deec;
  --bg: #f3f6fc;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--navy);
  font-family: 'Kanit', 'Leelawadee UI', Tahoma, sans-serif; font-weight: 500; font-size: 16px; line-height: 1.55;
}
[hidden] { display: none !important; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

.top { background: var(--navy); color: #fff; }
.top-in { display: flex; justify-content: space-between; align-items: center; height: 52px; }
.brand { color: var(--yellow); font-weight: 900; font-size: 22px; text-decoration: none; }
.back { color: #fff; text-decoration: none; font-size: 14px; }
.back:hover { text-decoration: underline; }

.hero { padding: 28px 0 8px; }
h1 { margin: 0 0 6px; font-size: 30px; font-weight: 900; line-height: 1.25; }
h2 { margin: 0 0 12px; font-size: 20px; font-weight: 600; }
h3 { margin: 22px 0 8px; font-size: 17px; font-weight: 600; }
.hero p { margin: 4px 0; }
.privacy { display: inline-block; margin-top: 10px !important; padding: 6px 12px; background: #fff; border: 2px solid var(--blue); border-radius: 999px; font-weight: 600; color: var(--blue); }

.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 16px 0; }
.muted { color: #4b5b80; margin: 6px 0; }
.small-t { font-size: 14px; }

.drop { display: block; position: relative; border: 2px dashed var(--blue); border-radius: 12px; padding: 26px 14px; text-align: center; background: #f6f9ff; cursor: pointer; }
.drop.over { background: #e3eeff; }
.drop-t { display: block; font-weight: 600; font-size: 18px; color: var(--blue); }
.drop-s { display: block; font-size: 14px; color: #4b5b80; margin-top: 4px; }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.row.filters { align-items: flex-end; margin-top: 0; }
.grow { flex: 1 1 220px; }
.small-link { color: var(--blue); font-size: 14px; }

.btn { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 10px; border: 2px solid var(--blue); cursor: pointer; background: #fff; color: var(--blue); min-height: 44px; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #0958c6; }
.btn.ghost:hover { background: #eaf2ff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--yellow); outline-offset: 1px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 16px; margin-top: 10px; }
.grid label, .filters label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.grid .full { grid-column: 1 / -1; }
label.inline { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; font-size: 15px !important; }
label.chk { align-self: end; min-height: 44px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 6px 22px; }
legend { font-size: 14px; font-weight: 600; padding: 0 6px; }
input[type=number], input[type=time], input[type=search], select {
  font: inherit; font-weight: 500; padding: 8px 10px; min-height: 44px; border: 1px solid #9fb0d0; border-radius: 8px; background: #fff; color: var(--navy); width: 100%;
}
input[type=radio], input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }

.rules { margin-top: 14px; }
.rules summary { cursor: pointer; font-weight: 600; color: var(--blue); }
.rules ul { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }

.msgs { margin-top: 12px; }
.msg { padding: 10px 12px; border-radius: 10px; margin-top: 8px; border-left: 5px solid; font-size: 15px; }
.msg.err { background: #ffe9e9; border-color: #d63031; color: #7a0c0c; }
.msg.warn { background: var(--review); border-color: #e0a800; }
.msg.ok { background: #e6f6ec; border-color: #1e9e57; }
.msg ul { margin: 4px 0 0; padding-left: 20px; }

.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 10px; }
.tbl { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.tbl th { background: var(--blue); color: #fff; font-weight: 600; text-align: left; padding: 8px 10px; white-space: nowrap; position: sticky; top: 0; }
.tbl td { padding: 7px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.review td { background: var(--review); }
.tbl td.scans { color: #4b5b80; font-size: 13px; }
#tbl-daily { min-width: 760px; }
#preview th { background: var(--navy); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.chip { background: #eef4ff; border-radius: 10px; padding: 8px 14px; }
.chip b { display: block; font-size: 22px; line-height: 1.2; font-weight: 900; color: var(--blue); }
.chip span { font-size: 13px; }
.chip.warn b { color: #b57b00; }

.legend { font-size: 14px; margin: 0 0 8px; }
.sw { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; background: var(--review); border: 1px solid #e0a800; border-radius: 3px; }

.foot { background: var(--navy); color: #cfd9f2; margin-top: 30px; padding: 18px 0 26px; font-size: 14px; }
.foot p { margin: 4px 0; }
.foot a { color: var(--yellow); }

@media (max-width: 560px) {
  h1 { font-size: 25px; }
  .card { padding: 14px; }
  .btn { width: 100%; }
}

.lbl { font-size: 14px; font-weight: 600; margin: 8px 0 4px; }
.sel-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sel-row { display: flex; gap: 8px; align-items: center; }
.sel-row select { flex: 1 1 auto; }
.sel-row .btn { width: auto; flex: 0 0 auto; }
.msg.info { background: #eaf2ff; border-color: var(--blue); }
