:root {
  font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  font-size: 20px;
  line-height: 1.65;
  color: #1c2a48;
  background: #f5f7fc;
  --pine: #233d79;
  --pine-dark: #142957;
  --ink: #1c2a48;
  --muted: #4e5c77;
  --gold: #f0bd38;
  --line: #d7deeb;
  --paper: #fff;
  --soft: #e9eef9;
  --danger: #bb373a;
  --brand-blue: #27468d;
  --brand-yellow: #f0bd38;
  --brand-red: #dd4548;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
a { color: var(--pine); text-underline-offset: .2em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.admin-tools { margin-top: 24px; padding: 16px; border: 2px solid var(--gold); border-radius: 12px; }
.admin-tools summary { cursor: pointer; font-weight: 800; font-size: 1.1rem; }
.admin-tools textarea { width: 100%; min-height: 110px; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
:focus-visible { outline: 4px solid #c53035; outline-offset: 4px; }

header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 17px max(22px, calc((100vw - 1140px) / 2));
  color: #fff;
  background: linear-gradient(110deg, #142957, #27468d 68%, #365aa0);
  border-bottom: 0;
  box-shadow: 0 8px 25px #14295726;
}
header::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 5px; background: linear-gradient(90deg, var(--brand-blue) 0 33.33%, var(--brand-yellow) 33.33% 66.66%, var(--brand-red) 66.66%); }
header { position: relative; }
header .brand {
  color: #fff;
  font-size: 27px;
  font-weight: 850;
  text-decoration: none;
  letter-spacing: -.055em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
header .brand::before {
  content: 'L';
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff9c;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(90deg, var(--brand-blue) 0 33.33%, var(--brand-yellow) 33.33% 66.66%, var(--brand-red) 66.66%) top / 100% 6px no-repeat, #1d3670;
  font: 700 27px/1 Georgia, serif;
  letter-spacing: -.08em;
}
header .header-subtitle {
  color: #edf2ff;
  font-size: 17px;
  letter-spacing: .06em;
  flex: 1;
}
header button {
  width: auto;
  min-height: 46px;
  margin: 0;
  padding: 7px 16px;
  color: #fff;
  background: #ffffff12;
  border: 1px solid #e2eaff8a;
  border-radius: 11px;
  font-size: 17px;
}
header button:hover { background: #ffffff2a; color: #fff; }

.warning {
  padding: 11px 20px;
  color: #4d3210;
  background: #fff0c5;
  border-bottom: 1px solid #e4c361;
  text-align: center;
  font-size: 17px;
  font-weight: 750;
}
.staff-alert-banner { max-width: 1096px; margin: 18px auto 0; padding: 22px; background: #fff7ef; border: 3px solid var(--danger); border-radius: 16px; box-shadow: 0 10px 28px #59232324; color: #341b1b; }
.staff-alert-banner h2 { color: #8b2529; margin-bottom: 8px; }
.staff-alert-banner p { font-size: 20px; line-height: 1.5; }
.staff-alert-banner .row { gap: 10px; flex-wrap: wrap; }
.alert-action { padding: 14px; background: #fff4e6; border-left: 5px solid var(--brand-red); font-size: 20px; }
main { max-width: 1140px; min-height: 62vh; margin: 34px auto 72px; padding: 0 22px; }
h1, h2, h3 { color: var(--pine-dark); letter-spacing: -.055em; }
h1 { margin: 8px 0 23px; font-size: 40px; line-height: 1.25; font-weight: 850; }
h2 { margin: 0 0 17px; font-size: 28px; line-height: 1.35; font-weight: 800; }
h3 { font-size: 23px; }
p { margin: 12px 0; }
.muted { color: var(--muted); font-size: 18px; }
.narrow { max-width: 620px; margin-inline: auto; }
.home-shell { max-width: 700px; }

.hero {
  position: relative;
  overflow: hidden;
  margin: 6px 0 24px;
  padding: 45px 34px 48px;
  color: #fff;
  background: linear-gradient(145deg, #34569b, #142957 75%);
  border-radius: 30px;
  text-align: center;
  box-shadow: 0 24px 50px #172d612b;
}
.hero::before, .hero::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border: 1px solid #ffffff2e;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before { left: -180px; bottom: -210px; }
.hero::after { right: -185px; top: -205px; }
.hero .mark {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  width: max-content;
  margin: 0 auto 21px;
  color: #fff;
  font: 800 43px/1.1 system-ui, sans-serif;
  letter-spacing: .08em;
}
.hero .mark::before { content: ''; width: 124px; height: 9px; border-radius: 2px; background: linear-gradient(90deg, #385cb0 0 33.33%, var(--brand-yellow) 33.33% 66.66%, var(--brand-red) 66.66%); }
.hero .eyebrow { color: #f6d983; font-size: 15px; font-weight: 800; letter-spacing: .22em; }
.hero h1 { color: #fff; font-size: 43px; margin: 10px 0; }
.hero .hero-line { width: 54px; height: 4px; margin: 23px auto; background: var(--brand-yellow); }
.hero .hero-desc { margin: 0; color: #edf2ff; font-size: 22px; }
.hero-links { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.hero-links .button { margin: 0; }
.home-note { text-align: center; margin-top: 25px; }
.home-staff { text-align: center; padding-top: 6px; }

.card, .guide-step, .record {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: 0 8px 27px #203b760e;
}
.card {
  margin: 18px 0;
  padding: 28px;
  border-radius: 22px;
  overflow-wrap: anywhere;
}
.card h2 { margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid > .card { margin: 0; }
.grid + .card { margin-top: 20px; }
.balance {
  border: 1px solid #bfcde6;
  border-top: 5px solid var(--brand-red);
  background: linear-gradient(155deg, #fff, #eaf0fb);
  text-align: center;
}
.balance > p:first-child, .balance h2 { color: var(--pine-dark); }
.number { color: var(--pine); font-size: 88px; line-height: 1.12; font-weight: 900; letter-spacing: -.07em; }
.number span { font-size: .42em; letter-spacing: 0; margin-left: .13em; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1; min-width: 0; }

button, .button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 64px;
  margin: 5px 0;
  padding: 12px 19px;
  color: #fff;
  background: var(--pine);
  border: 1px solid var(--pine);
  border-radius: 13px;
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.35;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
button:hover, .button:hover { background: var(--pine-dark); color: #fff; box-shadow: 0 6px 16px #1b327a2d; transform: translateY(-1px); }
button:active, .button:active { transform: translateY(0); }
button:disabled { background: #dbe1ea; color: #54617a; border-color: #dbe1ea; cursor: not-allowed; box-shadow: none; transform: none; }
.secondary { background: #fff; color: var(--pine); border-color: #8397bd; }
.secondary:hover { background: #e9eef9; color: var(--pine-dark); }
.danger { background: var(--danger); border-color: var(--danger); }
.danger:hover { background: #952c31; }

label { display: block; font-weight: 750; color: var(--pine-dark); }
input, select {
  display: block;
  width: 100%;
  min-height: 62px;
  margin: 7px 0 19px;
  padding: 11px 15px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid #8fa1bd;
  border-radius: 12px;
  font-size: 20px;
}
input::placeholder { color: #69758b; opacity: 1; }
input:focus, select:focus { border-color: var(--pine); }
input[type=checkbox] { display: inline-block; width: 27px; min-height: 27px; margin: 0 10px 0 0; vertical-align: middle; accent-color: var(--pine); }

nav { display: flex; gap: 9px; flex-wrap: wrap; margin: 3px 0 28px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 47px;
  padding: 7px 15px;
  color: var(--pine);
  background: #fff;
  border: 1px solid #d0d9e9;
  border-radius: 99px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 750;
}
nav a:hover { background: var(--pine); border-color: var(--pine); color: #fff; }
nav a[aria-current=page] { background: var(--pine); border-color: var(--pine); color: #fff; box-shadow: inset 0 -4px 0 var(--brand-yellow); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 17px 0 25px; }
.stats div { padding: 19px 15px; text-align: center; background: #eaf0fb; border: 1px solid #d4dff0; border-radius: 18px; border-top: 4px solid var(--brand-yellow); }
.stats div:first-child { border-top-color: var(--brand-blue); }
.stats div:last-child { border-top-color: var(--brand-red); }
.stats b { display: block; color: var(--pine); font-size: 42px; font-weight: 900; line-height: 1.12; }
.stats span { display: block; margin-top: 5px; font-size: 17px; font-weight: 750; }
.pass-list p { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0; padding: 14px 17px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; }
.pass-list b { color: var(--pine); font-size: 27px; white-space: nowrap; }
.pass-list span { color: var(--muted); font-size: 18px; }
.pass-list .muted { display: block; padding: 0; border: 0; background: transparent; }
.expiry-callout { padding: 16px; margin-top: 22px; background: #e9eef9; border-radius: 14px; font-size: 19px; }
.expiry-callout b { font-size: 26px; }
.expiry-alert { margin: 20px 0; padding: 19px 23px; color: #5c3b0c; background: #fff3d9; border: 1px solid #e2be61; border-left: 6px solid var(--brand-yellow); border-radius: 15px; }
.expiry-alert strong { display: block; font-size: 26px; }
.expiry-alert p { margin: 5px 0; }

.record { padding: 17px 21px; margin: 13px 0; border-radius: 16px; }
.record > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.record b { font-size: 23px; }
.record strong { color: var(--pine); font-size: 27px; white-space: nowrap; }
.record strong.negative { color: var(--danger); }
.record p { margin: 3px 0; color: var(--muted); font-size: 17px; }
.success-card { margin: 20px 0; padding: 25px 28px; background: #eaf0fb; border: 1px solid #a7bce2; border-left: 7px solid var(--pine); border-radius: 20px; }
.success-card h2 { margin-bottom: 6px; }
.success-card .number { font-size: 70px; }
.success-card p { margin: 6px 0; }
.success-card button { margin-top: 15px; }

.scroll { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 17px; }
table { width: 100%; border-collapse: collapse; font-size: 18px; }
th, td { padding: 15px 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--pine-dark); background: #e9eef9; font-size: 16px; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tr:nth-child(even) td { background: #f8faff; }
td button { min-height: 46px; font-size: 17px; padding: 6px 12px; }
.close-totals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.close-totals div { padding: 21px; background: #eaf0fb; border: 1px solid #d4dff0; border-radius: 17px; }
.close-totals b { display: block; color: var(--pine); font-size: 34px; overflow-wrap: anywhere; }
.close-totals span { font-size: 18px; }
.close-note { padding: 12px 18px; background: #fff5d9; border-left: 5px solid var(--brand-yellow); }

.guide { max-width: 880px; margin-inline: auto; }
.guide-lead { padding: 21px 24px; color: var(--pine-dark); background: #eaf0fb; border-left: 5px solid var(--brand-yellow); border-radius: 12px; font-size: 23px; font-weight: 800; }
.guide-caution { padding: 17px; color: #603b0b; background: #fff0c5; border-radius: 12px; font-weight: 750; }
.guide-step { margin: 20px 0; padding: 27px 31px; border-radius: 20px; break-inside: avoid; }
.guide-step h2 { padding-bottom: 11px; border-bottom: 1px solid #d9e1ef; }
.guide-step ol, .guide-step ul { padding-left: 1.5em; }
.guide-step li { padding-left: 5px; margin: 12px 0; }
.guide-step p { margin-top: 16px; }
.poster { text-align: center; }
.poster ol { text-align: left; max-width: 600px; margin-inline: auto; }
.qr { width: 250px; }

dialog { width: min(94vw, 560px); max-width: 560px; padding: 30px; color: var(--ink); background: var(--paper); border: 1px solid var(--gold); border-top: 7px solid var(--pine); border-radius: 20px; box-shadow: 0 24px 70px #071a40a0; }
dialog::backdrop { background: #071a40bb; }
#confirmText { white-space: pre-line; font-size: 25px; }
#notice { position: fixed; bottom: 16px; left: 50%; z-index: 5; width: max-content; max-width: calc(100vw - 24px); padding: 13px 22px; transform: translateX(-50%); color: #fff; background: var(--pine-dark); border: 1px solid var(--brand-yellow); border-radius: 12px; box-shadow: 0 10px 28px #14295766; }
#notice:empty { display: none; }
footer { padding: 30px 20px 38px; color: #e9eef9; background: var(--pine-dark); border-top: 5px solid var(--brand-red); text-align: center; font-size: 17px; }
footer a { color: #ffe38d; font-weight: 800; }
small { font-size: 16px; }

html[data-font=large] { font-size: 24px; }
html[data-font=large] h1 { font-size: 46px; }
html[data-font=large] h2 { font-size: 34px; }
html[data-font=large] .muted, html[data-font=large] footer,
html[data-font=large] table, html[data-font=large] .pass-list span,
html[data-font=large] .record p, html[data-font=large] .close-totals span { font-size: 22px; }
html[data-font=large] button, html[data-font=large] .button,
html[data-font=large] input, html[data-font=large] select { font-size: 24px; }
html[data-font=large] nav a, html[data-font=large] header button { font-size: 21px; }
html[data-font=large] .record b, html[data-font=large] .expiry-alert strong { font-size: 30px; }
html[data-font=large] .record strong { font-size: 33px; }
html[data-font=large] .stats span { font-size: 21px; }
html[data-font=large] .warning { font-size: 21px; }
html[data-font=large] #confirmText { font-size: 30px; }
html[data-font=large] .guide-lead { font-size: 29px; }

@media (max-width: 720px) {
  header { padding: 13px 16px; gap: 9px; }
  header .brand { font-size: 23px; margin-right: auto; }
  header .brand::before { width: 35px; height: 35px; font-size: 23px; }
  header .header-subtitle { display: none; }
  header button { font-size: 15px; padding: 7px 10px; }
  main { margin: 23px auto 55px; padding: 0 16px; }
  h1 { font-size: 34px; }
  .grid { grid-template-columns: 1fr; gap: 16px; }
  #search.row { display: grid; grid-template-columns: 1fr; gap: 5px; }
  #search.row input { margin-bottom: 0; }
  .card { padding: 22px; }
  .hero { padding: 39px 21px; border-radius: 24px; }
  .hero h1 { font-size: 36px; }
  .hero-links { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:last-child { grid-column: 1 / -1; }
  .close-totals { grid-template-columns: 1fr; }
  .guide-step { padding: 21px; }
  html[data-font=large] h1 { font-size: 39px; }
}
@media (max-width: 520px) {
  header .brand { width: 100%; }
  .pass-list p { display: block; }
  .pass-list span { display: block; }
  .record > div { align-items: flex-start; }
  .row > * { flex-basis: 100%; }
  .guide-lead { font-size: 21px; }
  .number { font-size: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  button, .button { transition: none; }
}
@media print {
  :root { color: #142a20; background: #fff; font-size: 15px; }
  header, .warning, .staff-alert-banner, footer, nav, button, #notice, .no-print { display: none !important; }
  main { max-width: none; margin: 0; padding: 0; }
  .card, .guide-step, .record { box-shadow: none; }
  .guide { max-width: none; }
  .guide-step { margin: 12px 0; padding: 14px 18px; }
  .guide-lead { padding: 12px; }
  .poster { text-align: center; }
  .qr { width: 350px; }
  a[href^='#'] { color: #142a20; }
}
