:root {
  --navy: #082955; --blue: #014799; --sky: #338ce6; --pale: #e9f3ff; --bg: #f5f8fd;
  --ink: #172b4d; --muted: #65758d; --line: #dbe5f3; --card: #fff; --green: #16815d; --red: #c23a4f;
  --f-display: 'Anuphan', 'IBM Plex Sans Thai', system-ui, sans-serif;
  --f-read: 'IBM Plex Sans Thai', 'Anuphan', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--f-read); background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 16px; min-height: 100vh; padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--blue); }
.top { background: linear-gradient(112deg, #071f44 0%, #014799 60%, #0575bf 100%); color: #fff; padding: 16px 20px 18px; }
.brand { font-family: var(--f-display); font-weight: 700; font-size: 26px; letter-spacing: -1px; line-height: 1.1; }
.brand-sub { font-size: 12px; opacity: .8; }
main { max-width: 560px; margin: 0 auto; padding: 18px 16px; }
h1 { font-family: var(--f-display); font-size: 22px; color: var(--navy); margin: 4px 0 2px; line-height: 1.35; }
h2 { font-family: var(--f-display); font-size: 18px; color: var(--navy); margin: 22px 0 10px; }
.lead { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.center { display: grid; place-items: center; min-height: 50vh; text-align: center; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; box-shadow: 0 6px 20px rgba(27, 68, 115, .04); }
.card + .card { margin-top: 10px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 10px; text-align: center; cursor: pointer; min-height: 112px; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: transform .1s; }
.tile:active { transform: scale(.97); }
.tile .ico { font-size: 26px; line-height: 1.2; }
.tile b { display: block; font-size: 14px; color: #1d3c64; margin-top: 6px; }
.tile em { display: block; font-style: normal; font-size: 12px; color: var(--muted); }
.tile.on { border-color: var(--blue); background: var(--pale); }
.tile.soon { opacity: .55; cursor: default; }

.ws { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.ws .badge { flex: 0 0 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--pale); color: var(--blue); font-weight: 700; font-family: var(--f-display); font-size: 18px; }
.ws .t { font-weight: 600; color: var(--navy); line-height: 1.4; }
.ws .m { font-size: 12px; color: var(--muted); }
.ws .arrow { margin-left: auto; color: #8ca7c5; font-size: 22px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font-weight: 600; padding: 13px 18px; min-height: 48px; cursor: pointer; width: 100%; text-decoration: none; font-size: 16px; }
.btn:disabled { opacity: .5; }
.btn.ghost { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn.line { background: #06c755; }
.btn.small { width: auto; min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.stack > * + * { margin-top: 10px; }

.code-inputs { display: flex; gap: 10px; justify-content: center; margin: 22px 0 10px; }
.code-inputs input { width: 60px; height: 72px; text-align: center; font-size: 32px; font-weight: 700; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-family: var(--f-display); }
.code-inputs input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(1, 71, 153, .12); }
.err { color: var(--red); font-size: 14px; min-height: 22px; text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: #37516d; margin-bottom: 6px; }
.field input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.field input:focus { outline: none; border-color: var(--blue); }
.field .e { color: var(--red); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #3e5672; margin: 10px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--blue); }
.req { color: var(--red); }

.item h3 { margin: 0; font-size: 16px; color: var(--navy); line-height: 1.45; }
.item .meta { font-size: 12px; color: var(--muted); }
.item p { margin: 6px 0 0; font-size: 14px; color: #3e5672; white-space: pre-wrap; }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--pale); color: #23649d; font-weight: 600; }
.prompt { background: #f6f9fd; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; margin-top: 8px; max-height: 260px; overflow: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.success { text-align: center; padding: 20px 0; }
.success .big { font-size: 54px; }
.back { background: none; border: 0; color: var(--blue); padding: 0; font-size: 14px; cursor: pointer; margin-bottom: 6px; }
.hero-card { background: linear-gradient(115deg, #f4f9ff, #fff); border: 1px solid #dceafa; }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--pale); }
dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid #e3eaf4; padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.tabbar button { flex: 1; background: none; border: 0; padding: 8px 2px 10px; font-size: 12px; color: #67819a; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; min-height: 58px; }
.tabbar button span { font-size: 20px; line-height: 1.1; }
.tabbar button.on { color: var(--blue); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #172b4d; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); }
dialog { border: 0; border-radius: 16px; padding: 0; max-width: min(520px, calc(100% - 24px)); max-height: 85vh; }
dialog::backdrop { background: rgba(8, 41, 85, .45); }
.privacy { padding: 20px; font-size: 14px; }
.privacy h2 { margin-top: 0; }
.privacy h3 { font-size: 15px; margin: 14px 0 4px; color: var(--navy); }
.privacy ul { padding-left: 18px; margin: 4px 0; }

/* ---- learner app additions ---- */
.ico { display: inline-block; width: 26px; height: 26px; color: var(--blue); flex: 0 0 auto; }
.ico.sm { width: 18px; height: 18px; color: inherit; }
.ico.big { width: 64px; height: 64px; color: var(--green); }
.ico svg { display: block; }
.tile .ico { margin: 0 auto; }
.tabbar button .ico { width: 24px; height: 24px; color: inherit; }
.tabbar button:focus-visible, .tile:focus-visible, .btn:focus-visible, .back:focus-visible, .ws:focus-visible, .linkbtn:focus-visible, a:focus-visible, pre:focus-visible, .check input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.code-inputs input:focus-visible, .field input:focus-visible { outline: 3px solid rgba(51, 140, 230, .45); outline-offset: 1px; }
h1:focus { outline: none; }
.tile { font: inherit; color: inherit; }
.tile:disabled { cursor: not-allowed; }
.tile.soon em { font-weight: 600; }
.tile.on .ico { color: var(--blue); }
.tile[aria-pressed="true"] { border-color: var(--blue); background: var(--pale); }
.ws { width: 100%; text-align: left; font: inherit; color: inherit; min-height: 64px; }
.ws .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ws .t, .item h3, .prompt, dd, .lead, h1 { overflow-wrap: anywhere; }
.ws .arrow { width: 20px; height: 20px; color: #8ca7c5; margin-left: auto; }
.list > * + * { margin-top: 10px; }
.list .card + .card { margin-top: 10px; }
.gap-top { margin-top: 14px; }
.center-row { justify-content: center; }
.btn.small { min-height: 44px; padding: 8px 16px; }
.back { min-height: 44px; padding: 0 8px 0 0; }
.linkbtn { background: none; border: 0; color: var(--blue); text-decoration: underline; padding: 10px 0; min-height: 44px; font-size: 14px; cursor: pointer; }
.check { min-height: 44px; }
.check label { padding: 6px 0; flex: 1; }
.field .e { min-height: 0; }
.field .e:empty, .check + .e:empty { display: none; }
.e { color: var(--red); font-size: 13px; }
.field input[aria-invalid="true"], .code-inputs input[aria-invalid="true"] { border-color: var(--red); }
.item .meta { margin-top: 2px; }
.item .row { margin-top: 12px; }
.chip-line { margin: 0 0 12px; font-size: 14px; }
.success .ico.big { display: block; margin: 0 auto 10px; }
.success .stack { max-width: 320px; margin: 18px auto 0; }
.profile-head { display: flex; gap: 14px; align-items: center; }
.profile-head .name { font-weight: 600; color: var(--navy); font-size: 17px; overflow-wrap: anywhere; }
.avatar.ph { display: grid; place-items: center; font-weight: 700; color: var(--blue); font-family: var(--f-display); font-size: 22px; }
.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
#devtag { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: rgba(255, 255, 255, .18); }
#devtag:empty { display: none; }
.gate .btn { text-align: center; }
.err { min-height: 22px; }
@media (max-width: 380px) { .code-inputs { gap: 8px; } .code-inputs input { width: 54px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; } }
[hidden] { display: none !important; }
.news-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
.toast-link { color: #9fd0ff; font-weight: 600; display: inline-block; min-height: 24px; }

/* ---- contact + quote wizard ---- */
.choices { display: grid; gap: 12px; margin-top: 6px; }
.choice { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 96px; padding: 16px; text-align: left; text-decoration: none; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; color: var(--ink); font: inherit; cursor: pointer; box-shadow: 0 6px 20px rgba(27, 68, 115, .04); }
.choice:active { transform: scale(.99); }
.choice .ico:first-child { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--pale); }
.choice .grow { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.choice b { font-family: var(--f-display); font-size: 17px; color: var(--navy); line-height: 1.4; }
.choice em { font-style: normal; font-size: 13px; color: var(--muted); line-height: 1.5; }
.choice .chev { color: #8ca7c5; }
.choice[disabled], .choice[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.choice:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.wz-top { margin-bottom: 14px; }
.wz-count { margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.wz-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.wz-bar span { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .25s ease; }
.wz h1 { margin-top: 0; }
.wz > .lead { margin-bottom: 12px; }
.wz input[type="text"], .wz input[type="email"], .wz textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 16px; }
.wz textarea { resize: vertical; min-height: 140px; }
.wz input:focus-visible, .wz textarea:focus-visible { outline: 3px solid rgba(51, 140, 230, .45); outline-offset: 1px; border-color: var(--blue); }
.wz [aria-invalid="true"] { border-color: var(--red); }
.wz .e { min-height: 22px; margin-top: 6px; }
.wz-choices { display: grid; gap: 8px; }
.wz-group { margin: 10px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.wz-choice { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; overflow-wrap: anywhere; line-height: 1.5; }
.wz-choice input { width: 22px; height: 22px; flex: 0 0 auto; margin: 0; accent-color: var(--blue); }
.wz-choice:has(input:checked) { border-color: var(--blue); background: var(--pale); }
.wz-choice:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }
.wz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wz-actions .btn { flex: 1 1 120px; }
.wz-rows { border-top: 1px solid var(--line); }
.wz-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.wz-row .grow { flex: 1 1 auto; min-width: 0; }
.wz-k { font-size: 12px; color: var(--muted); }
.wz-v { overflow-wrap: anywhere; white-space: pre-wrap; }
.wz-row .linkbtn { flex: 0 0 auto; min-width: 44px; padding: 8px 0 8px 8px; }
.wz .err { text-align: left; }
@media (prefers-reduced-motion: reduce) { .wz-bar span { transition: none; } }
.wz-actions .btn.wide { flex-basis: 100%; order: -1; }
