:root {
  --navy: #071F60;
  --navy-2: #0d2b7a;
  --gold: #FFC300;
  --sky: #6EC5EF;
  --bg: #f3f5fa;
  --card: #ffffff;
  --ink: #12172b;
  --muted: #5a6382;
  --line: #d7dcea;
  --ok: #1f9d55;
  --warn: #d97706;
  --bad: #c62828;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Open Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
  padding-bottom: env(safe-area-inset-bottom);
}
h2 { font-family: "Tilt Warp", system-ui, sans-serif; font-weight: 400; font-size: 1.15rem; margin: 0 0 6px; color: var(--navy); }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { border-radius: 8px; flex-shrink: 0; }
.brand > div { min-width: 0; }
.brand-name { font-family: "Tilt Warp", system-ui, sans-serif; font-size: 1.2rem; color: var(--gold); line-height: 1.1; }
.brand-show { font-size: .78rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 7px 12px; font: inherit; font-size: .8rem; cursor: pointer;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.dot.ok { background: #3ddc84; }
.dot.warn { background: var(--gold); }
.dot.bad { background: #ff6b6b; }

main { max-width: 640px; margin: 0 auto; padding: 14px 16px 40px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px 16px; margin-bottom: 12px;
}
label { display: block; font-weight: 600; font-size: .88rem; color: var(--muted); margin: 12px 0 5px; }
.card > label:first-child, .card h2 + label { margin-top: 4px; }
input[type=text], input[type=tel], input[type=email], input[type=date], input[type=password], select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink);
  background: #fbfcff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 12px 12px; min-height: 48px; appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.4; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(110,197,239,.35); }
.invalid { border-color: var(--bad) !important; }
.hint { font-size: .8rem; color: var(--muted); margin: 6px 0 0; }
.hint.invalid-text { color: var(--bad); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: inherit; font-size: .9rem; padding: 10px 14px; min-height: 44px;
  border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
}
.chips button[aria-checked=true] { background: var(--navy); border-color: var(--navy); color: var(--gold); }
#whenDate, #whenNote { margin-top: 10px; }

.consent .tick { display: flex; gap: 12px; align-items: flex-start; margin: 0; color: var(--ink); font-weight: 400; font-size: .95rem; line-height: 1.4; }
.tick input { width: 26px; height: 26px; flex-shrink: 0; margin: 1px 0 0; accent-color: var(--navy); }
.tick a { color: var(--navy-2); }

.error { color: var(--bad); font-size: .9rem; min-height: 1.2em; margin: 4px 2px 10px; }
.save {
  width: 100%; min-height: 58px; border: 0; border-radius: var(--radius);
  background: var(--gold); color: var(--navy); font-family: "Tilt Warp", system-ui, sans-serif; font-size: 1.25rem;
  cursor: pointer; box-shadow: 0 3px 0 #c99a00;
}
.save:active { transform: translateY(2px); box-shadow: 0 1px 0 #c99a00; }
.save:disabled { opacity: .6; }

.hidden { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--navy); color: #fff; padding: 14px 18px; border-radius: 12px; max-width: calc(100% - 32px);
  font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; border-left: 5px solid var(--gold);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(7,31,96,.55); }
.menu { padding: 18px; }
.menu p { margin: 6px 0 14px; color: var(--muted); }
.menu button {
  font: inherit; min-height: 48px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; color: var(--navy); padding: 10px 14px; cursor: pointer;
}
.menu .primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.menu .danger { color: var(--bad); border-color: #f1c4c4; }
.menu-actions { display: flex; gap: 8px; margin-top: 12px; }
.menu-actions button { flex: 1; }
.menu-col { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Staff area ---------- */
.staff { position: fixed; inset: 0; z-index: 20; background: var(--bg); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.center { text-align: center; }
.tabs { display: flex; gap: 6px; margin: 18px 0 10px; }
.tabs button {
  flex: 1; font: inherit; font-size: .9rem; min-height: 42px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer;
}
.tabs button[aria-selected=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.list { list-style: none; margin: 0 0 14px; padding: 0; }
.list li {
  display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.list .who { flex: 1; min-width: 0; }
.list .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { font-size: .82rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: .72rem; font-weight: 600; padding: 4px 8px; border-radius: 999px; flex-shrink: 0; }
.badge.pending { background: #fff4cc; color: #7a5a00; }
.badge.uploaded { background: #dff5e7; color: #17663a; }
.badge.error { background: #fde2e2; color: var(--bad); }
.empty { text-align: center; color: var(--muted); padding: 20px 0; }
.tools summary { font-weight: 600; color: var(--navy); cursor: pointer; padding: 2px 0; }
.tools .menu-col { margin-top: 12px; }
.tools .menu-col button {
  font: inherit; min-height: 48px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; color: var(--navy); padding: 10px 14px; cursor: pointer; text-align: left;
}
.tools .danger { color: var(--bad); border-color: #f1c4c4; }
.detail { margin: 6px 0 14px; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: .92rem; }
.detail dt { color: var(--muted); font-weight: 600; }
.detail dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.progress { height: 14px; background: #e6e9f3; border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.progress span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .25s; }
.hidden { display: none !important; }

/* ---------- Shows ---------- */
.list.compact li { cursor: default; }
.badge.local { background: #e6f3fb; color: #1d5f86; }
.badge.current { background: var(--navy); color: var(--gold); }
#showSel { margin-bottom: 4px; }
#addShowBtn { min-height: 50px; font-size: 1.05rem; margin-top: 6px; }
#showDlg input { margin-bottom: 2px; }

/* v1.4.0 */
.update-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff; padding: 12px 14px; border-radius: var(--radius); box-shadow: 0 6px 24px rgba(7,31,96,.35);
}
.update-bar button { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 8px 16px; background: var(--gold); color: var(--navy); cursor: pointer; }
.sub.err { color: var(--bad); }

/* v1.5.0: phone owner and set-up */
.owner { margin: 0 0 8px; font-weight: 600; color: var(--navy); }
.owner.warn { color: var(--warn); }
.linkish {
  display: inline-block; font: inherit; font-size: .88rem; color: var(--navy-2); text-decoration: underline;
  background: none; border: 0; padding: 8px 0 0; cursor: pointer;
}
#enrolCode { letter-spacing: .3em; font-size: 1.3rem; }
#enrolBtn { min-height: 50px; font-size: 1.05rem; }
