/* Hallmark · shape: sign-in screen · genre: modern-minimal · theme: Dusk (by request) · job: sign in
 * hero: stage, the head over the product in smoked glass, the form beside it · nav: the wordmark and the light/dark switch · footer: one slate line · imagery: the product · signature: the Pockets till itself, built in glass beside the sign-in · dusk: none/periwinkle-apricot/glass
 * axes: dark 17.5 268/grotesk-sans Wix Madefor Display/cool 274 · posture: committed · modes: light+dark (the app's html[data-theme]) · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: R, four capability rows plus a product preview is the most a sign-in page should carry; the form stays first on phones and nothing here is invented */
/* waive 12/13: a sign-in page; the head, one sentence, the product and the form are the screen */
/* waive 7b/22: --color-light oklch(100% 0 0) is Dusk's own token (dusk.md § Tokens), used only as a translucent overlay */
/* answered 29: smoked glass is Dusk's product surface (dusk.md § Surfaces, glass on slate), with its lit edge */
/* answered 3: the category side stripe replicates the real till's tabs (ps-dusk.css phase 3), where it carries each category's own colour */
/* waive third signal: the Pockets brand yellow is the main action across the app (owner's choice); periwinkle stays focus and selection */

/* ---------- Tokens: Hallmark Dusk (references/themes/dusk.md), neutral whites in light mode ---------- */
:root {
  --color-paper: oklch(17.5% 0.014 268); --color-paper-2: oklch(21% 0.016 268); --color-paper-3: oklch(25% 0.017 268);
  --color-ink: oklch(97% 0.003 268); --color-ink-2: oklch(85% 0.010 262); --color-muted: oklch(70% 0.016 262);
  --color-rule: oklch(30% 0.016 266); --color-light: oklch(100% 0 0); --color-shade: oklch(10% 0.022 268);
  --color-accent: oklch(77% 0.10 274); --color-focus: oklch(80% 0.10 274);
  --color-accent-2: oklch(83% 0.095 62);
  --color-yellow: oklch(80.5% 0.165 80); --color-yellow-hi: oklch(85% 0.15 82); --color-yellow-ink: oklch(21% 0.006 80);
  --color-yellow-text: oklch(52% 0.115 70);
  --color-sage: oklch(80% 0.09 160);
  --glass: oklch(22% 0.018 268 / 0.62); --glass-blur: 22px;
  --glass-hi: inset 0 1px 0 oklch(100% 0 0 / 0.10), inset 0 0 0 1px oklch(100% 0 0 / 0.06);
  --shadow-card: 0 1px 0 oklch(100% 0 0 / 0.06) inset, 0 40px 80px -32px oklch(8% 0.02 268 / 0.7);
  --font-display: "Wix Madefor Display", ui-sans-serif, system-ui, sans-serif; --font-body: "Wix Madefor Text", ui-sans-serif, system-ui, sans-serif;
  --radius-card: 18px; --radius-inner: 10px; --radius-pill: 999px; --rule-hair: 1px;
  --tracking-display: -0.022em; --display-weight: 500;

  /* shared scale */
  --space-2xs: 0.25rem; --space-xs: 0.5rem; --space-sm: 0.75rem; --space-md: 1rem; --space-lg: 1.5rem;
  --space-xl: 2rem; --space-2xl: 3rem; --space-3xl: 4.5rem;
  --container: 76rem; --gutter: clamp(1rem, 4vw, 3rem);
  --dur-micro: 120ms; --dur-short: 200ms; --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* page roles, so both modes swap from one place */
  --field-bg: oklch(100% 0 0 / 0.05); --field-bg-focus: oklch(100% 0 0 / 0.07);
  --field-border: oklch(100% 0 0 / 0.10); --field-border-hover: oklch(100% 0 0 / 0.18);
  --notice-ink: var(--color-accent-2);
  --switch-bg: var(--color-paper-2); --switch-on: var(--color-yellow); --switch-ink: var(--color-muted); --switch-ink-on: var(--color-yellow-ink);
  --till-card: oklch(100% 0 0 / 0.05); --till-rule: oklch(100% 0 0 / 0.08);
  --cat-all: oklch(46% 0.03 257); --cat-groc: oklch(58% 0.11 150); --cat-drink: oklch(56% 0.18 290);
  --page-glow: oklch(77% 0.10 274 / 0.10);
  color-scheme: dark;
}

html[data-theme="light"] {
  --color-paper: oklch(97% 0.003 268); --color-paper-2: oklch(99.6% 0.001 268); --color-paper-3: oklch(93.5% 0.004 268);
  --color-ink: oklch(22% 0.022 268); --color-ink-2: oklch(32% 0.020 266); --color-muted: oklch(47% 0.016 265);
  --color-rule: oklch(90.5% 0.005 268);
  --color-focus: oklch(44% 0.13 274);
  --color-sage: oklch(46% 0.10 160);
  --glass: oklch(99.6% 0.001 268 / 0.82);
  --glass-hi: inset 0 1px 0 oklch(100% 0 0 / 0.75), inset 0 0 0 1px oklch(22% 0.022 268 / 0.08);
  --shadow-card: 0 1px 0 oklch(100% 0 0 / 0.6) inset, 0 30px 60px -30px oklch(28% 0.04 268 / 0.30);
  --field-bg: oklch(99.6% 0.001 268); --field-bg-focus: oklch(99.6% 0.001 268);
  --field-border: oklch(22% 0.022 268 / 0.14); --field-border-hover: oklch(22% 0.022 268 / 0.26);
  --notice-ink: oklch(47% 0.12 55);
  --switch-bg: var(--color-paper-2);
  --till-card: oklch(99.6% 0.001 268); --till-rule: oklch(22% 0.022 268 / 0.08);
  --page-glow: oklch(80.5% 0.165 80 / 0.10);
  color-scheme: light;
}

/* ---------- Base ---------- */
html, body { overflow-x: clip; }
html:has(body.hm-dusk) { scrollbar-color: var(--color-paper-3) var(--color-paper); }
body.hm-dusk {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(60rem 30rem at 15% -10%, var(--page-glow), transparent 70%),
    var(--color-paper);
  color: var(--color-ink);
  font: 400 1rem/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.hm-dusk *, .hm-dusk *::before, .hm-dusk *::after { box-sizing: border-box; }
.hm-dusk h1, .hm-dusk h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--tracking-display);
  overflow-wrap: break-word;
  min-width: 0;
  text-wrap: balance;
}
.hm-dusk p { margin: 0; }
.hm-dusk ::selection { background: var(--color-yellow); color: var(--color-yellow-ink); }

.dusk {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.dusk__wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Bar: wordmark and the light/dark switch ---------- */
.dusk__bar { padding-block: var(--space-md); }
.dusk__bar .dusk__wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.dusk__logo {
  display: block;
  width: 152px;
  height: auto;
  background: none; /* transparent in both modes (owner's request) */
}

.hm-dusk .ps-theme-switch {
  display: inline-flex;
  gap: var(--space-2xs);
  padding: var(--space-2xs);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: var(--switch-bg);
}
.hm-dusk .ps-theme-switch button {
  height: 32px;
  min-height: 32px;
  padding: 0 var(--space-sm);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--switch-ink);
  font: 600 13px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.hm-dusk .ps-theme-switch button:hover:not(.is-on) { color: var(--color-ink); background: color-mix(in oklab, var(--color-ink) 7%, transparent); }
.hm-dusk .ps-theme-switch button.is-on { background: var(--switch-on); color: var(--switch-ink-on); }
.hm-dusk .ps-theme-switch button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }

/* ---------- Stage: head and product on the left, the sign-in on the right, capabilities below ---------- */
.dusk__stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 25rem);
  grid-template-areas:
    "head signin"
    "till signin"
    "caps caps";
  column-gap: var(--space-3xl);
  row-gap: var(--space-lg);
  align-items: start;
  padding-block: var(--space-md) var(--space-xl);
}
.dusk__head { grid-area: head; }
.dusk__head h1 {
  max-width: 16ch;
  color: var(--color-ink);
  font-size: clamp(2.5rem, 1.6rem + 2.4vw, 3.75rem);
  line-height: 1.04;
}
.dusk__head p {
  margin-top: var(--space-md);
  max-width: 46ch;
  color: var(--color-muted);
  font-size: 1.125rem;
  line-height: 1.5;
}

/* ---------- Glass ---------- */
.glass {
  background: var(--glass);
  border-radius: var(--radius-card);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  backdrop-filter: blur(var(--glass-blur)) saturate(1.35);
  box-shadow: var(--glass-hi), var(--shadow-card);
}

/* ---------- The till, built (demo data; follows the theme) ---------- */
.till {
  grid-area: till;
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-sm);
  padding: var(--space-sm);
  font-size: 12.5px;
  line-height: 1.3;
  animation: dusk-rise 560ms var(--ease) 40ms both;
}
.till__menu, .till__order { min-width: 0; }
.till__cats { display: flex; gap: var(--space-xs); margin-bottom: var(--space-xs); }
.till__cat {
  flex: 1;
  min-width: 0;
  min-height: 32px;
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-sm);
  border: 0;
  border-left: 4px solid var(--cat, var(--cat-all));
  border-radius: 8px;
  background: var(--till-card);
  box-shadow: inset 0 0 0 1px var(--till-rule);
  color: var(--color-ink);
  font: 600 12.5px/1.2 var(--font-body);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease);
}
.till__cat:hover:not(.is-on) { box-shadow: inset 0 0 0 1px var(--field-border-hover); }
.till__cat:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.till__cat--all { --cat: var(--cat-all); }
.till__cat--groc { --cat: var(--cat-groc); }
.till__cat--drink { --cat: var(--cat-drink); }
.till__cat.is-on {
  background: color-mix(in oklab, var(--color-yellow) 18%, var(--till-card));
  box-shadow: inset 0 0 0 1.5px var(--color-yellow);
}
.till__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xs); }
.till__grid { align-content: start; }
.till__card {
  display: grid;
  gap: 2px;
  padding: var(--space-sm);
  border-radius: var(--radius-inner);
  background: var(--till-card);
  box-shadow: inset 0 0 0 1px var(--till-rule);
  transition: box-shadow var(--dur-micro) var(--ease);
}
.till__card.is-in-cart { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-yellow) 55%, var(--till-rule)); }
.till__name { font-weight: 600; font-size: 13px; }
.till__stock { color: var(--color-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.till__stock.is-low { color: var(--notice-ink); font-weight: 600; }
.till__foot { display: flex; align-items: center; justify-content: space-between; margin-top: var(--space-xs); }
.till__price { font-weight: 700; font-variant-numeric: tabular-nums; }
.till__step { display: inline-flex; align-items: center; gap: var(--space-2xs); }
.till__btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--till-rule);
  color: var(--color-yellow);
  font: 700 15px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), box-shadow var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
html[data-theme="light"] .till__btn { color: var(--color-yellow-text); }
.till__btn:hover:not(:disabled) { background: color-mix(in oklab, var(--color-yellow) 18%, transparent); box-shadow: inset 0 0 0 1px var(--color-yellow); }
.till__btn:active:not(:disabled) { transform: scale(0.92); }
.till__btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.till__btn:disabled { color: var(--color-muted); background: transparent; opacity: 0.45; cursor: not-allowed; }
.till__qty { min-width: 20px; color: var(--color-ink); font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.till__order {
  display: flex;
  flex-direction: column;
  padding: var(--space-sm);
  border-radius: var(--radius-inner);
  background: color-mix(in oklab, var(--till-card) 60%, transparent);
  box-shadow: inset 0 0 0 1px var(--till-rule);
}
.till__currency {
  display: inline-flex;
  align-self: flex-start;
  gap: 2px;
  padding: 2px;
  margin-bottom: var(--space-xs);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1px var(--till-rule);
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
}
.till__currency span { padding: 2px var(--space-xs); border-radius: var(--radius-pill); }
.till__currency .is-on { background: var(--till-card); color: var(--color-ink); box-shadow: inset 0 0 0 1px var(--till-rule); }
.till__lines {
  display: flex;
  flex-direction: column;
  min-height: 7.5rem;
  max-height: 9.5rem;
  overflow-y: auto;
  scrollbar-width: thin;
}
.till__line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--till-rule);
}
.till__line.is-changed { animation: line-in 260ms var(--ease); }
.till__empty { margin: auto 0; color: var(--color-muted); text-align: center; }
.till__line > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.till__x { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.till__amt { font-weight: 600; font-variant-numeric: tabular-nums; }
.till__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: var(--space-sm);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
}
.till__pay {
  display: grid;
  place-items: center;
  min-height: 36px;
  margin-top: var(--space-xs);
  border: 0;
  border-radius: 8px;
  background: var(--color-yellow);
  color: var(--color-yellow-ink);
  font: 700 13px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.till__pay:hover:not(:disabled) { background: var(--color-yellow-hi); }
.till__pay:active:not(:disabled) { transform: translateY(1px); }
.till__pay:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.till__pay:disabled { background: var(--till-card); color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--till-rule); cursor: not-allowed; }
/* sale-complete panel: covers the order pane after Print / Submit */
.till__order { position: relative; }
.till__done {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: var(--space-md);
  border-radius: var(--radius-inner);
  background: var(--color-paper-2);
  box-shadow: inset 0 0 0 1px var(--till-rule);
  text-align: center;
  animation: done-in 240ms var(--ease) both;
}
.till__done[hidden] { display: none; }
.till__done-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: var(--space-2xs);
  border-radius: 50%;
  background: color-mix(in oklab, var(--color-sage) 18%, transparent);
  color: var(--color-sage);
}
.till__done-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.till__done-title { color: var(--color-sage); font-weight: 700; font-size: 13px; }
.till__done-amt { font: 600 24px/1.1 var(--font-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.till__done-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--space-md);
  margin: var(--space-xs) 0 var(--space-sm);
}
.till__done-meta div { display: grid; gap: 1px; }
.till__done-meta dt { color: var(--color-muted); font-size: 11px; }
.till__done-meta dd { margin: 0; font-weight: 600; font-size: 12px; font-variant-numeric: tabular-nums; }
.till__done-new {
  min-height: 32px;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  background: transparent;
  color: var(--color-ink);
  font: 600 12.5px/1 var(--font-body);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease);
}
.till__done-new:hover { background: color-mix(in oklab, var(--color-ink) 7%, transparent); }
.till__done-new:active { transform: translateY(1px); }
.till__done-new:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

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

/* ---------- Sign-in ---------- */
.signin {
  grid-area: signin;
  align-self: center;
  padding: var(--space-xl);
  animation: dusk-rise 560ms var(--ease) 80ms both;
}
.signin h2 {
  font-size: 1.75rem;
  line-height: 1.1;
  color: var(--color-ink);
}
.signin__lead {
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: 0.9375rem;
}
.signin form {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ---------- Fields ---------- */
.field { display: grid; gap: var(--space-xs); }
.field__label {
  color: var(--color-muted);
  font: 500 0.875rem/1.2 var(--font-body);
}
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--space-md);
  border: var(--rule-hair) solid var(--field-border);
  border-radius: var(--radius-inner);
  background: var(--field-bg);
  color: var(--color-ink);
  font: 400 1rem/1 var(--font-body);
  transition: border-color var(--dur-micro) var(--ease), background-color var(--dur-micro) var(--ease);
}
.field input::placeholder { color: color-mix(in oklab, var(--color-muted) 80%, transparent); }
.field input:hover { border-color: var(--field-border-hover); }
.field input:focus-visible,
.field input:focus {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
  background: var(--field-bg-focus);
}
.field input:user-invalid { border-color: color-mix(in oklab, var(--color-accent-2) 70%, transparent); }
.field input:disabled { opacity: 0.55; cursor: not-allowed; }
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--color-ink);
  caret-color: var(--color-ink);
  box-shadow: 0 0 0 1000px var(--color-paper-3) inset;
  transition: background-color 9999s;
}

/* ---------- The sign-in button: the Pockets yellow ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  width: 100%;
  min-height: 48px;
  margin-top: var(--space-xs);
  padding: 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-yellow);
  color: var(--color-yellow-ink);
  font: 700 0.9375rem/1 var(--font-body);
  cursor: pointer;
  box-shadow: inset 0 1px 0 color-mix(in oklab, var(--color-light) 35%, transparent);
  transition: background-color var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}
.btn:hover { background: var(--color-yellow-hi); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
  transition: none;
}
.btn:disabled,
.btn[aria-busy="true"] {
  background: color-mix(in oklab, var(--color-yellow) 55%, var(--color-paper-3));
  color: color-mix(in oklab, var(--color-yellow-ink) 75%, var(--color-muted));
  cursor: progress;
  transform: none;
  box-shadow: none;
}
.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in oklab, var(--color-yellow-ink) 30%, transparent);
  border-top-color: var(--color-yellow-ink);
  animation: dusk-spin 700ms linear infinite;
}
.btn[aria-busy="true"] .btn__spinner { display: inline-block; }

/* ---------- New to Pockets: call or WhatsApp, kept secondary to the sign-in ---------- */
.signin__new {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-rule);
}
.signin__new p { color: var(--color-muted); font-size: 0.875rem; }
.signin__contact { display: flex; gap: var(--space-xs); margin-top: var(--space-sm); }
.ghost {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 40px;
  padding: 0 var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-ink);
  font: 600 0.875rem/1 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), border-color var(--dur-micro) var(--ease);
}
.ghost:hover { background: color-mix(in oklab, var(--color-ink) 6%, transparent); border-color: var(--field-border-hover); }
.ghost:active { transform: translateY(1px); }
.ghost:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; transition: none; }
.ghost svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Modals: native <dialog> on a blurred backdrop; the logout sheet ps_scripts() injects matches ---------- */
.modal {
  width: calc(100% - 2 * var(--space-md));
  max-width: 26rem;
  max-height: calc(100svh - 2 * var(--space-lg));
  margin: auto;
  padding: var(--space-xl);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: var(--glass-hi), var(--shadow-card);
  overflow: auto;
}
.modal[open] { animation: modal-in 220ms var(--ease) both; }
.modal::backdrop {
  background: color-mix(in oklab, var(--color-shade) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal[open]::backdrop { animation: backdrop-in 220ms var(--ease) both; }
.modal h2 { padding-right: var(--space-xl); font-size: 1.375rem; line-height: 1.15; }
.modal p { margin-top: var(--space-xs); color: var(--color-muted); font-size: 0.9375rem; }
.modal__close-form { position: absolute; top: var(--space-sm); right: var(--space-sm); margin: 0; }
.modal__close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: background-color var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.modal__close:hover { background: color-mix(in oklab, var(--color-ink) 8%, transparent); color: var(--color-ink); }
.modal__close:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.modal__close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.modal__number {
  display: block;
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-inner);
  background: var(--color-paper);
  color: var(--color-ink);
  font: 600 1.5rem/1.1 var(--font-display);
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  text-align: center;
  text-decoration: none;
  user-select: all;
}
.modal__number:hover { border-color: var(--field-border-hover); }
.modal__number:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.modal__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-xs);
  margin-top: var(--space-md);
}
.modal__actions .ghost { min-height: 48px; white-space: nowrap; }
@media (max-width: 26rem) {
  .modal__actions { grid-template-columns: minmax(0, 1fr); }
  .modal__actions .modal__primary { order: -1; }
}
.modal__primary { margin-top: 0; text-decoration: none; }
.modal .modal__status { min-height: 1.4em; margin-top: var(--space-sm); color: var(--color-sage); font-size: 0.875rem; text-align: center; }

/* logout sheet from includes/ps_layout.php, in the same modal look */
.hm-dusk .ps-logout-overlay {
  background: color-mix(in oklab, var(--color-shade) 55%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.hm-dusk .ps-logout-sheet {
  width: calc(100% - 2 * var(--space-md));
  max-width: 24rem;
  padding: var(--space-xl);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--color-paper-2);
  color: var(--color-ink);
  box-shadow: var(--glass-hi), var(--shadow-card);
}
.hm-dusk .ps-logout-sheet h3 { margin: 0; font: var(--display-weight) 1.375rem/1.15 var(--font-display); letter-spacing: var(--tracking-display); }
.hm-dusk .ps-logout-hint { color: var(--color-muted); }
.hm-dusk .ps-logout-btn {
  min-height: 44px;
  border-radius: var(--radius-pill);
  font: 600 0.875rem/1 var(--font-body);
}
.hm-dusk .ps-logout-btn-secondary { border: 1px solid var(--color-rule); background: transparent; color: var(--color-ink); }
.hm-dusk .ps-logout-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- Notices: apricot is open, waiting or owed ---------- */
.notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-inner);
  background: color-mix(in oklab, var(--color-accent-2) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-accent-2) 30%, transparent);
  color: var(--notice-ink);
  font: 500 0.9375rem/1.45 var(--font-body);
}
.notice svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.notice + .notice { margin-top: var(--space-xs); }

/* ---------- Capabilities: a ruled row of what the product really does ---------- */
.caps {
  grid-area: caps;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-lg);
  margin: var(--space-sm) 0 0;
  padding: var(--space-lg) 0 0;
  border-top: 1px solid var(--color-rule);
  list-style: none;
}
.caps li { display: flex; gap: var(--space-sm); align-items: flex-start; min-width: 0; }
.caps svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html[data-theme="light"] .caps svg { stroke: var(--color-focus); }
.caps span { display: grid; gap: 2px; color: var(--color-muted); font-size: 0.875rem; line-height: 1.4; }
.caps strong { color: var(--color-ink); font-size: 0.9375rem; font-weight: 600; }

/* ---------- Foot ---------- */
.dusk__foot {
  padding-block: var(--space-md) var(--space-lg);
  color: var(--color-muted);
  font-size: 0.8125rem;
}

/* ---------- Medium: capabilities two by two ---------- */
@media (max-width: 75rem) {
  .caps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Narrow: the form right after the headline; the product after the facts ---------- */
@media (max-width: 60rem) {
  .dusk__stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "head" "signin" "caps" "till";
    row-gap: var(--space-xl);
    padding-block: var(--space-sm) var(--space-xl);
  }
  .signin { align-self: start; max-width: 30rem; width: 100%; }
}
@media (max-width: 36rem) {
  .signin { padding: var(--space-lg); }
  .dusk__head p { font-size: 1.0625rem; }
  .caps { grid-template-columns: minmax(0, 1fr); gap: var(--space-md); }
  .till { grid-template-columns: minmax(0, 1fr); }
  .dusk__logo { width: 128px; }
}

/* ---------- Motion ---------- */
@keyframes dusk-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes dusk-spin { to { transform: rotate(360deg); } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes done-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}
@keyframes line-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .signin, .till, .modal[open], .modal[open]::backdrop, .till__line.is-changed, .till__done { animation: none; }
  .btn__spinner { animation-duration: 2s; }
  .hm-dusk *, .hm-dusk *::before, .hm-dusk *::after { transition-duration: 0ms !important; }
}
