:root {
  --bg: #070808;
  --panel: #141515;
  --panel-soft: #1c1d1e;
  --text: #f7f7f5;
  --muted: #a8aaa8;
  --accent: #f15a24;
  --accent-hot: #ff6a2d;
  --accent-dark: #9e3517;
  --danger: #ff7267;
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.55);
  --radius: 22px;
  --line: #343536;
  --font: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at 50% 34%, #191b1a 0, #0a0b0b 42%, #050606 74%);
  padding: env(safe-area-inset-top) 18px env(safe-area-inset-bottom) 18px;
  overflow-x: hidden;
}

/* Paint full-screen journeys through the iOS Home-indicator safe area. */
@media (max-width: 1366px) {
  .app-shell:not(.screen-hidden),
  .completion-screen:not(.screen-hidden),
  .delivery-flow.is-open {
    bottom: calc(-1 * env(safe-area-inset-bottom)) !important;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -35%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
  transform: rotate(27deg);
  background: repeating-linear-gradient(90deg, transparent 0 155px, rgba(255, 255, 255, 0.035) 157px 210px, transparent 212px 360px);
}

body::after {
  opacity: 0.12;
  transform: rotate(-19deg) translateX(22%);
  background: repeating-linear-gradient(90deg, transparent 0 210px, rgba(241, 90, 36, 0.09) 212px 270px, transparent 272px 440px);
}

input,
textarea,
select,
button {
  font-family: inherit;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.018) 50%, transparent 50%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 50%, transparent 50%);
  background-size: 2px 2px;
  opacity: 0.45;
  z-index: 1;
}

.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top) + 30px) 34px calc(env(safe-area-inset-bottom) + 26px);
  background: radial-gradient(circle at 50% 43%, rgba(43, 46, 44, 0.42), transparent 31%), rgba(4, 5, 5, 0.4);
  transition: opacity 320ms ease, visibility 320ms ease;
}

.welcome-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.pemberton-mark {
  width: min(620px, 72vw);
  display: grid;
  justify-items: center;
  font-style: italic;
  line-height: 0.8;
  filter: drop-shadow(0 5px 16px rgba(0, 0, 0, 0.8));
}

.pemberton-mark strong {
  font-family: Impact, "Arial Narrow", sans-serif;
  font-size: clamp(38px, 6.2vw, 76px);
  font-weight: 900;
  letter-spacing: -4px;
  transform: scaleX(1.08);
}

.pemberton-mark strong span {
  color: var(--accent);
}

.pemberton-mark small {
  margin-top: 15px;
  font-size: clamp(16px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: 12px;
}

.pemberton-mark-compact {
  width: 220px;
  flex: 0 0 auto;
  justify-items: end;
}

.pemberton-mark-compact strong {
  font-size: 27px;
  letter-spacing: -2px;
}

.pemberton-mark-compact small {
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 7px;
}

.pemberton-logo {
  display: block;
  width: min(620px, 74vw);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.7));
}

.pemberton-logo-compact {
  width: 230px;
  flex: 0 0 auto;
}

.welcome-centre {
  display: grid;
  justify-items: center;
  align-content: center;
  width: min(600px, 90vw);
}

.welcome-centre > .pemberton-logo {
  margin-bottom: 42px;
}

.welcome-kicker {
  margin: 0 0 24px;
  color: #c9cac8;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 8px;
}

.dirtyboots-brand {
  display: grid;
  justify-items: center;
  margin-bottom: 40px;
}

.db-icon {
  position: relative;
  width: 126px;
  height: 126px;
  overflow: hidden;
  border: 1px solid #2b2c2c;
  border-radius: 28px;
  background: linear-gradient(145deg, #292a29, #1b1c1b);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.55), 0 0 48px rgba(241, 90, 36, 0.08);
}

.db-icon i,
.db-icon b {
  position: absolute;
  display: block;
  background: var(--accent);
  transform: skewX(-20deg);
}

.db-icon i {
  width: 27px;
  height: 102px;
  left: 47px;
  top: 12px;
}

.db-icon b {
  width: 60px;
  height: 22px;
  left: 43px;
  bottom: 14px;
}

.db-icon b::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 0;
  width: 47px;
  height: 51px;
  border: 20px solid var(--accent);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 50px 0 0;
  transform: skewX(20deg);
}

.db-name {
  margin-top: 22px;
  font-size: clamp(42px, 6vw, 66px);
  font-weight: 800;
  letter-spacing: -3px;
}

.db-subtitle {
  margin-top: 7px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 9px;
  color: #d3d4d1;
}

.welcome-centre h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 58px);
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 300;
  letter-spacing: 2px;
}

.sketch-arrow {
  width: 130px;
  height: 138px;
  margin: 18px 0 2px;
  overflow: visible;
}

.sketch-arrow path {
  fill: none;
  stroke: #f8f8f5;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.start-btn {
  width: min(480px, 78vw);
  min-height: 72px;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  background: linear-gradient(180deg, var(--accent-hot), var(--accent));
  box-shadow: 0 16px 38px rgba(241, 90, 36, 0.24), inset 0 1px rgba(255, 255, 255, 0.16);
  font-size: 25px;
  font-family: "Segoe UI", "Helvetica Neue", Helvetica, sans-serif;
  font-weight: 500;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.start-btn:active {
  transform: scale(0.98);
  border-color: var(--accent);
  background: #292321;
}

.corner-settings {
  position: absolute;
  right: 28px;
  top: calc(env(safe-area-inset-top) + 22px);
  color: #7e807e;
  border: 0;
  background: transparent;
  font-size: 13px;
  letter-spacing: 1px;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 1040px;
  margin: 18px auto 30px;
  display: grid;
  gap: 18px;
  transition: opacity 340ms ease, transform 340ms ease;
}

.screen-hidden {
  position: fixed;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.menu-screen {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100vw - 44px));
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 36px);
  margin: 0 auto;
  padding: 10px 0 42px;
  transition: opacity 300ms ease, transform 300ms ease;
}

.menu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 130px;
}

.menu-logo {
  display: block;
  width: min(520px, 54vw);
  height: auto;
}

.menu-tools {
  display: flex;
  align-items: center;
  gap: 18px;
}

.menu-tool {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  color: #f4f4f2;
  border: 1px solid #38393a;
  border-radius: 50%;
  background: #1b1c1e;
}

.menu-tool svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.menu-close {
  border: 0;
  background: transparent;
  font-size: 48px;
  font-weight: 200;
}

.menu-list {
  display: grid;
  gap: 28px;
  margin-top: 32px;
}

.menu-card {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  align-items: center;
  gap: 24px;
  width: 100%;
  min-height: 145px;
  padding: 26px 38px;
  color: #f7f7f5;
  border: 1px solid #2d2e30;
  border-radius: 12px;
  background: linear-gradient(150deg, #26272a, #202124);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  text-align: left;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 300;
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}

.menu-card:active {
  transform: scale(0.992);
  border-color: #535456;
  background: #2a2b2e;
}

.menu-chevron {
  font-size: 68px;
  font-weight: 200;
  line-height: 1;
}

.menu-icon {
  position: relative;
  display: block;
  width: 52px;
  height: 52px;
}

.check-icon::before,
.check-icon::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 45px;
  top: 1px;
  border-radius: 12px;
  transform: rotate(-45deg);
  transform-origin: bottom;
}

.check-icon::before {
  left: 10px;
  height: 30px;
  background: #5bd6c5;
}

.check-icon::after {
  left: 27px;
  background: #67d63f;
}

.exit-icon {
  border: 4px solid #ec3f4b;
  border-right: 0;
  border-radius: 7px 0 0 7px;
}

.exit-icon::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 21px;
  width: 40px;
  height: 4px;
  background: #ec3f4b;
}

.exit-icon::after {
  content: "";
  position: absolute;
  right: -4px;
  top: 12px;
  width: 18px;
  height: 18px;
  border-top: 4px solid #ec3f4b;
  border-right: 4px solid #ec3f4b;
  transform: rotate(45deg);
}

.delivery-icon {
  top: 7px;
  height: 39px;
  border: 4px solid #58c523;
  border-radius: 7px;
}

.delivery-icon::before {
  content: "";
  position: absolute;
  left: 8px;
  top: -13px;
  width: 27px;
  height: 14px;
  border: 4px solid #58c523;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(135deg, rgba(31, 32, 32, 0.98), rgba(15, 16, 16, 0.98));
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  width: 5px;
  align-self: stretch;
  border-radius: 5px;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(241, 90, 36, 0.35);
}

.hero-brand,
.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero h1 {
  margin: 0 0 6px;
  font-size: 32px;
  letter-spacing: 0.5px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--accent-hot);
  font-weight: 800;
}

.subtitle {
  margin: 0;
  color: #d9e2eb;
}

.card {
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(155deg, rgba(27, 28, 28, 0.98), rgba(16, 17, 17, 0.98));
  box-shadow: var(--shadow);
}

.card h2 {
  margin-top: 0;
}

.stack {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.field-wide {
  grid-column: 1 / -1;
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
}

.section-heading .step-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  white-space: nowrap;
}

.wizard-progress {
  margin: 0 0 38px;
}

.wizard-progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.wizard-progress-copy span:first-child {
  color: #f3f3f1;
  font-weight: 600;
}

.wizard-track {
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: #303132;
}

.wizard-track span {
  display: block;
  width: 16.666%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 240ms ease;
}

.wizard-form {
  grid-template-columns: 1fr 1fr;
  align-content: start;
  min-height: 390px;
}

.wizard-step {
  grid-column: 1 / -1;
  animation: wizard-in 240ms ease both;
}

.wizard-step[data-step="2"] {
  grid-column: auto;
}

.wizard-step .field > span,
.wizard-form .field > span {
  margin-bottom: 7px;
  color: #f3f3f1;
  font-size: 18px;
}

.wizard-form input,
.wizard-form textarea {
  min-height: 64px;
  padding: 17px 18px;
  border-radius: 15px;
  font-size: 20px;
}

.wizard-form textarea {
  min-height: 150px;
}

.wizard-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: auto;
  padding-top: 28px;
}

.wizard-nav button,
.wizard-step.action-row button {
  min-height: 64px;
  font-size: 18px;
}

@keyframes wizard-in {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #3b4350;
  background: #0c0d0d;
  color: var(--text);
  border-radius: 12px;
  padding: 14px;
  font-size: 17px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(241, 90, 36, 0.14);
}

textarea {
  resize: vertical;
  min-height: 78px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check span {
  color: var(--text);
}

.check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 18px;
  height: 18px;
}

.recipient-checklist {
  border: 1px dashed #444544;
  border-radius: 12px;
  padding: 12px;
  min-height: 48px;
  display: grid;
  gap: 10px;
}

.recipient-check-item {
  background: #101111;
  border: 1px solid #343535;
  border-radius: 10px;
  padding: 8px 10px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, var(--accent-hot), var(--accent));
  box-shadow: 0 10px 24px rgba(241, 90, 36, 0.2);
}

.secondary-btn {
  color: #f0f4fb;
  background: linear-gradient(180deg, #343536, #262727);
}

.ghost-btn {
  color: #dedfdd;
  background: transparent;
  border: 1px solid #424343;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  background: #111825;
  border: 1px solid #38424c;
}

.small-btn {
  border: 1px solid #4a5560;
  background: #2a3640;
  color: #f4f7fb;
  padding: 10px 12px;
  border-radius: 10px;
}

.status {
  min-height: 20px;
  margin: 4px 0 0;
  font-size: 14px;
}

.success {
  color: #7bd26a;
}

.error {
  color: var(--danger);
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.card-muted {
  background: linear-gradient(180deg, #111212, #0d0e0e);
}

.recent-list {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.log-item {
  border: 1px solid #2e3741;
  border-radius: 12px;
  background: #0d0e0e;
  padding: 10px;
}

.log-item .meta {
  color: var(--muted);
  font-size: 12px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: grid;
  justify-items: center;
  align-items: center;
  padding: 12px;
  z-index: 9;
}

.panel {
  width: min(800px, 100%);
  max-height: calc(100vh - 24px);
  overflow: auto;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.panel-head h2 {
  margin-top: 0;
}

.recipient-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.recipient-toolbar h3 {
  margin: 0;
}

.recipients {
  display: grid;
  gap: 10px;
}

.recipient-row {
  border: 1px solid #313c47;
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 8px;
  background: #101111;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  body {
    padding: 8px 8px env(safe-area-inset-bottom) 8px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
  }

  .hero h1 {
    font-size: 29px;
  }

  .action-row {
    grid-template-columns: 1fr;
  }

  .stack {
    grid-template-columns: 1fr;
  }

  .wizard-step[data-step="2"] {
    grid-column: auto;
  }

  .wizard-nav {
    grid-template-columns: 1fr 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .pemberton-mark {
    width: min(480px, 78vw);
  }

  .pemberton-mark-compact {
    width: 190px;
  }

  .pemberton-logo-compact {
    width: 210px;
  }

  .menu-screen {
    width: calc(100vw - 20px);
  }

  .menu-header {
    min-height: 96px;
  }

  .menu-card {
    grid-template-columns: 48px 1fr auto;
    min-height: 108px;
    padding: 20px;
    font-size: 30px;
  }

  .menu-icon {
    transform: scale(0.75);
    transform-origin: left center;
  }
}

@media (max-width: 380px) {
  .hero h1 {
    font-size: 25px;
  }

  h2 {
    font-size: 22px;
  }
}

/* Full-screen iPad visitor journey */
.app-shell:not(.screen-hidden) { position: fixed; inset: 0; display: block; max-width: none; padding: 0; background: #16161a; z-index: 20; }
.app-shell > .hero, .app-shell > .card-muted, .app-shell .section-heading, .app-shell .wizard-progress { display: none; }
.app-shell > .card { min-height: 100vh; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.wizard-topbar { position: fixed; inset: 24px 30px auto; display: flex; justify-content: space-between; z-index: 25; }
.icon-button { width: 54px; height: 54px; padding: 0; border: 0; background: transparent; color: #f5f5f7; font: 300 48px/1 "Avenir Next", Avenir, sans-serif; }
.wizard-form { position: relative; min-height: 100vh; display: block; }
.wizard-form > .field.wizard-step { position: absolute; top: 42%; left: 20%; width: 60%; transform: translateY(-50%); }
.wizard-form .field > span { display: block; margin-bottom: 12px; color: #f5f5f7; font: 500 30px/1.2 "Avenir Next", Avenir, sans-serif; }
.wizard-form input { width: 100%; padding: 7px 0 10px; border: 0; border-bottom: 2px solid #f15a29; border-radius: 0; background: transparent; color: #fff; font: 400 30px/1.25 "Avenir Next", Avenir, sans-serif; outline: none; box-shadow: none; }
.wizard-form input:focus { border-bottom-color: #ff7040; }
.wizard-form .hint { color: #929298; }
.wizard-form .recipient-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 22px; }
.wizard-form .recipient-checklist label { padding: 18px 20px; border: 1px solid #34343b; border-radius: 12px; background: #242429; }
.wizard-nav, .app-shell .action-row { position: fixed; right: 34px; bottom: 34px; z-index: 24; }
.wizard-nav .primary-btn, .app-shell .action-row .primary-btn { min-width: 142px; background: #f15a29; border-color: #f15a29; }
.health-safety { position: absolute; inset: 28px 10% 90px; color: #f5f5f7; }
.health-safety h2 { margin: 0 0 18px; text-align: center; font: 500 29px/1.2 "Avenir Next", Avenir, sans-serif; }
.health-safety p { max-width: 1030px; margin: 0 auto 18px; font: 400 21px/1.35 "Avenir Next", Avenir, sans-serif; }
.health-safety .health-intro { text-transform: uppercase; }
.signature-wrap { position: relative; max-width: 900px; height: 190px; margin: 22px auto 0; border-bottom: 1px solid #53535b; }
.signature-placeholder { position: absolute; inset: 52px 0 auto; color: #4b4b52; text-align: center; font-size: 46px; pointer-events: none; }
#signatureCanvas { position: relative; width: 100%; height: 100%; touch-action: none; }
.signature-clear { position: absolute; right: 0; top: 66px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #33333a; color: #9a9aa1; font-size: 26px; }
.health-safety .signature-help { margin-top: 18px; font-size: 17px; font-weight: 600; }
.app-shell .status { position: fixed; left: 20%; right: 20%; bottom: 38px; margin: 0; color: #ff6b59; text-align: center; }
.completion-screen { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: #16161a; color: #f5f5f7; }
.completion-screen.screen-hidden { display: none; }
.completion-logo { position: absolute; top: 7%; width: min(52vw, 670px); height: auto; }
.completion-content { text-align: center; }
.completion-content > p { margin-top: 24px; color: #a0a0a7; font-size: 23px; }
.completion-content h2 { margin: 24px 0 0; font: 400 48px/1.2 "Avenir Next", Avenir, sans-serif; }
.completion-spinner { display: block; width: 34px; height: 34px; margin: 0 auto; border: 4px solid #34343a; border-top-color: #f15a29; border-radius: 50%; animation: completion-spin .8s linear infinite; }
.success-tick { display: grid; width: 70px; height: 70px; margin: 0 auto; place-items: center; border: 5px solid #f15a29; border-radius: 50%; color: #f15a29; font-size: 43px; }
@keyframes completion-spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .wizard-form > .field.wizard-step { left: 10%; width: 80%; }
  .wizard-form .recipient-checklist { grid-template-columns: 1fr; }
  .health-safety { inset-inline: 7%; overflow-y: auto; }
  .health-safety p { font-size: 17px; }
  .completion-content h2 { font-size: 38px; }
}

/* Refined menu icon system */
.menu-tool {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
}

.menu-tool svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-tool:active { background: rgba(255, 255, 255, 0.1); transform: scale(0.96); }

.menu-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(115deg, rgba(42, 42, 47, 0.98), rgba(31, 31, 35, 0.98));
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18), inset 0 1px rgba(255, 255, 255, 0.035);
}

.menu-card:active { transform: scale(0.992); background: #2c2c31; }

.menu-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(241, 90, 41, 0.34);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(241, 90, 41, 0.15), rgba(241, 90, 41, 0.045));
  color: #f15a29;
  transform: none;
}

.menu-icon::before, .menu-icon::after { content: none; }

.menu-icon svg {
  width: 39px;
  height: 39px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-card-out .menu-icon {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.045);
  color: #f5f5f7;
}

.menu-card-delivery .menu-icon {
  border-color: rgba(241, 90, 41, 0.28);
  background: rgba(241, 90, 41, 0.08);
  color: #ff7040;
}

.menu-chevron { color: rgba(255, 255, 255, 0.66); font-weight: 300; }

/* More relaxed spacing on the welcome screen */
.welcome-centre h1 { margin-bottom: 34px; }
.welcome-centre .sketch-arrow { margin-bottom: 38px; }
.welcome-centre .start-btn { margin-top: 0; }

/* Compact admin PIN screen */
.overlay:has(#settingsLocked:not(.hidden)) {
  padding: 24px;
  background: rgba(7, 7, 9, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel:has(#settingsLocked:not(.hidden)) {
  width: min(430px, calc(100vw - 40px));
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 22px;
  background: #1c1c20;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  overflow: visible;
}

.panel:has(#settingsLocked:not(.hidden)) .panel-head {
  margin-bottom: 24px;
}

.panel:has(#settingsLocked:not(.hidden)) .panel-head h2 {
  margin: 0;
  font: 500 25px/1.2 "Avenir Next", Avenir, sans-serif;
}

.panel:has(#settingsLocked:not(.hidden)) .icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 18px;
}

#settingsLocked:not(.hidden) {
  display: grid;
  gap: 18px;
}

#settingsLocked:not(.hidden) > p:first-child {
  margin: 0 0 4px;
  color: #a7a7ad;
  font-size: 15px;
}

#settingsLocked .field { margin: 0; }

#settingsLocked .field span {
  margin-bottom: 9px;
  color: #f5f5f7;
  font-size: 14px;
  font-weight: 500;
}

#settingsLocked #adminPin {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid #3a3a41;
  border-radius: 12px;
  background: #111114;
  color: #fff;
  font-size: 24px;
  letter-spacing: 0.22em;
  box-sizing: border-box;
}

#settingsLocked #adminPin:focus {
  border-color: #f15a29;
  box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.14);
  outline: none;
}

#settingsLocked #unlockBtn {
  width: 100%;
  min-height: 50px;
  margin: 0;
  border-radius: 12px;
  background: #f15a29;
  border-color: #f15a29;
  font-size: 16px;
}

#settingsLocked #unlockStatus { min-height: 0; margin: 0; }

.panel:has(#settingsLocked:not(.hidden)) .icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pin-digits { display: grid; grid-template-columns: repeat(4, 62px); justify-content: center; gap: 14px; margin: 4px 0 10px; }
.pin-digits input {
  width: 62px;
  height: 66px;
  padding: 0;
  border: 1px solid #3a3a41;
  border-radius: 13px;
  background: #111114;
  color: #fff;
  text-align: center;
  font-size: 30px;
  box-sizing: border-box;
  -webkit-text-security: disc;
}
.pin-digits input:focus { border-color: #f15a29; box-shadow: 0 0 0 3px rgba(241, 90, 41, 0.14); outline: none; }
#settingsLocked #unlockBtn { margin-top: 10px; }

/* Comfortable iPad safe-area spacing for the action-menu brand */
.menu-header {
  padding: max(58px, calc(env(safe-area-inset-top) + 28px)) 48px 28px;
  box-sizing: border-box;
}

.menu-logo {
  margin-left: 10px;
}

/* Searchable staff selection, consistent with visitor detail fields */
.wizard-form .notify-field { display: block; }
.wizard-form .notify-field.hidden { display: none; }
.wizard-form .recipient-checklist { display: grid; grid-template-columns: 1fr; gap: 10px; width: min(520px, 100%); margin-top: 20px; }
.wizard-form .recipient-check-item {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: #222226;
  box-sizing: border-box;
}
.wizard-form .recipient-check-item:has(input:checked) { border-color: #f15a29; background: rgba(241, 90, 41, 0.1); }
.wizard-form .recipient-check-item input { width: 20px; height: 20px; margin: 0; accent-color: #f15a29; }
.wizard-form .recipient-check-item span { margin: 0; font-size: 17px; }
.wizard-form .recipient-check-item strong { display: block; color: #f5f5f7; font-weight: 500; }
.wizard-form .recipient-check-item small { display: block; margin-top: 3px; color: #8f8f96; font-size: 13px; font-weight: 400; }
.staff-search-hint { margin-top: 4px !important; font-size: 15px !important; }

/* Clean, full-width staff result with tick confirmation */
.wizard-form .recipient-checklist {
  width: 100%;
  max-width: none;
  padding: 0 !important;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
}

.wizard-form .recipient-check-item {
  position: relative;
  width: 100%;
  grid-template-columns: 30px 1fr;
  padding: 15px 18px;
}

.wizard-form .recipient-check-item input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wizard-form .recipient-check-item::before {
  content: "";
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid #57575f;
  border-radius: 7px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}

.wizard-form .recipient-check-item:has(input:checked)::before {
  content: "\2713";
  border-color: #f15a29;
  background: #f15a29;
}

/* Welcoming, polished Health & Safety confirmation */
.health-safety { top: 22px; }
.health-logo { display: block; width: min(250px, 28vw); height: auto; margin: 0 auto 12px; }
.health-safety h2 { margin-bottom: 22px; font-size: 27px; }
.health-safety p { color: #d4d4d8; line-height: 1.45; }
.health-safety .health-intro {
  padding-left: 18px;
  border-left: 3px solid #f15a29;
  color: #f5f5f7;
  text-transform: none;
}
.signature-wrap { margin-top: 26px; }
.signature-clear {
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
}
.signature-clear svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.signature-clear:active { background: rgba(255, 255, 255, 0.1); transform: scale(0.96); }
.health-safety .signature-help { color: #a5a5ab; font-weight: 500; }

/* Keep safety copy aligned to the signature content column */
.health-safety p {
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

/* Keep fixed kiosk controls visually stable during screen changes */
.wizard-topbar,
.wizard-topbar .icon-button,
.wizard-nav,
.wizard-nav .primary-btn,
.app-shell .action-row,
.app-shell .action-row .primary-btn {
  transition: none !important;
  animation: none !important;
}

/* Consistent navigation across every visitor step */
.wizard-topbar { inset: max(24px, env(safe-area-inset-top)) 34px auto; }
.wizard-topbar .icon-button {
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}
.wizard-topbar .icon-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wizard-topbar .icon-button:active { background: rgba(255, 255, 255, 0.1); transform: scale(0.96); }
.wizard-nav, .app-shell .action-row {
  right: max(44px, 7vw);
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 60px));
}
.wizard-nav .primary-btn, .app-shell .action-row .primary-btn {
  min-width: 150px;
  min-height: 56px;
  border-radius: 13px;
  box-shadow: 0 12px 30px rgba(241, 90, 41, 0.2);
}

/* Align completion branding with the welcome screen */
.completion-logo { top: 15%; width: min(52vw, 670px); }
.completion-content { transform: translateY(82px); }

/* Sign-out lookup uses the same visual language as staff selection */
.wizard-form .signout-results {
  position: absolute;
  top: calc(42% + 82px);
  left: 20%;
  width: 60%;
  max-width: none;
  margin: 0;
}
.wizard-form .signout-results.hidden { display: none; }
@media (max-width: 760px) {
  .wizard-form .signout-results { left: 10%; width: 80%; }
}

/* Immediate, reliable touch focus on the Sign Out lookup */
.menu-screen.screen-hidden,
.welcome-screen.is-leaving {
  pointer-events: none;
}

.wizard-form > .field.wizard-step[data-step="0"] {
  z-index: 4;
  pointer-events: auto;
}

#name {
  position: relative;
  z-index: 5;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-user-select: text;
  user-select: text;
}

.wizard-form .signout-results {
  z-index: 2;
}

/* Keep Sign Out matches clearly below the active name field. */
.wizard-form .signout-results {
  position: relative !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  margin-top: 22px !important;
}

/* Settings are available from the action menu, not the public welcome screen. */
#welcomeSettingsBtn {
  display: none !important;
}

/* Align the final Health & Safety action with the content column. */
#wizardNextBtn.health-complete-align {
  right: 12.8vw !important;
}

/* Compact staff recipient rows in Admin Settings. */
.staff-collapsible {
  overflow: hidden;
}

.staff-collapse-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
}

.staff-collapse-toggle {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: #f5f5f7;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.staff-collapse-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.staff-collapse-chevron {
  flex: 0 0 auto;
  color: #ff5a2a;
  font-size: 22px;
  line-height: 1;
  transition: transform 180ms ease;
}

.staff-collapsible:not(.is-collapsed) .staff-collapse-chevron {
  transform: rotate(180deg);
}

.staff-collapse-delete {
  flex: 0 0 auto;
  margin-right: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 90, 42, 0.48);
  border-radius: 10px;
  background: rgba(255, 90, 42, 0.08);
  color: #ff754e;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.staff-collapsible.is-collapsed > :not(.staff-collapse-header) {
  display: none !important;
}

.staff-collapsible:not(.is-collapsed) .staff-collapse-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
}

.staff-original-remove {
  display: none !important;
}

/* The final action sits in a centred flow container, so move it to the content edge directly. */
#wizardNextBtn.health-complete-align {
  transform: translateX(9.8vw) !important;
}

/* Align the actual Health & Safety completion action to the signature edge. */
.app-shell .action-row[data-step="4"] {
  right: 12.8vw !important;
  grid-template-columns: auto !important;
}

/* Precisely centred, font-independent staff expand control. */
.staff-collapse-chevron {
  position: relative;
  display: inline-block !important;
  width: 32px !important;
  height: 32px !important;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.42) !important;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.025);
  color: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  box-sizing: border-box;
}

.staff-collapse-chevron svg {
  display: none !important;
}

.staff-collapse-chevron::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.25 6 8 10.5 12.75 6' fill='none' stroke='%23f4f4f5' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  transform: none;
}

/* Refined compact controls for Admin Settings. */
.staff-collapse-chevron {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 50%;
  color: #ffffff;
  font-size: 17px;
  font-weight: 500;
  line-height: 1;
  background: rgba(255, 255, 255, 0.025);
}

.staff-collapse-delete {
  min-height: 36px !important;
  padding: 7px 11px !important;
  border-radius: 9px;
  font-size: 14px !important;
}

#settingsPanel .admin-compact-action {
  width: auto !important;
  min-width: 0 !important;
  min-height: 38px !important;
  height: 38px !important;
  flex: 0 0 auto !important;
  align-self: center;
  padding: 7px 14px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* Option 3: focused sidebar-based Admin Settings. */
#settingsPanel {
  width: min(1180px, 92vw) !important;
  max-width: none !important;
  height: min(720px, 82vh) !important;
  max-height: 82vh !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 22px !important;
  background: rgba(17, 18, 20, 0.97) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58) !important;
}

#settingsPanel > h2 {
  position: absolute;
  z-index: 4;
  top: 30px;
  left: 30px;
  margin: 0;
  font-size: 27px;
}

#settingsCloseBtn {
  z-index: 5;
  top: 24px !important;
  right: 24px !important;
}

#settingsForm.settings-option3 {
  display: block !important;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
}

.settings-option3-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 76px;
  height: 100%;
}

.settings-option3-nav {
  grid-row: 1 / 3;
  padding: 102px 20px 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.018);
}

.settings-option3-tab {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.settings-option3-tab svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.settings-option3-tab.is-active {
  color: #ffffff;
  border-color: rgba(255, 90, 42, 0.58);
  background: linear-gradient(90deg, rgba(255, 90, 42, 0.27), rgba(255, 90, 42, 0.1));
  box-shadow: inset 4px 0 0 #ff5a2a;
}

.settings-option3-tab.is-active svg {
  color: #ff6a3d;
}

.settings-option3-content {
  min-width: 0;
  padding: 92px 30px 28px 44px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.settings-option3-section {
  display: none;
  animation: settingsSectionIn 180ms ease both;
}

.settings-option3-section.is-active {
  display: block;
}

.settings-option3-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.settings-option3-section h3 {
  margin: 0 0 7px;
  color: #ffffff;
  font-size: 26px;
}

.settings-option3-section-intro {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.56);
  font-size: 15px;
  line-height: 1.45;
}

.settings-option3-section > .settings-option3-control,
.settings-option3-section > label,
.settings-option3-section > div:not(.settings-option3-section-head):not(#settingsRecipients) {
  max-width: 720px;
}

#settingsRecipients {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: none;
}

#settingsRecipients > .staff-collapsible {
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 14px !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.settings-option3-footer {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 11, 12, 0.72);
}

.settings-option3-footer #saveSettingsBtn,
.settings-option3-footer #logoutBtn {
  width: auto !important;
  min-width: 116px !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 8px 18px !important;
  border-radius: 11px !important;
  font-size: 15px !important;
}

.settings-option3-footer #saveSettingsBtn {
  min-width: 142px !important;
}

.settings-option3-hidden {
  display: none !important;
}

@keyframes settingsSectionIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 820px) {
  .settings-option3-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .settings-option3-content { padding-left: 28px; }
}
