:root {
  color-scheme: light;
  --navy: #12395b;
  --blue: #14508c;
  --page: #f2f4f7;
  --border: #d9dee5;
  --tint: #eaf1f8;
  --text: #222;
  --muted: #666;
  --green: #1c804a;
  --used: #e0e3e7;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: #e4e7eb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
h1:focus, #dialog-title:focus { outline: none; }

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: auto;
  background: var(--page);
}

#header {
  display: flex;
  align-items: center;
  min-height: 50px;
  padding: 7px 22px;
  background: var(--navy);
  color: white;
}

#header h1 { font-size: 18px; line-height: 1.45; }
#header p { color: #c3d4e3; font-size: 12px; line-height: 1.45; }
.back {
  display: grid;
  place-items: center;
  width: 24px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
}
.back::before {
  content: "";
  width: 11px;
  height: 11px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(45deg);
}
.back:focus-visible { outline-color: white; }

#screen { flex: 1; padding: 14px 16px 16px; }
.card, .slot, input:not([type=checkbox], [type=radio]), select {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
}
h2 { font-size: 15px; line-height: 1.45; }
.location, .slot-summary { padding: 8px 11px; }
.location { min-height: 65px; padding-top: 7px; }
.location p, .slot-summary p { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.location .delivery-note { color: var(--navy); font-weight: 700; }
.slot-summary { background: var(--tint); }
.slot-summary h2, .column-label, .pin-card h2 { color: var(--navy); }
.slot-summary p { margin-top: 1px; }

.legend {
  display: flex;
  gap: clamp(12px, 6vw, 26px);
  list-style: none;
  padding: 0 6px;
  margin: 13px 0 15px;
  color: var(--muted);
  font-size: 12px;
}
.legend li { display: flex; align-items: center; gap: 5px; }
.legend span { width: 18px; height: 18px; border: 1px solid var(--border); border-radius: 3px; background: white; }
.locker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 7px; }
.column-label {
  display: grid;
  place-content: center;
  min-height: 60px;
  margin-bottom: 1px;
  border-radius: 6px;
  text-align: center;
  background: var(--tint);
}
.column-label strong { font-size: clamp(11px, 3.4vw, 13px); }
.column-label b { margin-top: 2px; color: var(--text); font-size: 13px; }
.column-label span { color: var(--muted); font-size: 10px; }
.slot { display: grid; place-content: center; gap: 3px; min-height: 60px; padding: 3px; }
.slot strong { font-size: 16px; }
.slot span { font-size: 12px; color: var(--green); }
.slot.used, .legend .used { background: var(--used); border-color: var(--used); color: #707780; }
.slot.used span { color: inherit; }
.slot.chosen, .legend .chosen { background: var(--blue); border-color: var(--blue); color: white; }
.slot.chosen span { color: #d2e2f2; }
.notes { margin: 15px 6px 0; color: var(--muted); font-size: 12px; line-height: 1.65; }

#actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding: 6px 22px max(21px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: white;
}
.action-summary { min-height: 24px; font-size: 13px; line-height: 22px; }
.primary, .secondary {
  display: block;
  width: 100%;
  min-height: 43px;
  padding: 8px 4px;
  border: 1px solid var(--blue);
  border-radius: 6px;
  font-size: clamp(13px, 4.1vw, 16px);
  font-weight: 700;
}
.primary { background: var(--blue); color: white; }
.primary:disabled { background: #657c91; border-color: #657c91; }
.secondary { background: white; color: var(--blue); }
.footer-link { margin-top: 12px; text-align: center; }
.text-button { border: 0; padding: 5px 3px; color: var(--blue); background: transparent; font-size: 12px; }
.text-button:hover { text-decoration: underline; }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; margin-left: 6px; margin-bottom: 6px; font-size: 14px; font-weight: 700; }
.item-fields { margin: 18px 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px; max-width: 300px; }
.chips label { position: relative; cursor: pointer; }
.chips input { position: absolute; opacity: 0; }
.chips span {
  display: block;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: white;
  font-size: 13px;
}
.chips input:checked + span { color: white; background: var(--blue); border-color: var(--blue); font-weight: 700; }
.chips input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.destination { display: flex; align-items: center; gap: 8px; min-height: 43px; padding: 7px 11px; color: var(--muted); font-size: 12px; }
.destination + .destination { margin-top: 7px; }
.destination span { flex: 0 0 40%; }
.destination input:not([type=checkbox], [type=radio]) { flex: 1; min-width: 0; min-height: 28px; padding: 2px 0; border: 0; font-size: 14px; }
.eta { margin: 7px 0 14px; padding: 8px 11px; background: #f9f7ee; }
.eta h2 { font-size: 13px; }
.eta p { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
input[type=checkbox], input[type=radio] {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--blue);
}
.prices, .info { padding: 4px 11px; font-size: 13px; }
.prices > div, .info > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  min-height: 25px;
}
.prices dd, .info dd { text-align: right; overflow-wrap: anywhere; }
.prices .total { border-top: 1px solid var(--border); font-weight: 700; }
.payment-fields { margin-top: 17px; }
.payment-fields legend { margin-bottom: 8px; }
.payment-fields label, dialog form > label { display: block; min-width: 0; font-size: 12px; color: var(--muted); }
.payment-fields label { margin-bottom: 13px; }
input:not([type=checkbox], [type=radio]), select {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  font-size: 16px;
  color: var(--text);
}
input::placeholder { color: #6c747e; opacity: 1; }
.field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.consent { display: flex; align-items: flex-start; gap: 7px; padding: 7px 11px; background: #f9f7ee; font-size: 12px; line-height: 1.45; }
.consent input { margin-top: 5px; }
.consent small { display: block; font-size: 11px; color: var(--muted); }
.error { margin: 8px 0; color: #a02222; font-size: 13px; }

.booking > * + *, .booking + .booking { margin-top: 15px; }
.pin-card { text-align: center; padding: 19px 4px 0; }
.pin-card p { font-size: 12px; color: var(--muted); }
.pin-card h2 { margin-bottom: 4px; }
.pin { display: flex; justify-content: center; gap: 7px; }
.pin span { display: grid; place-items: center; width: 37px; height: 44px; border: 1px solid var(--border); border-radius: 6px; background: var(--tint); font-size: 23px; font-weight: 700; }
.pin-card .pin-note { margin: 17px 0 0; font-size: 11px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); padding: 13px 0 7px; list-style: none; }
.steps li { position: relative; text-align: center; color: var(--muted); font-size: 12px; }
.step-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 18px; height: 18px; margin: 0 auto 7px; border: 1.5px solid var(--border); border-radius: 50%; background: white; }
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 8px; left: calc(50% + 12px); width: calc(100% - 24px); height: 1.5px; background: var(--border); }
.steps li[aria-current] { font-weight: 700; color: var(--text); }
.steps li[aria-current] .step-dot, .steps li:has(~ [aria-current]) .step-dot { border-color: var(--blue); background: var(--blue); color: white; }
.info { padding-top: 5px; padding-bottom: 10px; }
.info > div { min-height: 29px; padding: 5px 0; }
.info > div + div { border-top: 1px solid #e9edf1; }
.info dt { flex: none; color: var(--muted); font-size: 12px; }
.active-primary { min-height: 47px; margin-top: 15px; }
.active-add { min-height: 46px; margin-top: 11px; }
.secondary:disabled { border-color: var(--border); color: var(--muted); }
.collection-note { text-align: center; font-size: 12px; color: var(--muted); }
.session-total { margin-top: 12px; text-align: right; font-size: 13px; }
.admin-list > .card { margin-top: 9px; padding: 10px 11px; }
.admin-list h3 { font-size: 15px; }
.admin-list .info { padding-inline: 0; }

dialog { width: min(calc(100% - 32px), 390px); max-height: calc(100% - 32px); padding: 16px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--page); }
dialog::backdrop { background: rgb(18 57 91 / 35%); }
dialog h2 { margin-bottom: 12px; }
dialog form > label, dialog > .secondary { margin-bottom: 8px; }
dialog .primary { margin-top: 10px; }
dialog .text-button { display: block; margin: 8px auto 0; }
#toast:not(:empty) {
  position: fixed;
  z-index: 2;
  bottom: max(105px, calc(env(safe-area-inset-bottom) + 80px));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--navy);
  color: white;
  font-size: 13px;
}

.pass-banner { margin-top: 10px; padding: 8px 11px; color: var(--navy); font-size: 13px; font-weight: 700; }
.auth-info { padding: 9px 11px; margin-bottom: 16px; background: #f9f7ee; }
.auth-info p, .auth-note { color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-info p { margin-top: 3px; }
#auth-form label { display: block; margin: 0 6px 2px; color: var(--muted); font-size: 13px; }
.auth-send { margin: 13px 0 18px; }
.auth-note { margin: 15px 6px 0; }
.auth-note[role=status] { margin: -10px 6px 14px; }
.code-field { position: relative; margin: 0 6px; }
.code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-boxes span {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 22px;
  font-weight: 700;
}
.code-field input[name=code] { position: absolute; inset: 0; height: 100%; opacity: 0; cursor: text; }
.code-field:focus-within .current, .code-field:focus-within .code-boxes:not(:has(.current)) span:last-child {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
