/* barcodeready.co.nz. One page. The brand tokens are the same as owl.gen.nz. */

@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/google-sans-flex-400-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('assets/fonts/google-sans-flex-400-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --charcoal: #131214;
  --lime: #C3FF00;
  --purple: #7321FF;
  --purple-hover: #8440FF;
  --ink: #1D1D1B;
  --muted: #595959;
  --on-panel: #FFFFFF;
  --on-panel-soft: #B4B4B9;
  --quiet: #3A393D;
  --quiet-hover: #4B4A4F;
  --warn: #FFB224;

  --gutter: clamp(0.5rem, 1.6vw, 2.25rem);
  --pad: clamp(16px, 3vw, 48px);
  --ctl: 2.4em;
  --in: 0.5em;
  --group: 1.4em;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: clamp(14px, min(1.05vw, 1.9vh), 22px); }

body {
  margin: 0;
  min-height: 100dvh;
  background: #FFFFFF;
  color: var(--ink);
  font-family: 'Google Sans Flex', system-ui, -apple-system, 'Segoe UI', sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.page {
  width: min(100%, 190dvh);
  min-height: 100dvh;
  margin-inline: auto;
  padding: 0 max(var(--gutter), env(safe-area-inset-right)) env(safe-area-inset-bottom) max(var(--gutter), env(safe-area-inset-left));
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: clamp(1rem, 3vh, 1.8rem);
}
.mark { display: block; height: clamp(1rem, 3.6vh, 2.4rem); width: auto; flex: none; }
.promise { margin: 0; font-size: 0.875rem; font-weight: 400; line-height: 1.2; color: var(--muted); text-align: right; }
.promise span { white-space: nowrap; }

.bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-block: clamp(0.9rem, 3vh, 1.6rem);
  font-size: 0.875rem;
}
.bottom a { color: var(--ink); text-underline-offset: 0.2em; padding: 0.15rem 0.35rem; border-radius: 0.3rem; }
.bottom a:hover { color: var(--purple); }
.bottom a:focus-visible, .settings:focus-visible { outline: 2px solid var(--purple); outline-offset: 1px; }
.settings {
  padding: 0.15rem 0.35rem;
  border: 0;
  border-radius: 0.3rem;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.settings:hover { color: var(--purple); }

/* The analytics choice. It shows until a person accepts or rejects. */
.consent {
  position: fixed;
  left: 50%;
  bottom: max(0.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 10;
  width: min(100vw - 1rem, 60rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.5rem 0.45rem 1rem;
  border-radius: 1.2rem;
  background: #FFFFFF;
  color: var(--ink);
  box-shadow: 0 0.2rem 1.4rem rgba(0, 0, 0, 0.4);
  font-size: max(12px, 0.8rem);
  line-height: 1.25;
}
.consent p { flex: 1 1 auto; margin: 0; min-width: 0; }
.consent a { color: var(--ink); text-underline-offset: 0.2em; white-space: nowrap; }
.consent-actions { flex: none; display: flex; gap: 0.5rem; }
.consent .btn:focus-visible, .consent a:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; }
@media (max-width: 760px) {
  .consent { flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.6rem; }
  .consent-actions .btn { flex: 1 1 0; padding: 0 0.5em; }
}

/* The dark panel. */
.panel {
  container: panel / inline-size;
  background: var(--charcoal);
  color: var(--on-panel);
  border-radius: clamp(0.9rem, 2.5vmin, 2.4rem);
}

.grid {
  padding: var(--pad);
  display: grid;
  column-gap: clamp(16px, 3cqw, 56px);
  row-gap: var(--group);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  grid-template-areas:
    "field stage"
    "tools stage";
  align-items: start;
}

/* The number is the headline. */
.field { grid-area: field; min-width: 0; }
#number {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--lime);
  caret-color: var(--lime);
  font: inherit;
  font-size: clamp(1.6rem, 4.4cqw, 3.2rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
#number::placeholder { color: var(--on-panel); opacity: 1; letter-spacing: -0.01em; }
#number:focus-visible { box-shadow: 0 0.07em 0 -0.02em var(--lime); }
#number[aria-invalid="true"] { box-shadow: 0 0.07em 0 -0.02em var(--warn); }
.field-hint { margin-top: 0.6em; }

/* The barcode, on white, as it prints. */
.stage { grid-area: stage; min-width: 0; align-self: stretch; display: grid; place-items: center; }
.tile {
  width: 100%;
  padding: clamp(12px, 3cqw, 40px);
  border-radius: clamp(0.5rem, 1.6cqw, 1.4rem);
  background: #FFFFFF;
  color: #000000;
  display: grid;
  place-items: center;
}
.tile svg { display: block; width: 100%; height: auto; max-height: 60vh; }
/* The sample dims its bars. Its digits stay at 7:1 on white. */
.tile.is-sample { color: var(--muted); }
.tile.is-sample svg path { opacity: 0.35; }
.tile.is-sample svg text { fill: var(--muted); }

.tools { grid-area: tools; min-width: 0; display: flex; flex-direction: column; gap: var(--group); }
.tool { min-width: 0; }

.cap, .hint, .readout, .status { font-size: max(12px, 0.86rem); }
.cap { margin: 0 0 var(--in); font-weight: 400; line-height: 1.2; color: var(--on-panel-soft); }
.cap-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; flex-wrap: wrap; }
.readout { color: var(--on-panel-soft); font-variant-numeric: tabular-nums; line-height: 1.2; }
.hint { margin: var(--in) 0 0; color: var(--on-panel-soft); line-height: 1.3; }

/* A radio group drawn as pills. Lime shows what is selected. White shows focus. */
.options { display: flex; flex-wrap: wrap; gap: var(--in); }
.option { position: relative; display: inline-flex; }
.option input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.option span {
  display: inline-flex;
  align-items: center;
  height: var(--ctl);
  padding: 0 1em;
  border-radius: 999px;
  background: var(--quiet);
  color: var(--on-panel);
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.option:hover span { background: var(--quiet-hover); }
.option input:checked + span { box-shadow: inset 0 0 0 2px var(--lime); }
.option input:focus-visible + span { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--ctl);
  padding: 0 1.15em;
  font: inherit;
  font-weight: 500;
  line-height: 1;
  color: var(--on-panel);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color 0.12s ease;
}
.btn-primary { background: var(--purple); }
.btn-primary:hover { background: var(--purple-hover); }
.btn-quiet { background: var(--quiet); }
.btn-quiet:hover { background: var(--quiet-hover); }
.btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }
.btn:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

.actions { display: flex; flex-direction: column; gap: var(--in); }
.status { display: flex; align-items: baseline; gap: 0.5em; margin: 0; min-height: 1.3em; line-height: 1.3; color: var(--on-panel); }
.status::before {
  content: '';
  flex: none;
  width: 0.5em;
  height: 0.5em;
  border-radius: 50%;
  background: var(--on-panel-soft);
  transform: translateY(-0.05em);
}
.status[data-tone="ok"]::before { background: var(--lime); }
.status[data-tone="warn"]::before { background: var(--warn); }
.status[data-tone="warn"] { color: var(--warn); }
.downloads { display: grid; grid-template-columns: minmax(max-content, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: var(--in); }

/* A narrow panel: number, then barcode, then controls. */
@container panel (max-width: 760px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "field"
      "stage"
      "tools";
  }
  #number { font-size: clamp(1.4rem, 7.5cqw, 2.6rem); }
}

.noscript { margin: 1rem; text-align: center; }

.notfound { padding: var(--pad); display: grid; justify-items: start; gap: 1.2rem; }
.notfound h1 { margin: 0; font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 400; color: var(--lime); }
