:root {
  color-scheme: light;
  --header: 128px;
  --ink: #1f2328;
  --muted: #595959;
  --line: #c9ced3;
  --brand: #0b5e55;
  --brand-soft: #e6f2f0;
  --error: #b3261e;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.6 system-ui, "Noto Sans TC", "PingFang TC", sans-serif;
}

:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.site-header {
  height: var(--header);
  background: var(--brand);
  color: #fff;
  padding: 0 16px;
  display: grid;
  grid-template-rows: 72px 56px;
  align-items: center;
}
.site-header { position: fixed; inset: 0 0 auto; z-index: 10; }
body { padding-top: var(--header); }
.brand { color: #fff; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.site-header nav { display: flex; gap: 8px; }
.site-header nav a {
  color: #fff; text-decoration: none; min-height: 44px;
  display: inline-flex; align-items: center; padding: 0 12px; border-radius: 6px;
}
.site-header nav a[aria-current="page"] { background: rgb(255 255 255 / .18); font-weight: 700; }
.site-header :focus-visible { outline-color: #fff; }

.notice {
  display: flex; align-items: center; gap: 8px;
  background: #fff4d6; padding: 4px 4px 4px 16px;
}
.notice p { margin: 0; flex: 1; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 6px; background: transparent; color: var(--ink); cursor: pointer;
}

main { max-width: 40rem; min-height: calc(100svh + 120px); margin: 0 auto; padding: 16px 16px 48px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.25rem; margin: 0 0 16px; }
h2:focus { outline: none; }

.progress { color: var(--muted); font-size: .875rem; font-weight: 600; margin-inline-end: 8px; }

label, legend { display: block; font-weight: 600; margin: 16px 0 4px; padding: 0; }
input, select {
  width: 100%; min-height: 48px; padding: 8px 12px;
  font: inherit; color: inherit; background: #fff;
  border: 1px solid #6b7178; border-radius: 6px;
}
.hint { margin: 4px 0 0; color: #999999; font-size: .875rem; }
.error { color: var(--error); font-weight: 600; }

.label { display: block; font-weight: 600; margin: 16px 0 4px; }
.picker {
  position: relative; min-height: 48px; padding: 10px 12px;
  border: 1px solid #6b7178; border-radius: 6px; background: #fff; cursor: pointer;
}
.picker::after { content: "▾"; position: absolute; inset-inline-end: 12px; top: 10px; }
.picker-list {
  position: absolute; inset: calc(100% + 4px) -1px auto; z-index: 5;
  margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid #6b7178; border-radius: 6px;
}
.picker-option { padding: 10px 12px; }
.picker-option:hover, .picker-option:focus { background: var(--brand-soft); }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.cal-head, .cal {
  display: grid; grid-template-columns: repeat(7, 20px);
  gap: 2px; justify-content: start;
}
.cal-head span { text-align: center; color: var(--muted); font-size: .625rem; }
.cal button {
  width: 20px; height: 20px; padding: 0;
  font: inherit; font-size: .75rem; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 3px; cursor: pointer;
}
.cal button:disabled { color: #6b7178; background: #f2f3f4; border-color: transparent; cursor: not-allowed; text-decoration: line-through; }
.cal button[aria-pressed="true"], .slot[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.slots { width: 800px; border-collapse: collapse; margin-top: 24px; }
.slots caption { text-align: start; font-weight: 600; margin-bottom: 8px; }
.slots th { text-align: start; font-size: .875rem; color: var(--muted); font-weight: 600; padding: 4px 8px; }
.slots td { padding: 4px 8px; border-top: 1px solid var(--line); }
.slot {
  min-width: 96px; min-height: 44px;
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 6px; cursor: pointer;
}
.slot:disabled { color: #6b7178; background: #f2f3f4; cursor: not-allowed; }


.step-nav { display: flex; align-items: center; gap: 4px; margin-top: 24px; }
.arrow {
  width: 18px; height: 18px; padding: 0; line-height: 1;
  font: inherit; font-size: .875rem; font-weight: 700;
  color: var(--brand); background: #fff;
  border: 1px solid var(--brand); border-radius: 3px; cursor: pointer;
}
.arrow.primary { color: #fff; background: var(--brand); }
.btn {
  min-width: 44px; min-height: 44px; padding: 8px 20px;
  font: inherit; font-weight: 600; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand); background: #fff;
  border: 2px solid var(--brand); border-radius: 6px; cursor: pointer;
}
.btn.primary { color: #fff; background: var(--brand); }
#submit, #lookup-submit { margin-inline-start: auto; }
.btn[aria-busy="true"] { cursor: progress; opacity: .85; }

.summary { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; }

.done { padding: 24px 0; }
.code { font-size: 1.75rem; font-weight: 700; letter-spacing: .05em; margin: 0 0 24px; }
.done p:not(.code) { margin: 0; color: var(--muted); }

.site-footer { border-top: 1px solid var(--line); padding: 16px; text-align: center; color: var(--muted); font-size: .875rem; }
.site-footer p { margin: 0; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
