:root {
  --teal: #116077;
  --navy: #123b4b;
  --card: #f8efe2;
  --field: #fff7ed;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(#f7e5d2, #cee5e8) fixed;
  color: #1c1b1f;
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}
.hero {
  position: relative;
  background: linear-gradient(rgba(17,47,67,.15), rgba(17,47,67,.2), rgba(16,46,61,.65)),
    url("img/guest-tour-header.jpg") center 40% / cover;
  border-radius: 0 0 28px 28px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 16px;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.icon-btn {
  position: absolute; top: calc(env(safe-area-inset-top) + 8px); right: 16px;
  width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(18,59,75,.72); color: #fff; font-size: 22px;
}
.title-box { background: var(--navy); color: #fff; border-radius: 16px; padding: 8px 12px; }
.title-box h1 { margin: 0; font-size: 24px; }
.title-box p { margin: 4px 0 0; }
.pills { display: flex; gap: 8px; margin-top: 16px; }
.pill {
  flex: 1; border: 0; border-radius: 20px; padding: 10px 0; color: #fff;
  background: rgba(18,59,75,.72); font-size: 13px;
}
.pill.active { background: var(--teal); font-weight: 700; }
.pill.done { background: rgba(75,184,173,.78); }
main { padding: 20px; max-width: 640px; margin: 0 auto; }
.card {
  background: var(--card); border-radius: 24px; padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.card[hidden] { display: none; }
label { display: block; margin-top: 14px; font-size: 13px; color: #49454f; }
input, select {
  display: block; width: 100%; margin-top: 4px; padding: 14px 16px;
  font: inherit; font-size: 16px; color: #1c1b1f;
  background: var(--field); border: 0; border-radius: 16px; min-height: 52px;
}
input:focus, select:focus { outline: 2px solid var(--teal); }
.row { display: flex; gap: 12px; align-items: flex-end; }
.row > * { flex: 1; }
.with-suffix, .prefixed { position: relative; display: block; }
.suffix { position: absolute; right: 44px; top: 50%; transform: translateY(-35%); color: #49454f; pointer-events: none; }
.prefixed > span { position: absolute; left: 16px; top: 50%; transform: translateY(-35%); }
.prefixed input { padding-left: 32px; }
.note { font-size: 13px; color: #6b6b6b; margin: 8px 0; }
.note.center { text-align: center; }
.note.good { color: #2e7d32; }
.note.bad { color: #c62828; }
.btn {
  font: inherit; font-weight: 600; border-radius: 16px; padding: 14px 24px;
  border: 1px solid transparent; cursor: pointer; text-align: center;
}
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:disabled { background: #c9d3d6; color: #777; }
.btn.outline { background: transparent; border-color: #79747e; color: var(--teal); }
.btn.text { background: transparent; color: var(--teal); padding: 10px 12px; }
.btn.block { display: block; width: 100%; margin-top: 10px; }
.btn.grow { flex: 2; }
.card > .btn.block:first-child { margin-top: 0; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(206,229,232,0), #cee5e8 40%);
}
.nav .btn { flex: 1; }
.nav .btn.grow { flex: 2; }
.nav .btn[hidden] { display: none; }
.signature { margin-top: 18px; }
#sigCanvas {
  width: 100%; height: 140px; display: block; margin-top: 8px; border-radius: 12px;
  background: #f2e5c9; touch-action: none;
}
.sig-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sig-status { font-size: 12px; text-align: right; }
.sig-status.bad { color: #c62828; }
.sig-status.good { color: #2e7d32; }
.excel-btn { margin-top: 16px; }
.excel-msg { font-size: 13px; text-align: center; margin: 8px 0 0; }
.excel-msg.error { color: #b3261e; }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%); background: #322f35; color: #fff;
  padding: 12px 20px; border-radius: 12px; max-width: 90vw; z-index: 1000;
}
.toast[hidden] { display: none; }
dialog {
  border: 0; border-radius: 28px; padding: 0; background: #fff7ed;
  width: min(92vw, 520px); max-height: 88vh;
}
dialog::backdrop { background: rgba(0,0,0,.5); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin: 0 0 12px; }
.dialog-body h3 { margin: 18px 0 8px; font-size: 16px; }
.check {
  width: 80px; height: 80px; border-radius: 50%; background: #00a6a6; color: #fff;
  font-size: 48px; line-height: 80px; text-align: center; margin: 0 auto 12px;
}
pre { white-space: pre-wrap; font: inherit; margin: 8px 0; }
#recipientList { list-style: none; padding: 0; margin: 0 0 8px; }
#recipientList li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
#recipientList button { border: 0; background: none; font-size: 18px; color: #b3261e; }
#scanVideo { width: 100%; max-height: 50vh; background: #000; border-radius: 12px; object-fit: cover; }
.file-btn { cursor: pointer; }
