:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, "Segoe UI", system-ui, sans-serif;
  background: #f3f8ff;
  color: #17324d;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #0d1b2acc 0, #0d1b2ab3 45%, #0d1b2ad9 100%),
    url("/static/bangkok-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: #17324d;
}
main { width: min(760px, 100%); margin: 0 auto; padding: 20px 24px 40px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 16px max(20px, calc((100vw - 960px) / 2)); }
.topbar .text-button, .topbar .flag-button { color: #eaf3ff; }
.card, .modal-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(5, 15, 30, 0.35);
  padding: 24px;
  margin: 16px 0;
}
.landing-card { text-align: center; padding: 28px clamp(22px, 6vw, 56px) 36px; }
.brand-logo { display: block; width: min(260px, 72vw); height: auto; margin: 0 auto -10px; }
.brand-logo.small { width: 150px; }
.brand-script { margin: 0; color: #2479c7; font-family: "Segoe Script", "Brush Script MT", cursive; font-size: clamp(2.7rem, 10vw, 4.6rem); font-weight: 700; line-height: 1; letter-spacing: .01em; }
.brand-thai { margin: 10px 0 28px; color: #2479c7; font-family: "Leelawadee UI", "Noto Sans Thai", ui-rounded, sans-serif; font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 700; }
.free-service-notice { margin: 0 0 22px; color: #1e8e3e; font-size: clamp(.82rem, 2.4vw, .9rem); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.app-intro-heading { margin: 0 0 8px; color: #17324d; font-size: clamp(1.05rem, 3.4vw, 1.25rem); font-weight: 700; }
.app-intro-text { margin: 0 0 26px; color: #41627e; font-size: clamp(.85rem, 2.6vw, .95rem); line-height: 1.55; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h1, h2 { margin: 0 0 14px; }
p { line-height: 1.6; }
form, label { display: grid; gap: 8px; }
form { gap: 14px; }
input, button { min-height: 46px; font: inherit; border-radius: 12px; padding: 10px 14px; }
input { width: 100%; border: 1px solid #8aa7bd; background: #fff; color: #17324d; }
input:focus { outline: 3px solid #68aee655; border-color: #2479c7; }
button { cursor: pointer; border: 0; background: #2479c7; color: #fff; font-weight: 700; }
button:hover:not(:disabled) { background: #1764a8; }
button:disabled { cursor: not-allowed; opacity: .55; }
.text-button, .flag-button { min-height: 40px; background: transparent; color: #1764a8; padding: 6px 10px; }
.flag-button { font-size: 1.4rem; }
#media { display: grid; gap: 10px; }
#map { height: 360px; margin-top: 12px; border-radius: 14px; overflow: hidden; }
#error, #admin-error { color: #a40022; min-height: 1.5em; }
footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; padding: 18px 20px 32px; color: #cfe0f2; }
footer a { color: #eaf3ff; }
footer .text-button { color: #eaf3ff; }
dialog { width: min(680px, calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; background: transparent; }
dialog::backdrop { background: #10283bcc; backdrop-filter: blur(3px); }
.modal-card { position: relative; max-height: calc(100vh - 30px); overflow-y: auto; margin: 0; }
.modal-close { position: absolute; top: 12px; right: 12px; min-width: 42px; background: transparent; color: #17324d; font-size: 1.6rem; }
.notice { padding: 14px; border-radius: 12px; background: #edf6ff; }
.anonymous-notice { padding: 16px; border: 1px solid #e5bd2d; border-radius: 14px; background: #fff4ad; color: #493900; }
.anonymous-notice h3 { margin: 0 0 8px; font-size: 1.15rem; }
.anonymous-notice p { margin: 0; font-size: .92rem; }
.data-modal #data-application-fields { display: grid; gap: 12px; }
.admin-grid { grid-template-columns: 1fr 1.4fr .6fr auto; align-items: end; }
.application-row { display: grid; grid-template-columns: 1fr .6fr auto auto; gap: 10px; align-items: center; border-top: 1px solid #d9e8f5; padding: 12px 0; }
.application-key { font-family: ui-monospace, monospace; font-size: .85rem; color: #58738a; }
.legal-page { text-align: center; margin-top: 40px; }
[hidden] { display: none !important; }
@media (max-width: 620px) {
  main { padding: 10px 14px 28px; }
  .topbar { padding: 10px 12px; }
  .card { border-radius: 18px; padding: 18px; }
  .admin-grid, .application-row { grid-template-columns: 1fr; }
  .brand-logo { width: min(220px, 78vw); }
}
