/* Strip Count — three colours and a ground. Domes are the only circles. */

@font-face {
  font-family: "Instrument Serif";
  src: url("assets/fonts/InstrumentSerif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("assets/fonts/SchibstedGrotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #EFEDE6;
  --paper-deep: #E3E0D6;
  --ink: #161513;
  --ink-soft: #5B5950;
  --foil: #4A5157;
  --foil-deep: #343A3F;
  --foil-lift: #697178;
  --dome: #FBFAF6;
  --dome-edge: #C9C5BA;
  --clay: #8C3A2E;
  --hairline: rgba(22, 21, 19, 0.18);
  --hairline-faint: rgba(22, 21, 19, 0.09);
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "Schibsted Grotesk", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #DAD7CD;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  position: relative;
  max-width: 600px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--hairline-faint);
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: enter 0.24s ease-out;
}
.screen.still { animation: none; }
@keyframes enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ------------------------------------------------------------ app bar */

.bar {
  flex: none;
  display: flex;
  align-items: center;
  min-height: calc(56px + var(--safe-top));
  padding: var(--safe-top) 4px 0 4px;
  background: var(--paper);
}
.bar h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 12px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar .back + h1 { padding-left: 4px; }

.icon-btn {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
}
.icon-btn:hover { background: var(--hairline-faint); }
.icon-btn:active { background: var(--hairline); }
.icon-btn:disabled { opacity: 0.38; cursor: default; background: transparent; }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn.sm svg { width: 18px; height: 18px; }

.badge {
  position: absolute;
  top: 7px;
  left: 26px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--clay);
  color: var(--paper);
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ------------------------------------------------------------ body */

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pad-b12 { padding-bottom: 12px; }
.pad-b20 { padding-bottom: 20px; }
.pad-b28 { padding-bottom: 28px; }
.pad-b46 { padding-bottom: 46px; }

.foot { flex: none; padding-bottom: var(--safe-bottom); background: var(--paper); }
.foot.ink { background: var(--ink); }

.block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
}
.block svg { width: 18px; height: 18px; fill: currentColor; }
.block:active { filter: brightness(1.25); }
.block.soft { background: var(--paper-deep); color: var(--ink); }
.block.off { background: var(--paper-deep); color: var(--ink-soft); cursor: default; }
.block.off:active { filter: none; }
.block.clay { background: var(--clay); color: var(--paper); }
.block.inline { width: auto; display: inline-flex; }

.band {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 16px 10px;
}
.band .t {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1.2;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.band .rule, .split .rule { flex: 1; height: 1px; background: var(--hairline); }
.band .trail { font-size: 13px; color: var(--ink-soft); }

.plain {
  margin: 4px 16px;
  padding: 12px 14px 13px;
  background: var(--paper-deep);
  border-left: 3px solid var(--foil);
  font-size: 13px;
  line-height: 1.35;
  color: var(--ink-soft);
}

.small { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.label { font-size: 16px; font-weight: 700; letter-spacing: -0.1px; line-height: 1.2; }
.serif { font-family: var(--serif); font-weight: 400; }

.split {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 6px;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------ empty state */

.nothing {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}
.nothing .in {
  padding: 24px 30px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nothing h2 {
  margin: 26px 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
}
.nothing p { margin: 0; color: var(--ink-soft); }
.nothing .block { margin-top: 24px; }

/* ------------------------------------------------------------ strip card */

.card {
  display: block;
  width: 100%;
  padding: 14px 16px 16px;
  border: 0;
  border-bottom: 1px solid var(--hairline-faint);
  background: var(--paper);
  text-align: left;
}
button.card:hover { background: #E9E6DE; }
button.card:active { background: var(--paper-deep); }
.card .top { display: flex; align-items: flex-start; gap: 12px; }
.card .who { flex: 1; min-width: 0; }
.card .who > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .who .label { margin-bottom: 2px; }
.card .who .amt { margin-top: 3px; }
.card .fig { text-align: right; flex: none; }
.fig .n { font-family: var(--serif); font-size: 40px; line-height: 1; }
.fig .u { font-size: 13px; color: var(--ink-soft); margin-left: 5px; }
.fig .when { margin-top: 2px; }
.fig .ran {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  line-height: 1.2;
  color: var(--clay);
}
.fig .ago {
  margin-top: 3px;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.15;
  color: var(--clay);
}
.strip-wrap { position: relative; margin-top: 12px; }
.strip-wrap .words {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  text-align: center;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(251, 250, 246, 0.92);
}
canvas.strip { display: block; width: 100%; }
.card .more { margin-top: 6px; }
.card .note { margin-top: 8px; }

/* ------------------------------------------------------------ customer */

.drift {
  margin: 0 16px 4px;
  padding: 16px 16px 18px;
  background: var(--foil);
  border: 1px solid var(--foil-deep);
  color: rgba(251, 250, 246, 0.92);
}
.drift .head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.drift .big { font-family: var(--serif); font-size: 40px; line-height: 1; color: var(--dome); }
.drift .soft { font-size: 13px; line-height: 1.35; color: rgba(251, 250, 246, 0.75); }
.drift p { margin: 0; }
.drift .soft.gap { margin-top: 6px; }

.past {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline-faint);
}
.past .row { display: flex; align-items: baseline; gap: 12px; }
.past .row .label { flex: 1; min-width: 0; }
.past .small.sub { margin-top: 3px; }

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
}
.text-btn:hover { background: var(--hairline-faint); }
.text-btn svg { width: 18px; height: 18px; fill: currentColor; }
.stand { padding: 18px 16px 0; }

/* ------------------------------------------------------------ lists */

.tile {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 8px 16px 8px 16px;
  border: 0;
  background: transparent;
  text-align: left;
}
button.tile:hover { background: var(--hairline-faint); }
.tile .txt { flex: 1; min-width: 0; }
.tile .tt { font-size: 16px; font-weight: 700; line-height: 1.3; }
.tile .tt.dim { color: var(--ink-soft); }
.tile .st { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.tile .chev { width: 20px; height: 20px; fill: var(--ink-soft); flex: none; }
.stepper { display: flex; align-items: center; flex: none; }
.stepper .val { width: 62px; text-align: center; font-size: 16px; font-weight: 700; }
.stepper .icon-btn { width: 40px; height: 40px; }

.key { display: flex; align-items: center; gap: 14px; padding: 0 16px 12px; }
.key canvas { flex: none; width: 128px; }
.key .small { flex: 1; }

/* ------------------------------------------------------------ dispense */

.pick {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--hairline-faint);
  background: var(--paper);
  text-align: left;
}
.pick:hover { background: #E9E6DE; }
.pick .k { width: 104px; flex: none; font-size: 13px; color: var(--ink-soft); }
.pick .v { flex: 1; min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.2; }
.pick .v.dim { color: var(--ink-soft); }
.pick svg { width: 20px; height: 20px; fill: var(--ink-soft); flex: none; }
.date-host { position: relative; }
.date-host input[type=date] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  pointer-events: none;
}

.pair { display: flex; gap: 12px; padding: 0 16px; }
.pair .field { flex: 1; min-width: 0; }

.field {
  display: block;
  position: relative;
  background: var(--paper-deep);
  border: 1px solid var(--hairline);
  padding: 7px 12px 8px;
}
.field:focus-within { border-color: var(--ink); box-shadow: inset 0 0 0 0.6px var(--ink); }
.field .fl { display: block; font-size: 12px; line-height: 1.3; color: var(--ink-soft); }
.field .line { display: flex; align-items: baseline; gap: 6px; }
.field input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 2px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1.45;
}
.field input::placeholder { color: var(--ink-soft); opacity: 0.8; }
.field .suffix { flex: none; color: var(--ink-soft); font-size: 15px; }
.field.off { opacity: 0.45; }
.field.bare { padding: 10px 12px; }
.note-field { padding: 0 16px 6px; }

.switch-tile { display: flex; align-items: center; gap: 16px; padding: 12px 16px; cursor: pointer; }
.switch-tile .txt { flex: 1; }
.switch-tile .tt { font-size: 16px; font-weight: 700; line-height: 1.3; }
.switch-tile .st { font-size: 13px; line-height: 1.35; color: var(--ink-soft); }
.switch { position: relative; flex: none; width: 52px; height: 32px; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch .tr {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: var(--paper-deep);
  border: 2px solid var(--ink-soft);
  transition: background 0.15s, border-color 0.15s;
}
.switch .th {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-soft);
  transition: all 0.15s;
}
.switch input:checked ~ .tr { background: var(--foil); border-color: var(--foil); }
.switch input:checked ~ .th { left: 24px; top: 4px; width: 24px; height: 24px; background: var(--paper); }
.switch input:focus-visible ~ .tr { outline: 2px solid var(--ink); outline-offset: 2px; }

.derived { background: var(--paper-deep); padding: 14px 16px 16px; }
.derived .date { font-family: var(--serif); font-size: 22px; line-height: 1.15; }
.derived .gap6 { margin-top: 6px; }
.derived .gap4 { margin-top: 4px; }

/* ------------------------------------------------------------ overlays */

#overlay { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(22, 21, 19, 0.42);
  pointer-events: auto;
  animation: fade 0.18s ease-out;
}

.dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(400px, calc(100% - 48px));
  max-height: calc(100% - 48px);
  overflow-y: auto;
  background: var(--paper);
  padding: 24px 24px 12px;
  pointer-events: auto;
  box-shadow: 0 10px 40px rgba(22, 21, 19, 0.28);
  animation: fade 0.18s ease-out;
}
.dialog h3 { margin: 0 0 16px; font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; }
.dialog .content { font-size: 15px; line-height: 1.45; }
.dialog .content p { margin: 0; }
.dialog .field + .field { margin-top: 12px; }
.dialog .hint { margin-top: 10px; }
.dialog .acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 4px; margin-top: 20px; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  padding-bottom: var(--safe-bottom);
  pointer-events: auto;
  box-shadow: 0 -6px 30px rgba(22, 21, 19, 0.2);
  animation: rise 0.22s ease-out;
}
@keyframes rise { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet .list { flex: 1; min-height: 0; overflow-y: auto; }
.sheet .empty { padding: 4px 16px 12px; }
.sheet .add { padding: 10px 16px 18px; }

.snack {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: 100%;
  max-width: 600px;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  transform: translate(-50%, 110%);
  transition: transform 0.22s ease-out;
}
.snack.show { transform: translate(-50%, 0); }

/* ------------------------------------------------------------ splash */

.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 30px;
}
.splash .count {
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}
.splash .count span:first-child,
.splash .word {
  font-family: var(--serif);
  font-size: 52px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.splash .count { align-items: baseline; line-height: 74px; }
.splash .count .d { color: var(--ink-soft); }
.splash .strip-wrap { width: 100%; margin-top: 26px; }

@media (hover: none) {
  button.card:hover, .pick:hover, button.tile:hover, .icon-btn:hover, .text-btn:hover { background: inherit; }
  .icon-btn:hover, .text-btn:hover { background: transparent; }
}
