:root {
  --bg: #f5f6f4;
  --surface: #ffffff;
  --surface-2: #eef0ec;
  --text: #1c2321;
  --muted: #5d6763;
  --border: #d9ddd8;
  --accent: #0f6e5c;
  --accent-ink: #ffffff;
  --accent-soft: #e1f0ec;
  --danger: #b3261e;
  --danger-soft: #fbe9e7;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.05);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; letter-spacing: -0.01em; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; font: inherit; font-weight: 600;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px;
  padding: .6em 1.1em; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--danger); }
.btn.small { padding: .35em .75em; font-size: .9em; }
.btn.big { font-size: 1.25rem; padding: .9em 1.6em; border-radius: 14px; }
label { display: block; font-weight: 600; font-size: .92em; margin-bottom: .3em; }
.field { margin-bottom: 1rem; }
input, select, textarea { width: 100%; font: inherit; padding: .65em .8em; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 160px; resize: vertical; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: .7em 1em; margin-bottom: 1rem; font-weight: 500; }
.pill { display: inline-block; font-size: .8em; font-weight: 600; padding: .15em .6em; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.pill.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- landing ---------- */
.landing { max-width: 720px; margin: 0 auto; padding: 48px 16px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: 1.1rem; margin-bottom: 2rem; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 800; }
.loc-list { display: grid; gap: .75rem; margin: 1.25rem 0 2rem; }
.loc-list a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }
.loc-list a:hover { border-color: var(--accent); }

/* ---------- kiosk ---------- */
.kiosk { min-height: 100vh; display: flex; flex-direction: column; }
.kiosk header { display: flex; justify-content: space-between; align-items: center; padding: 18px 28px; }
.kiosk main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px 16px 48px; }
.kiosk .panel { width: 100%; max-width: 760px; }
.kiosk h1 { font-size: clamp(2rem, 4vw, 3rem); }
.kiosk .lead { font-size: 1.2rem; color: var(--muted); margin-bottom: 2rem; }
.kiosk input, .kiosk select { font-size: 1.15rem; padding: .8em .9em; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.choice { border: 1px solid var(--border); background: var(--surface); border-radius: 18px; padding: 2rem 1.5rem; text-align: left; cursor: pointer;
  font: inherit; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .1s; }
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(.99); }
.choice strong { display: block; font-size: 1.5rem; margin-bottom: .3rem; }
.choice.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice.primary span { color: rgba(255,255,255,.85); }
@media (max-width: 640px) { .choice-grid { grid-template-columns: 1fr; } }
.steps { display: flex; gap: .4rem; margin-bottom: 1.5rem; }
.steps span { height: 5px; flex: 1; border-radius: 3px; background: var(--border); }
.steps span.done { background: var(--accent); }
.actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.camera { position: relative; width: 100%; max-width: 480px; aspect-ratio: 4/3; margin: 0 auto 1rem; border-radius: 16px; overflow: hidden; background: #111; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera video { transform: scaleX(-1); }
.id-camera video { transform: none; }   /* ID preview is not mirrored so the text reads normally */
.id-frame { position: absolute; left: 10%; width: 80%; aspect-ratio: 1.586; top: 50%; transform: translateY(-50%);
  border: 3px dashed rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); pointer-events: none; }
.camera .no-cam { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; text-align: center; padding: 1rem; }
.agreement-text { max-height: 260px; overflow: auto; white-space: pre-wrap; background: var(--surface-2); border-radius: 10px; padding: 1rem; font-size: .98rem; margin-bottom: 1rem; }
.sigpad-wrap { position: relative; }
.sigpad { width: 100%; height: 180px; border: 2px dashed var(--border); border-radius: 12px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sigpad-wrap .hint { position: absolute; left: 1rem; bottom: .6rem; color: var(--muted); font-size: .85em; pointer-events: none; }
.sigpad-wrap .clear { position: absolute; right: .5rem; top: .5rem; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.type-grid .choice.checkout { background: var(--surface-2); }
.intro-text { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; font-size: 1.1rem; margin-bottom: 1rem; }
.option-list { display: grid; gap: .6rem; }
.option-btn { display: flex; align-items: center; gap: .8rem; width: 100%; text-align: left; font: inherit; font-size: 1.15rem; padding: 1rem 1.2rem;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); cursor: pointer; }
.option-btn:hover { border-color: var(--accent); }
.option-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.option-btn .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); flex: none; display: grid; place-items: center; }
.option-btn.multi .tick { border-radius: 6px; }
.option-btn[aria-pressed="true"] .tick { background: var(--accent); border-color: var(--accent); }
.option-btn[aria-pressed="true"] .tick::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.option-btn .sub { color: var(--muted); font-size: .85em; font-weight: 400; }
.host-list { max-height: 46vh; overflow: auto; padding: 2px; }
.review-card { display: flex; gap: 1.25rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.25rem; }
.review-card img { width: 110px; height: 110px; object-fit: cover; border-radius: 12px; }
.review-card dl.kv { font-size: 1.05rem; }
@media (max-width: 640px) { .review-card { flex-direction: column; } }
.done-badge { display: flex; gap: 1.25rem; align-items: center; background: var(--accent-soft); padding: 1.25rem; border-radius: 14px; margin: 1.5rem 0; }
.done-badge img { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; font-weight: 700; }

/* ---------- admin ---------- */
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.admin-top .brand { margin: 0; }
.admin-top > :last-child { margin-left: auto; }
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs button { font: inherit; border: 0; background: transparent; padding: .5em .9em; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.active { background: var(--accent-soft); color: var(--accent); }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
.toolbar { display: flex; gap: .75rem; align-items: end; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar .field { margin: 0; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { padding: 1.1rem 1.25rem; }
.stat .n { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
td .thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; vertical-align: middle; background: var(--surface-2); }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); }
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 720px; width: calc(100% - 32px); box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--text); background: var(--surface); }
dialog::backdrop { background: rgba(20,25,23,.45); }
dialog .dlg-body { padding: 1.5rem; max-height: 80vh; overflow: auto; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: 1rem 1.5rem; border-top: 1px solid var(--border); }
.visit-head { display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1rem; }
.visit-head img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
.sig-block { border: 1px solid var(--border); border-radius: 10px; padding: 1rem; margin-top: 1rem; }
.sig-block img { max-width: 100%; height: 90px; background: #fff; border-radius: 6px; border: 1px solid var(--border); }
.login { max-width: 380px; margin: 12vh auto; padding: 0 16px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
.user-menu { position: relative; }
.user-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: .5rem; display: grid; gap: .35rem; min-width: 200px; z-index: 20; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem 1rem; padding: .6rem .8rem;
  border: 1px solid var(--border); border-radius: 10px; }
.check-list label { font-weight: 500; margin: 0; }
/* ----- guest types ----- */
.gt-cards { display: grid; gap: .75rem; }
.gt-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; box-shadow: var(--shadow); }
.gt-card .gt-main { flex: 1; min-width: 0; cursor: pointer; }
.gt-card .gt-main strong { font-size: 1.1rem; }
.gt-card .order { display: flex; flex-direction: column; gap: 2px; }
.gt-card .order button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; width: 28px; height: 22px; cursor: pointer; line-height: 1; color: var(--muted); }
.gt-card .order button:disabled { opacity: .35; cursor: default; }
.gt-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.round-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--text); flex: none; }
.gt-edit { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .gt-edit { grid-template-columns: 1fr; } }
.gt-steps-card { background: var(--surface-2); border-radius: 18px; padding: 1.1rem; }
.gt-steps-head { display: flex; justify-content: space-between; align-items: center; margin: .2rem .25rem 1rem; }
.pill-btn { border-radius: 999px; padding: .5em 1.1em; }
.pill-btn span { font-size: 1.2em; line-height: 1; }
.add-step-wrap { position: relative; }
.add-step-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14); padding: .4rem; width: 290px; z-index: 30; }
.add-step-menu button { display: flex; gap: .7rem; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: .55rem .6rem; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.add-step-menu button:hover:not(:disabled) { background: var(--surface-2); }
.add-step-menu button:disabled { opacity: .4; cursor: default; }
.add-step-menu small { display: block; color: var(--muted); font-size: .8em; }
.step-row { display: flex; align-items: center; gap: .9rem; background: var(--surface); border-radius: 12px; padding: .85rem 1rem; margin-bottom: .6rem; cursor: pointer; border: 1px solid transparent; }
.step-row:hover { border-color: var(--border); }
.step-row .ico { width: 30px; height: 30px; flex: none; color: var(--text); display: grid; place-items: center; }
.step-row .txt { flex: 1; min-width: 0; }
.step-row .txt strong { display: block; font-weight: 600; }
.step-row .txt span { display: block; color: var(--muted); font-size: .88em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step-row .acts { display: flex; gap: .2rem; align-items: center; color: var(--muted); }
.step-row .acts button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: .3rem; border-radius: 6px; font-size: 1rem; line-height: 1; }
.step-row .acts button:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.step-row .acts button:disabled { opacity: .3; cursor: default; }
.step-row .pin { color: var(--muted); display: grid; place-items: center; }
.gt-side { display: grid; gap: 1rem; }
.gt-preview { background: var(--surface-2); border-radius: 18px; padding: 1.5rem; display: grid; place-items: center; }
.mini-badge { width: 240px; min-height: 150px; background: #fff; border-radius: 10px; box-shadow: 0 2px 10px rgba(0,0,0,.08); padding: .7rem .8rem; position: relative; color: #111; }
.mini-badge .lbl { display: inline-block; background: #111; color: #fff; font-size: .62rem; font-weight: 700; padding: .12rem .5rem; border-radius: 99px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-badge .face { position: absolute; right: .7rem; top: .6rem; width: 50px; height: 50px; border-radius: 50%; background: #d9ddd8; display: grid; place-items: center; color: #777; font-weight: 700; }
.mini-badge .nm { font-weight: 800; font-size: 1.1rem; line-height: 1.1; margin-top: .55rem; max-width: 150px; }
.mini-badge .co { font-size: .72rem; color: #444; margin-top: .15rem; }
.mini-badge .ln { font-size: .6rem; margin-top: .25rem; }
.mini-badge .ln b { font-weight: 700; }
.mini-badge .dt { position: absolute; right: .8rem; bottom: .6rem; font-size: .6rem; font-weight: 700; text-align: center; line-height: 1.1; }
.set-list { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--border); font-weight: 600; margin: 0; }
.set-row:last-child { border-bottom: 0; }
.set-row > span small { display: block; font-weight: 400; color: var(--muted); font-size: .82em; }
.set-row input:not([type=checkbox]):not([type=radio]) { width: 58%; text-align: right; border-color: transparent; background: transparent; padding: .4em .5em; }
.set-row input:not([type=checkbox]):not([type=radio]):focus { text-align: left; border-color: var(--accent); background: var(--surface); }
.set-row.column { flex-direction: column; align-items: stretch; gap: .5rem; }
.set-row.column textarea { min-height: 80px; font-weight: 400; }
.set-row .check { font-weight: 500; }
input.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: #c9ceca; position: relative; cursor: pointer; flex: none; border: 0; padding: 0; transition: background .15s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(20px); }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gt-foot { display: flex; gap: .6rem; align-items: center; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--bg); padding-bottom: 1rem; }
.answers dt { max-width: 220px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: .7em 1.2em; border-radius: 10px; font-weight: 500; z-index: 50; }
