/* Mobile-first glass surface. Solid fallbacks retain contrast without blur. */
:root {
  font-family: "Kanit", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  font-synthesis: none;
  color: #1D2746;
  background: #EDF1FB;
  --blue: #1428A0;
  --accent: #142348;
  --accent-hover: #0B1733;
  --muted: #59647D;
  --border: rgba(97, 117, 168, .17);
  --glass: rgba(255, 255, 255, .72);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 0 5%, #D0DEFF 0, transparent 48%), radial-gradient(ellipse at 100% 45%, #E2DAF9 0, transparent 54%), #EDF1FB; }
button, input { font: inherit; }
button, a, input, label { -webkit-tap-highlight-color: transparent; }
button { min-height: 44px; padding: 13px 20px; border: 1px solid transparent; border-radius: 14px; background: var(--accent); color: #FFF; font-weight: 500; cursor: pointer; line-height: 1.5; box-shadow: 0 5px 12px rgba(20, 35, 72, .15); }
button:hover:not(:disabled) { background: var(--accent-hover); }
button:disabled { background: #E2E7F0; border-color: #D3DAE7; color: #67728A; cursor: not-allowed; box-shadow: none; }
button.secondary { color: var(--accent); background: rgba(255,255,255,.55); border-color: rgba(20,35,72,.3); box-shadow: none; }
button.secondary:hover:not(:disabled) { background: #E9EDF8; }
:focus-visible { outline: 3px solid #1428A0; outline-offset: 4px; }
input { min-height: 52px; width: 100%; min-width: 0; padding: 13px 15px; border: 1px solid #A9B7D2; border-radius: 14px; background: rgba(255,255,255,.83); color: #1D2746; font-size: 1rem; }
input:focus { border-color: var(--blue); }
input::placeholder { color: #75819B; font-weight: 400; }
label { display: block; margin-bottom: 8px; font-weight: 500; font-size: .9rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 6vw, 2.3rem); line-height: 1.35; font-weight: 600; letter-spacing: -.6px; }
h2 { font-size: 1.05rem; font-weight: 500; }
h3 { font-size: 1.12rem; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
p { color: var(--muted); }
.demo-banner { padding: 6px 16px; color: #566380; background: rgba(255,255,255,.5); text-align: center; font-size: .72rem; }
.topbar-inner { max-width: 880px; margin: auto; min-height: 72px; padding: 12px 22px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; min-height: 44px; color: var(--blue); font-size: 1.65rem; letter-spacing: -1px; font-weight: 600; text-decoration: none; }
.brand span { color: var(--accent); }
.internal { padding: 5px 12px; border: 1px solid rgba(255,255,255,.85); border-radius: 999px; background: rgba(255,255,255,.45); color: #465473; font-size: .76rem; }
main { max-width: 880px; padding: 16px 18px 8px; margin: auto; }
.page-heading { margin: 0 4px 24px; }
.page-heading p { margin-top: 8px; font-size: .88rem; max-width: 35ch; }
.card { padding: 22px 20px; border-radius: 24px; border: 1px solid rgba(255,255,255,.93); background: var(--glass); box-shadow: 0 12px 36px rgba(61,80,132,.07), inset 0 1px 0 rgba(255,255,255,.6); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.lookup-card h2 { margin-bottom: 18px; }
.search-row { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
.search-row button { min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.hint { margin-top: 10px; font-size: .76rem; line-height: 1.65; }
.message:empty { display: none; }
.message { position: sticky; top: 10px; z-index: 5; margin: 14px 0; padding: 12px 15px; border: 1px solid #C0D1F2; border-radius: 14px; color: #253F70; background: rgba(242,248,255,.96); font-size: .86rem; }
.error { background: #FFF2EE; color: #982B16; border-color: #EBC4B9; }
.missing-card { margin-top: 14px; }
#missing-panel { margin-top: 18px; }
#missing-submit { width: 100%; margin-top: 12px; }
#result { margin-top: 16px; }
.store-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.eyebrow { margin-bottom: 4px; font-size: .72rem; color: var(--muted); }
.tag { flex-shrink: 0; max-width: 38%; overflow-wrap: anywhere; padding: 4px 10px; border-radius: 9px; background: rgba(20,40,160,.07); color: var(--blue); font-size: .75rem; }
.record-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px 12px; margin: 17px 0; }
.record-grid .wide { grid-column: 1/-1; }
dt { color: var(--muted); font-size: .73rem; }
dd { margin: 3px 0 0; font-size: .97rem; overflow-wrap: anywhere; white-space: pre-wrap; font-weight: 400; }
.mono { font-variant-numeric: tabular-nums; }
.explanation { padding: 10px 12px; border-radius: 11px; background: rgba(20,40,160,.045); font-size: .72rem; line-height: 1.7; }
.explanation strong { font-weight: 500; color: #35436A; }
.notice { margin-top: 16px; padding: 15px; background: #FFF7E6; border: 1px solid #E4D4AE; border-radius: 15px; }
.notice h3 { color: #735019; font-size: .95rem; }
.notice p { font-size: .76rem; color: #735019; }
.notice dl { margin: 10px 0 0; }
.notice dl>div+div { margin-top: 10px; }
.actions-grid { display: grid; gap: 14px; margin-top: 14px; }
.action-card>p:not(.hint) { margin: 3px 0 16px; font-size: .83rem; }
#reset-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; }
#reset-block { color: #825418; }
#reset-block:empty { display: none; }
.correction-intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.correction-intro p { font-size: .78rem; margin-top: 3px; }
#correction-toggle { flex-shrink: 0; padding-inline: 14px; font-size: .85rem; }
#correction-panel { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
fieldset { border: 0; margin: 0 0 18px; padding: 0; }
legend { font-size: .87rem; padding: 0; font-weight: 500; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.check { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 13px; border: 1px solid #BDC8DC; background: rgba(255,255,255,.55); padding: 10px; margin: 0; cursor: pointer; font-size: .9rem; }
.check:has(:checked) { background: #E9EDF8; border-color: var(--accent); color: var(--accent); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 18px; padding: 0; margin: 0; accent-color: var(--accent); }
.field { margin: 16px 0; }
#correction-button { width: 100%; margin-top: 12px; }
.privacy { margin: 22px 4px 10px; text-align: center; }
.privacy p, footer { font-size: .72rem; color: #626D86; }
footer { max-width: 880px; padding: 8px 20px 26px; margin: auto; text-align: center; }
dialog { width: calc(100% - 36px); max-width: 460px; max-height: calc(100svh - 40px); overflow: auto; color: #1D2746; background: rgba(252,253,255,.97); border: 1px solid #FFF; border-radius: 24px; padding: 24px; font: inherit; box-shadow: 0 30px 90px rgba(32,43,78,.2); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); }
dialog::backdrop { background: rgba(25,35,68,.35); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
dialog h2 { font-size: 1.15rem; }
dialog p { margin: 15px 0 22px; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions button { flex: 1; min-width: 0; padding-inline: 10px; }
.skip-link { position: fixed; top: -100px; left: 12px; padding: 12px; background: #FFF; z-index: 20; }
.skip-link:focus { top: 8px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }
@media (min-width: 700px) {
  .topbar-inner { min-height: 84px; padding-inline: 28px; }
  main { padding: 24px 28px 10px; }
  .page-heading { margin-bottom: 28px; }
  .page-heading p { max-width: none; }
  .card { padding: 26px 28px; }
  .search-row { grid-template-columns: minmax(0,1fr) 190px; }
  .actions-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .correction-intro { flex-wrap: wrap; }
  #correction-toggle { width: 100%; }
  .record-grid { grid-template-columns: 1fr 1fr; gap: 18px 28px; }
  .record-grid .wide { grid-column: auto; }
}
@supports not (backdrop-filter: blur(1px)) { .card { background: #F9FAFF; } }
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .16s ease, transform .16s ease; }
  button:active:not(:disabled) { transform: translateY(1px); }
}
