[hidden] { display: none !important; }
/* Brand font slot: drop the real logo font file in as fonts/logo.woff2 and it is used automatically.
   Until then the closest free match (Young Serif) is used. */
@font-face { font-family: "MY Logo"; src: url("../fonts/logo.woff2") format("woff2"); font-display: swap; }

:root {
  --logo-font: "MY Logo", "Young Serif", Georgia, serif;
  --body-font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --brand: #D9473A;        /* container red */
  --sign-red: #C8392D;     /* sign lettering */
  --sign-white: #F3F1EE;   /* sign face */
  --paper: #F5F1EF;
  --card: #FFFFFF;
  --ink: #2B1916;
  --muted: #7A5D57;
  --line: #E9DAD5;
  --green: #C8392D;        /* primary action colour (kept name for simplicity) */
  --green-ink: #FFFFFF;
  --stamp: #C8392D;
  --danger: #A3241B;
  --radius: 12px;
  --radius-lg: 24px;
  color-scheme: light dark;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1110;
    --card: #251917;
    --ink: #F5EAE7;
    --muted: #BDA39D;
    --line: #3C2925;
    --green: #EE6E5C;
    --green-ink: #1A0D0B;
    --stamp: #EE6E5C;
    --danger: #FF8F84;
  }
}
*, *::before, *::after { box-sizing: inherit; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--body-font);
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 2px; }

.wrap { max-width: 460px; margin: 0 auto; padding: 24px 20px 48px; }

/* Brand header: the shipping-container wall with the sign on it */
.brandbar {
  text-align: center;
  padding: 30px 20px 26px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.08), rgb(0 0 0 / 0.08)),
    repeating-linear-gradient(90deg,
      #E0503F 0 20px, #B8362A 20px 23px, #EC6150 23px 40px, #C43E30 40px 44px);
}
.sign {
  display: inline-block; padding: 9px; border-radius: 5px;
  background: var(--sign-white);
  box-shadow: 9px 11px 0 rgb(80 16 10 / 0.45);
}
.sign-in {
  border: 3px solid var(--sign-red); border-radius: 9px;
  padding: 12px 24px 16px; color: var(--sign-red);
  font-family: var(--logo-font); line-height: 0.98; letter-spacing: -0.01em;
}
.sign-in span { display: block; font-size: clamp(2.1rem, 10vw, 2.7rem); }
.brandbar .tag { color: #FFFFFF; font-weight: 300; font-size: 1.05rem; margin: 18px 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap.wide { max-width: 780px; }

h1 {
  font-size: clamp(2.1rem, 9vw, 2.8rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 0;
}
h2 { font-family: var(--logo-font); font-size: 1.5rem; line-height: 1.15; font-weight: 400; margin: 0 0 6px; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.shop { margin-bottom: 26px; }
.shop .sub { color: var(--muted); margin-top: 6px; }
.demo {
  display: inline-block; margin: 0 0 16px; padding: 4px 10px; border-radius: 8px;
  background: #FFE8A3; color: #483800; font-size: 0.85rem; font-weight: 600;
}

/* Forms */
label { display: block; font-weight: 600; font-size: 0.95rem; margin-top: 14px; }
input, select {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); font: inherit;
}
input:focus { border-color: var(--green); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin: 3px 0 0; flex: none; accent-color: var(--green); }
.err { color: var(--danger); min-height: 1.4em; font-size: 0.95rem; margin-top: 10px; }
.switch { margin-top: 18px; color: var(--muted); }

/* Buttons */
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 13px 22px; min-height: 50px;
  font: inherit; font-weight: 700; cursor: pointer; width: 100%; margin-top: 18px;
  background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
}
.btn.primary { background: var(--green); color: var(--green-ink); border-color: var(--green); }
.btn.danger { color: var(--danger); border-color: currentColor; background: transparent; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.inline { width: auto; margin-top: 0; min-height: 40px; padding: 8px 16px; }
.link {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: var(--green); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.link.danger { color: var(--danger); }
a { color: var(--green); text-underline-offset: 3px; }

/* The stamp card */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
}
.hello { font-size: 1.15rem; font-weight: 600; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 14px; }
.slot {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  border: 2px dashed var(--line); color: var(--stamp);
}
.slot svg { width: 54%; height: 54%; }
.slot.on {
  border: 3px solid var(--stamp);
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 5px var(--stamp);
  transform: rotate(var(--r));
  opacity: 0.9;
}
.slot.free { border: 2px solid var(--green); color: var(--green); font-family: var(--logo-font); font-size: 1rem; }
.slot.free.on { background: var(--green); color: var(--green-ink); border: 2px solid var(--green); box-shadow: none; transform: none; opacity: 1; }
.slot.just { animation: stampdown 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.35) both; }
@keyframes stampdown {
  from { transform: rotate(var(--r)) scale(1.7); opacity: 0; }
  to { transform: rotate(var(--r)) scale(1); opacity: 0.9; }
}
.progress { margin: 18px 0 0; font-weight: 600; }
.ready {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--green); color: var(--green-ink); font-weight: 700;
}

.qrbox {
  margin-top: 18px; padding: 20px; border-radius: var(--radius-lg);
  background: #FFFFFF; color: #17221C; text-align: center;
}
.qrbox svg { width: min(230px, 70vw); height: auto; display: block; margin: 0 auto 8px; }
.qrbox .small { color: #55645B; margin: 0; word-break: break-all; }

.install {
  margin-top: 18px; padding: 16px; border-radius: var(--radius);
  border: 1.5px dashed var(--green); background: var(--card);
}
.install p { margin-bottom: 12px; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 30px; font-size: 0.95rem; }

/* Staff */
.who { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 18px; }
#reader { margin-top: 14px; border-radius: var(--radius); overflow: hidden; background: #000; }
.or { text-align: center; color: var(--muted); margin: 22px 0 0; }
.custhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.custhead h2 { font-size: 1.9rem; margin: 0; }
.count { font-family: var(--logo-font); font-size: 2.1rem; font-weight: 400; line-height: 1; white-space: nowrap; }
.count span { font-size: 1rem; color: var(--muted); font-weight: 600; }
.wrap.wide .grid { max-width: 420px; margin: 0 auto; }
.actions { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-top: 18px; }
.actions .btn { margin-top: 0; }
.btn.big { font-size: 1.3rem; min-height: 68px; }
.warn { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); border: 1.5px solid var(--danger); color: var(--danger); font-weight: 600; }

/* Admin */
section.block { margin-top: 30px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stats div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stats b { display: block; font-family: var(--logo-font); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 0.9rem; }
.list { list-style: none; padding: 0; margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
/* Name + email column: allowed to shrink, long emails wrap instead of pushing the buttons out */
.list li > span:first-child { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
/* Buttons keep their size; on narrow screens they drop under the name, right-aligned */
.list li > .btn, .list li > .row { flex: none; margin-left: auto; }
.list li > .row { gap: 8px; }
.list li:first-child { border-top: 0; }
.list .empty { color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; align-items: end; }
/* Staff report */
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); margin-bottom: 10px; }
.seg button {
  white-space: nowrap; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-weight: 600; font-size: 0.82rem; padding: 8px 4px; border-radius: 999px; cursor: pointer;
}
.seg button[aria-selected="true"] { background: var(--green); color: var(--green-ink); }
.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.report { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.report th, .report td { padding: 11px 14px; text-align: left; border-top: 1px solid var(--line); }
.report thead th { border-top: 0; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.report th:not(:first-child), .report td:not(:first-child) { text-align: right; width: 22%; }
.report tr.total td { font-weight: 700; }
code.uid { display: block; padding: 10px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); word-break: break-all; font-size: 0.9rem; }

.poster {
  margin-top: 12px; padding: 28px 22px; background: #FFFFFF; color: #17221C;
  border-radius: var(--radius-lg); text-align: center; border: 1px solid var(--line);
}
.poster .sign { box-shadow: none; padding: 0; }
.poster p { font-weight: 300; font-size: 1.05rem; }
.poster svg { width: min(260px, 70vw); height: auto; display: block; margin: 14px auto; }

/* Privacy page */
.prose h2 { margin-top: 26px; }
.prose li { margin-bottom: 6px; }

/* Toast + dialog */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; z-index: 20; max-width: 90vw; text-align: center;
}
dialog {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px;
  background: var(--card); color: var(--ink); width: min(420px, 92vw);
}
dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }

@media (prefers-reduced-motion: reduce) { .slot.just { animation: none; } }

@media print {
  body { background: #fff; }
  body * { visibility: hidden; }
  .poster, .poster * { visibility: visible; }
  .poster { position: absolute; inset: 0; border: 0; margin: 0; padding-top: 80px; }
  .poster .sign-in span { font-size: 64px; }
  .poster svg { width: 360px; }
}

/* Tap-to-enlarge QR */
.qrbtn { appearance: none; border: 0; padding: 0; background: none; cursor: zoom-in; display: block; margin: 0 auto; border-radius: 8px; }
.qrbig {
  position: fixed; inset: 0; z-index: 30; background: #FFFFFF; color: #2B1916;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 16px calc(20px + env(safe-area-inset-bottom, 0px));
  cursor: zoom-out; text-align: center;
}
.qrbig svg { width: min(92vw, 70vh); height: auto; display: block; }
.qrbig p { margin: 0; color: #7A5D57; font-size: 0.95rem; }

/* Find us */
.findus { margin-top: 18px; }
.findhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.findhead h2 { margin: 0; }
.badge { font-size: 0.82rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.badge.open { background: #E3F4EA; color: #1C6B3E; }
.badge.closed { background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .badge.open { background: #173A27; color: #8FDCAE; } }
.map {
  height: 220px; margin: 12px 0 10px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--paper); position: relative; z-index: 0;
}
@media (prefers-color-scheme: dark) {
  .map .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
}
.map .leaflet-control-attribution { font-size: 10px; }
.pin span {
  display: block; width: 30px; height: 30px; background: var(--sign-red);
  border: 3px solid #FFFFFF; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.35);
}
.distance { font-weight: 600; margin: 0 0 6px; }
.findus .row { align-items: stretch; flex-wrap: wrap; }
.findus .row .btn { margin-top: 0; min-height: 48px; white-space: nowrap; }
.btn.grow { flex: 1; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.hours { margin: 12px 0 0; }

/* Staff camera controls */
#camControls { margin-top: 10px; }
#camControls .btn { margin-top: 0; }
