:root {
  color-scheme: light;
  --background: #f4f3ef;
  --surface: #faf9f6;
  --surface-strong: #ecebe6;
  --text: #171717;
  --muted: #6d6b66;
  --border: #cac8c1;
  --signal: #ff705f;
  --success: #167253;
  --success-bg: #e5f1eb;
  --warning: #8a4b10;
  --warning-bg: #fff5e6;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--background); }

body {
  min-height: 100dvh;
  margin: 0;
  background: var(--background);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.site-header { border-bottom: 1px solid rgba(23, 23, 23, 0.16); }

.header-inner {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark { width: 154px; height: auto; display: block; }
.client-mark, .eyebrow, .branch-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-shell { width: min(100%, 680px); margin: 0 auto; padding: 28px 20px 48px; }
.intro { margin-bottom: 22px; }
.intro h1 { margin: 8px 0 0; font-size: clamp(29px, 8vw, 38px); line-height: 1.03; letter-spacing: -0.045em; }
.intro > p:last-child { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }

.form-shell, .access-error { border: 1px solid rgba(23, 23, 23, 0.22); background: var(--surface); padding: 20px; }
#checkin-form { display: grid; gap: 24px; }
.field-block { min-width: 0; }
.field-block > label, .label-row label, fieldset legend {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}
.field-block > label > span, .label-row label > span, fieldset legend > span {
  min-width: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.label-row { display: flex; align-items: center; justify-content: space-between; }

input:not([type="file"]) {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(23, 23, 23, 0.3);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  font-size: 16px;
  outline: none;
}
input:not([type="file"]):focus { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
#branch-number { text-align: center; font-size: 19px; font-weight: 700; letter-spacing: 0.12em; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) 94px; gap: 8px; }
.helper { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; }

.button {
  min-height: 48px;
  border: 1px solid var(--text);
  border-radius: 0;
  padding: 0 16px;
  font-weight: 700;
  transition: transform 140ms ease, background-color 140ms ease, color 140ms ease;
}
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary, .button-square { background: var(--text); color: #fff; }
.button-primary:hover, .button-square:hover { background: #2b2b2b; }
.button-primary:disabled { border-color: #94938f; background: #94938f; color: #fff; }
.button-secondary { width: 100%; background: transparent; color: var(--text); }
.button-secondary:hover { background: var(--surface-strong); }
.text-button { border: 0; background: transparent; color: var(--text); text-decoration: underline; text-underline-offset: 3px; padding: 10px 0; }
.text-button.compact { padding: 0; color: var(--muted); font-size: 12px; }

.saved-value, .confirmed-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-left: 2px solid var(--success);
  background: var(--success-bg);
  color: var(--success);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 700;
}

.inline-error { margin-top: 10px; border-left: 2px solid var(--warning); background: var(--warning-bg); color: var(--warning); padding: 11px 12px; font-size: 14px; font-weight: 700; line-height: 1.4; }

.branch-card { border: 1px solid rgba(23, 23, 23, 0.2); background: var(--surface-strong); padding: 16px; }
.branch-card h2 { margin: 6px 0 0; font-size: 18px; letter-spacing: -0.02em; }
.branch-card > p:not(.branch-kicker):not(.confirmed-line) { margin: 7px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.branch-card .button { width: 100%; margin-top: 16px; }
.branch-card .confirmed-line { margin: 14px 0 0; }

fieldset { padding: 0; border: 0; margin: 0; }
.display-list { display: grid; gap: 8px; }
.display-option {
  width: 100%;
  min-height: 68px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(23, 23, 23, 0.22);
  border-radius: 0;
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}
.display-option:hover { border-color: var(--text); }
.display-option:disabled { cursor: default; background: var(--surface-strong); color: var(--muted); }
.display-option:disabled .display-status { color: var(--success); }
.display-option[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: #fff; }
.display-title { display: block; font-size: 15px; font-weight: 700; }
.display-id { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.display-option[aria-pressed="true"] .display-id { color: rgba(255,255,255,.66); }
.display-status { color: var(--success); font-size: 11px; font-weight: 700; }
.display-option[aria-pressed="true"] .display-status { color: var(--signal); }

.photo-picker {
  position: relative;
  min-height: 164px;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(23, 23, 23, 0.48);
  background: var(--surface-strong);
  cursor: pointer;
}
.photo-placeholder { display: grid; justify-items: center; gap: 5px; color: var(--text); }
.photo-placeholder small { color: var(--muted); font-weight: 400; }
.camera-shape { width: 30px; height: 22px; border: 2px solid currentColor; position: relative; margin-bottom: 6px; }
.camera-shape::before { content: ""; position: absolute; width: 10px; height: 5px; border: 2px solid currentColor; border-bottom: 0; left: 8px; top: -7px; }
.camera-shape::after { content: ""; position: absolute; width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; left: 9px; top: 5px; }
#photo-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-change { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 6px 11px; font-size: 11px; font-weight: 700; }
.submit-button { width: 100%; margin-top: 14px; }

.confirmation-list {
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid rgba(23, 23, 23, 0.2);
  background: var(--surface-strong);
}
.confirmation-list legend {
  float: left;
  width: 100%;
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}
.confirmation-list label {
  clear: both;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.confirmation-check {
  appearance: none;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  margin: 0;
  border: 1px solid var(--text);
  background: #fff;
}
.confirmation-check:checked { background: var(--success); border-color: var(--success); }
.confirmation-check:checked::after { content: "✓"; display: block; color: #fff; text-align: center; font-size: 13px; line-height: 17px; font-weight: 700; }
.confirmation-check:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.success-view { text-align: center; padding: 6px 0; }
.success-check { width: 50px; height: 50px; display: grid; place-items: center; margin: 0 auto; border-radius: 50%; background: var(--success-bg); color: var(--success); font-size: 26px; font-weight: 700; }
.success-view h2 { margin: 16px 0 0; font-size: 22px; letter-spacing: -0.03em; }
.muted { color: var(--muted); }
.status-note { margin: 18px 0; border-left: 2px solid var(--success); background: var(--surface-strong); padding: 14px; text-align: left; }
.status-note strong, .status-note span { display: block; }
.status-note strong { color: var(--success); font-size: 14px; }
.status-note span { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.success-view > .text-button { margin-top: 6px; }
.access-error h2 { margin: 0; font-size: 21px; }
.access-error p { margin: 8px 0 0; color: var(--muted); line-height: 1.45; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

@media (min-width: 640px) {
  .header-inner { padding: 17px 32px; }
  .page-shell { padding: 38px 32px 64px; }
  .form-shell, .access-error { padding: 28px; }
  .display-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
