:root {
  --navy: #091d3b;
  --blue: #0b4f86;
  --paper: #f4f7fb;
  --card: #fff;
  --text: #172a47;
  --secondary: #3e5878;
  --line: #d5e0ec;
  --danger: #8d1d1d;
  --danger-bg: #fdecec;
  --warn-bg: #fff4e5;
  --warn: #5c2e00;
  --ok-bg: #e5f6ee;
  --ok: #0d5c3d;
  --focus: #76cafb;
  color: var(--text);
  font-family: "Noto Sans Thai", Tahoma, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  background: var(--paper);
  accent-color: var(--blue);
  caret-color: var(--text);
  scrollbar-color: #8ea3bb var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
::selection { background: #8ad1ff; color: #0b2b4a; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 12px; }
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  background: var(--navy);
  color: #e8f4fc;
}
.word { font-weight: 700; letter-spacing: -0.03em; text-decoration: none; font-size: 1rem; }
.word span { color: #7fd3ff; }
.bar p { margin: 0; color: #d5e8f6; font-weight: 600; }
.steps {
  display: flex;
  gap: 4px;
  padding: 8px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
  overflow-x: auto;
}
.steps a {
  text-decoration: none;
  font-weight: 600;
  color: var(--secondary);
  padding: 10px 14px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.steps a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--blue); }
main { max-width: 920px; margin: 0 auto; padding: 28px 20px 64px; }
h1 { font-size: 2.15rem; line-height: 1.25; letter-spacing: -0.03em; margin: 0 0 12px; max-width: 16em; }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 26px 0 8px; }
.lede { max-width: 68ch; margin: 0 0 8px; }
.explain { max-width: none; }
.explain h2:first-child { margin-top: 22px; }
.explain h2, .explain p, .explain ul { max-width: 68ch; }
.explain ul { margin: 0; padding-left: 1.2rem; }
.explain li { margin: 0 0 8px; }
.story-shot { display: block; width: 100%; max-width: 100%; min-width: 0; margin: 16px 0 4px; }
.story-shot img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: var(--navy);
}
.story-shot figcaption {
  margin: 8px 0 0;
  max-width: 68ch;
  color: var(--secondary);
  font-weight: 600;
}
.flow { margin: 0 0 18px; padding-left: 1.2rem; max-width: 68ch; }
.flow li { margin: 0 0 8px; }
.note, .banner, .error-summary, small, .field-error { color: var(--secondary); font-weight: 600; }
.note { max-width: 68ch; margin: 0 0 8px; }
.banner, .error-summary {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 12px 14px;
  margin: 0 0 16px;
}
.error-summary { background: var(--danger-bg); color: var(--danger); }
.error-summary a { color: var(--danger); }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
fieldset {
  border: 1px solid var(--line);
  background: var(--card);
  margin: 0 0 22px;
  padding: 18px 16px 8px;
}
legend { font-weight: 700; font-size: 1.5rem; padding: 0 6px; }
label { display: block; font-weight: 600; margin: 0 0 14px; }
label input, label textarea, label small { margin-top: 6px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.block { margin-top: 4px; }
input, textarea {
  width: 100%;
  border: 1px solid #b7c6d6;
  background: #fff;
  border-radius: 6px;
  padding: 10px 12px;
  font-weight: 500;
}
textarea { resize: vertical; min-height: 88px; }
input:hover, textarea:hover { border-color: #7f97b0; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); background: #fff8f8; }
small { display: block; font-size: 1rem; }
.req { color: var(--danger); font-weight: 700; }
.choice, .checks { display: grid; gap: 8px; margin: 0 0 14px; }
.choice label, .checks label {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  column-gap: 10px;
  align-items: start;
  font-weight: 600;
  margin: 0;
  padding: 8px 4px;
}
.choice small, .checks small { display: block; grid-column: 2; font-weight: 600; margin-top: 2px; }
.choice input, .checks input { width: 1.15rem; height: 1.15rem; margin-top: 4px; }
.choice p { margin: 0; font-weight: 700; }
.field-error { color: var(--danger); margin: -6px 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.actions.tight { margin: 0 0 12px; }
.primary, .secondary, .quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid transparent;
  font-weight: 700;
}
.primary { background: var(--blue); color: #fff; }
.primary:hover { background: #083e6b; }
.secondary { background: #fff; color: var(--navy); border-color: #b7c6d6; }
.secondary:hover { border-color: var(--blue); }
.quiet { background: transparent; color: var(--blue); border-color: transparent; }
.quiet:hover { background: #e7f1fa; }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.receipt {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 18px 16px;
  margin: 0 0 16px;
}
.receipt h2 { margin-top: 18px; }
.receipt p { margin: 0 0 8px; max-width: 68ch; }
.inbox { margin-top: 28px; }
.inbox article {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin: 0 0 10px;
}
.inbox button { margin-top: 6px; }
.foot { padding: 18px 20px 28px; color: var(--secondary); font-weight: 600; max-width: 920px; margin: 0 auto; }
@media (max-width: 700px) {
  .split { grid-template-columns: 1fr; }
  .bar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .steps { padding: 6px 8px; }
  .steps a { padding: 10px 8px; }
  h1 { font-size: 2rem; max-width: none; }
  main { padding: 22px 16px 48px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
@media print {
  .bar, .steps, .actions, .foot, .no-print, .inbox { display: none !important; }
  body.printing-receipt [data-panel] { display: none !important; }
  body.printing-receipt #panel-send { display: block !important; }
  main { max-width: none; padding: 0; }
  .receipt { border: 0; }
}
