/* "Run the shop for a day": the playable Lefori Shopmaster demo (js/modules/shop-day.js).
   Everything is scoped to .sd so it can open over any page or fill the /try/ page.
   Layout: one phone-width column. The counter (customer) on top, the till below, the cart and
   payment buttons pinned to the bottom edge like the app's own sale screen. */

.sd {
  --sd-bg: #eef2f7;
  --sd-surface: #ffffff;
  --sd-surface-2: #f6f8fb;
  --sd-fg: #1c2a3f;
  --sd-muted: #5b6a80;
  --sd-line: #dde4ee;
  --sd-navy: #1a3862;
  --sd-orange: #f7941d;
  --sd-counter: #f4eadc;
  --sd-counter-edge: #e2cfb4;
  --sd-good: #15803d;
  --sd-good-soft: #dcf3e4;
  --sd-bad: #b4410f;
  --sd-bad-soft: #fde7da;
  --sd-wa: #128c4a;
  --sd-shadow: 0 10px 30px rgba(26, 56, 98, 0.12);
  --sd-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  background: var(--sd-bg);
  color: var(--sd-fg);
  font-family: var(--font, "Montserrat", system-ui, sans-serif);
  font-size: 15px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

.sd *,
.sd *::before,
.sd *::after {
  box-sizing: border-box;
}

/* Classes like .sd-sent set display, which would otherwise override the hidden attribute. */
.sd [hidden] {
  display: none !important;
}

/* Zero specificity, so every .sd-btn, .sd-opt and .sd-tile rule below can set its own weight and colour. */
:where(.sd) button {
  font: inherit;
  color: inherit;
}

/* Opened over a page: fills the screen and scrolls inside itself */
.sd--overlay {
  position: fixed;
  z-index: 2000;
  inset: 0;
  overflow-x: clip;
  overflow-y: auto;
  overscroll-behavior: contain;
}

html.sd-open {
  overflow: hidden;
}

/* On /try/: part of the page, under the site header */
.sd--page {
  min-height: calc(100vh - var(--nav-h, 64px));
  margin-top: var(--nav-h, 64px);
}

.sd-column {
  display: flex;
  flex-direction: column;
  max-width: 560px;
  min-height: 100%;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
  overflow-x: clip;
}

/* Top bar: the shop clock, the real stopwatch and (over a page) the close button */
.sd-top {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px)));
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: var(--sd-navy);
  color: #fff;
}

.sd--page .sd-top {
  top: var(--nav-h, 64px);
  padding-top: 10px;
}

.sd-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}

.sd-brand small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.75;
}

.sd-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #fff;
}

.sd-mark img {
  width: 18px;
  height: auto;
}

.sd-clocks {
  display: flex;
  gap: 8px;
  margin-left: auto;
  font-family: var(--sd-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sd-clocks span {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
}

.sd-clocks .sd-timer {
  background: var(--sd-orange);
  color: #1a1a1a;
  font-weight: 600;
}

.sd-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px !important;
  line-height: 1;
  cursor: pointer;
}

/* Progress: a stamp card, the first stamp already in */
.sd-stamps {
  display: flex;
  gap: 6px;
  padding-block: 12px 4px;
}

.sd-stamp {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--sd-line);
  transition: background 0.3s;
}

.sd-stamp.done {
  background: var(--sd-orange);
}

.sd-stamp.now {
  background: linear-gradient(90deg, var(--sd-orange) 50%, var(--sd-line) 50%);
}

.sd-stamps-label {
  display: flex;
  justify-content: space-between;
  color: var(--sd-muted);
  font-size: 12px;
  font-weight: 600;
}

.sd-screen {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 14px;
  padding-top: 12px;
}

/* Intro */
.sd-intro {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.sd-eyebrow {
  margin: 0;
  color: var(--sd-orange);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sd h1 {
  margin: 0;
  color: var(--sd-fg);
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.08;
  text-wrap: balance;
}

.sd-lead {
  max-width: 34ch;
  margin: 0;
  color: var(--sd-muted);
  font-size: 16px;
}

.sd-plan {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sd-plan li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface);
  font-size: 14px;
  font-weight: 600;
}

.sd-plan .sd-tick {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--sd-line);
  border-radius: 50%;
  font-size: 12px;
}

.sd-plan li.done {
  color: var(--sd-muted);
}

.sd-plan li.done .sd-tick {
  border-color: var(--sd-good);
  background: var(--sd-good);
  color: #fff;
}

.sd-plan time {
  margin-left: auto;
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 12px;
  font-weight: 500;
}

/* The kind of shop: picked on the intro, or replayed as another at the end */
.sd-shops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sd-shops-label {
  margin-right: 2px;
  color: var(--sd-muted);
  font-size: 13px;
  font-weight: 700;
}

.sd-shop {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--sd-line);
  border-radius: 999px;
  background: var(--sd-surface);
  color: var(--sd-fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.sd-shop[aria-pressed="true"] {
  border-color: var(--sd-navy);
  background: var(--sd-navy);
  color: #fff;
}

.sd-card .sd-shop[aria-pressed="false"]:hover,
.sd-intro .sd-shop[aria-pressed="false"]:hover {
  border-color: var(--sd-navy);
}

/* A friend's challenge and the result against it */
.sd-challenge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sd-navy);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.sd-challenge .sd-clock {
  flex: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--sd-orange);
  color: #1a1a1a;
  font-family: var(--sd-mono);
  font-size: 14px;
}

.sd-versus {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--sd-good-soft);
  color: var(--sd-good);
  font-weight: 700;
}

.sd-versus.behind {
  background: var(--sd-bad-soft);
  color: var(--sd-bad);
}

/* The counter: who is in front of you and what they said */
.sd-counter {
  position: relative;
  padding: 14px 14px 18px;
  border-bottom: 6px solid var(--sd-counter-edge);
  border-radius: 14px;
  background: var(--sd-counter);
}

.sd-customer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sd-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--sd-navy);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.sd-who {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.sd-who strong {
  font-size: 16px;
}

.sd-who span {
  color: var(--sd-muted);
  font-size: 12px;
  font-weight: 600;
}

.sd-bubble {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 4px 14px 14px 14px;
  background: var(--sd-surface);
  box-shadow: var(--sd-shadow);
  font-size: 15px;
  font-weight: 500;
}

.sd-bubble.reply {
  border-left: 4px solid var(--sd-bad);
}

.sd-order {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--sd-line);
  border-radius: 999px;
  background: var(--sd-surface);
  color: var(--sd-muted);
  font-size: 13px;
  font-weight: 600;
}

.sd-chip.ok {
  border-color: transparent;
  background: var(--sd-good-soft);
  color: var(--sd-good);
}

.sd-chip.over {
  border-color: transparent;
  background: var(--sd-bad-soft);
  color: var(--sd-bad);
}

.sd-pays {
  align-self: center;
  margin-left: auto;
  color: var(--sd-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.sd .arrive {
  animation: sd-arrive 0.35s ease-out;
}

@keyframes sd-arrive {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sd .shake {
  animation: sd-shake 0.35s;
}

@keyframes sd-shake {
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Alerts from the app (low stock, a bill, a delivery) */
.sd-alert {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--sd-orange);
  border-radius: 14px;
  background: var(--sd-surface);
  box-shadow: var(--sd-shadow);
}

.sd-alert h2 {
  margin: 0;
  font-size: 17px;
}

.sd-alert p {
  margin: 0;
  color: var(--sd-muted);
}

.sd-label {
  color: var(--sd-orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The till: a Lefori sale screen */
.sd-till {
  display: grid;
  gap: 8px;
}

.sd-till-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.sd-till-head h2 {
  margin: 0;
  color: var(--sd-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sd-till-head span {
  color: var(--sd-muted);
  font-size: 12px;
  text-align: right;
}

.sd-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (min-width: 520px) {
  .sd-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.sd-tile {
  display: grid;
  gap: 2px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface);
  text-align: left;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.15s;
}

.sd-tile:active {
  transform: scale(0.97);
}

.sd-tile:disabled {
  cursor: default;
}

.sd-tile b {
  font-size: 14px;
  line-height: 1.2;
}

.sd-tile .sd-price {
  font-family: var(--sd-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sd-tile .sd-stock {
  color: var(--sd-muted);
  font-size: 11px;
  font-weight: 600;
}

.sd-tile .sd-stock.low {
  color: var(--sd-bad);
}

.sd-tile.hint {
  border-color: var(--sd-orange);
  box-shadow: 0 0 0 2px var(--sd-orange) inset;
}

.sd-qty {
  justify-self: end;
  min-width: 22px;
  margin-top: -2px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--sd-orange);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.sd button:focus-visible,
.sd a:focus-visible {
  outline: 3px solid var(--sd-orange);
  outline-offset: 2px;
}

/* Cart and payment, pinned to the bottom like the app */
.sd-cartbar {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  gap: 10px;
  margin: 4px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 0;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--sd-line);
  background: var(--sd-surface);
  box-shadow: 0 -8px 24px rgba(26, 56, 98, 0.08);
}

.sd-lines {
  display: grid;
  gap: 4px;
  max-height: 96px;
  overflow-y: auto;
}

.sd-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.sd-line .sd-name {
  flex: 1;
  min-width: 0;
}

.sd-amt {
  font-family: var(--sd-mono);
  font-variant-numeric: tabular-nums;
}

.sd-minus {
  width: 28px;
  height: 28px;
  border: 1px solid var(--sd-line);
  border-radius: 50%;
  background: var(--sd-surface-2);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.sd-empty {
  color: var(--sd-muted);
  font-size: 13px;
}

.sd-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-weight: 700;
}

.sd-total .sd-amt {
  font-size: 20px;
}

.sd-paybtns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sd-two {
  grid-template-columns: 1fr 1fr;
}

.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.sd .sd-btn-primary {
  background: var(--sd-navy);
  color: #fff;
}

.sd .sd-btn-accent {
  background: var(--sd-orange);
  color: #1a1a1a;
}

.sd .sd-btn-ghost {
  border-color: var(--sd-line);
  background: var(--sd-surface-2);
  color: var(--sd-fg);
}

.sd .sd-btn-wa {
  background: var(--sd-wa);
  color: #fff;
}

.sd-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sd-btn-lg {
  min-height: 54px;
  font-size: 16px;
}

/* Bottom sheet for payments, receipts, the LPO, the expense, reports and the set-up request */
.sd-scrim {
  position: fixed;
  z-index: 2100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(10, 20, 35, 0.55);
}

.sd-sheet {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 88%;
  overflow-y: auto;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--sd-surface);
  animation: sd-up 0.25s ease-out;
}

@keyframes sd-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.sd-sheet h2 {
  margin: 0;
  font-size: 19px;
}

.sd-sheet p {
  margin: 0;
  color: var(--sd-muted);
}

.sd-opts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.sd-opt {
  min-height: 56px;
  border: 2px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface-2);
  font-family: var(--sd-mono) !important;
  font-size: 16px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.sd-opt.wrong,
.sd-cat.wrong,
.sd-acct.wrong {
  border-color: var(--sd-bad);
  color: var(--sd-bad);
}

.sd-list {
  display: grid;
  gap: 8px;
}

.sd-acct {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface-2);
  text-align: left;
  cursor: pointer;
}

.sd-acct .sd-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.sd-owes {
  margin-left: auto;
  color: var(--sd-muted);
  font-family: var(--sd-mono);
  font-size: 13px;
}

.sd-phone {
  padding: 12px;
  border: 1px dashed var(--sd-line);
  border-radius: 12px;
  background: var(--sd-surface-2);
  font-size: 14px;
}

.sd-phone small {
  display: block;
  margin-bottom: 4px;
  color: var(--sd-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sd-doc {
  padding: 14px;
  border: 1px solid var(--sd-line);
  border-radius: 6px;
  background: var(--sd-surface-2);
  font-family: var(--sd-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.sd-doc .r {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sd-doc .rule {
  margin: 6px 0;
  border-top: 1px dashed var(--sd-muted);
  opacity: 0.6;
}

.sd-doc .c {
  text-align: center;
}

.sd-doc-title {
  font-weight: 600;
  letter-spacing: 0.08em;
}

.sd-report-wrap {
  overflow-x: auto;
}

.sd-report {
  min-width: 300px;
  font-size: 12px;
}

.sd-report table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.sd-report th,
.sd-report td {
  padding: 2px 4px 2px 0;
  font-weight: 500;
  text-align: left;
  vertical-align: top;
}

.sd-report th {
  border-bottom: 1px dashed var(--sd-muted);
  font-weight: 600;
}

.sd-report .n {
  padding-right: 0;
  text-align: right;
}

.sd-report h3 {
  margin: 8px 0 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.sd-report.printing {
  animation: sd-feed 1.6s steps(16) both;
}

/* A receipt printing: the slip feeds out of the printer line by line */
.sd-doc.printing {
  animation: sd-feed 1.2s steps(12) both;
}

@keyframes sd-feed {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

.sd-sent {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sd-good);
  font-weight: 700;
}

.sd-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--sd-line);
  border-top-color: var(--sd-orange);
  border-radius: 50%;
  animation: sd-spin 0.8s linear infinite;
}

@keyframes sd-spin {
  to { transform: rotate(360deg); }
}

/* Forms: LPO quantity, expense category, set-up request, challenge name */
.sd-form {
  display: grid;
  gap: 12px;
}

.sd-form label,
.sd-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.sd-form label small {
  color: var(--sd-muted);
  font-weight: 600;
}

.sd-field > span {
  color: var(--sd-muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sd-input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface-2);
  color: var(--sd-fg);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}

.sd-input:focus {
  border-color: transparent;
  outline: 3px solid var(--sd-orange);
  outline-offset: 1px;
}

.sd-input[aria-invalid="true"] {
  border-color: var(--sd-bad);
}

.sd-err {
  margin: 0;
  color: var(--sd-bad) !important;
  font-size: 13px;
  font-weight: 600;
}

.sd-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

.sd-stepper .sd-minus {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.sd-stepper output {
  min-width: 48px;
  font-family: var(--sd-mono);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
}

.sd-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sd-cat {
  min-height: 48px;
  border: 2px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface-2);
  font-weight: 700;
  cursor: pointer;
}

/* Closing the day */
.sd-close-head {
  display: grid;
  gap: 6px;
}

.sd-badge {
  justify-self: start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sd-orange);
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 700;
}

.sd-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sd-stat {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--sd-line);
  border-radius: 12px;
  background: var(--sd-surface);
}

.sd-stat span {
  color: var(--sd-muted);
  font-size: 12px;
  font-weight: 600;
}

.sd-stat b {
  font-family: var(--sd-mono);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.sd-stat b.words {
  font-family: inherit;
  font-size: 16px;
}

.sd-stat.wide {
  grid-column: 1 / -1;
}

.sd-stat.warn b {
  color: var(--sd-bad);
}

.sd-stat.good b {
  color: var(--sd-good);
}

.sd-note {
  margin: 0;
  color: var(--sd-muted);
  font-size: 14px;
}

.sd-ctas {
  display: grid;
  gap: 8px;
}

.sd-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--sd-line);
  border-radius: 14px;
  background: var(--sd-surface);
}

.sd-card h2 {
  margin: 0;
  font-size: 17px;
}

.sd-card p {
  margin: 0;
  color: var(--sd-muted);
  font-size: 14px;
}

.sd-card.lead-card {
  border: 2px solid var(--sd-orange);
}

.sd-linkbox {
  display: block;
  padding: 10px 12px;
  border: 1px dashed var(--sd-line);
  border-radius: 8px;
  background: var(--sd-surface-2);
  font-family: var(--sd-mono);
  font-size: 12px;
  overflow-wrap: anywhere;
  user-select: all;
}

.sd-text-link {
  color: var(--sd-fg);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sd-contact {
  color: var(--sd-muted);
  font-size: 14px;
}

.sd-contact b {
  color: var(--sd-fg);
  font-family: var(--sd-mono);
  user-select: all;
}

.sd-foot {
  margin: 8px 0 0;
  color: var(--sd-muted);
  font-size: 12px;
  text-align: center;
}

.sd-toast {
  position: fixed;
  z-index: 2200;
  left: 50%;
  bottom: calc(150px + env(safe-area-inset-bottom, 0px));
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--sd-fg);
  box-shadow: var(--sd-shadow);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  transform: translateX(-50%);
}

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

/* The /try/ page: the game is the call to action, so the phone action bar steps aside */
html.sd-page .cta-bar,
html.sd-page .whatsapp-float,
html.sd-page .back-to-top {
  display: none !important;
}

html.sd-page body {
  padding-bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sd .arrive,
  .sd .shake,
  .sd-sheet,
  .sd-report.printing,
  .sd-doc.printing {
    animation: none;
  }

  .sd-tile,
  .sd-stamp {
    transition: none;
  }
}

/* ---------------------------------------------------------------- guidance */
/* "Next": one line in the pinned checkout bar that says what to do now. */
.sd-next {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--sd-surface-2);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.sd-next-label {
  flex: none;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--sd-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sd-next.ready .sd-next-label { background: var(--sd-good); }
.sd-next.warn .sd-next-label { background: var(--sd-bad); }

/* The button the step points at: payment method, or the receipt the customer asked for. */
.sd .sd-btn.hint {
  box-shadow: 0 0 0 3px var(--sd-orange);
  animation: sd-nudge 1.6s ease-in-out infinite;
}

@keyframes sd-nudge {
  0%, 100% { box-shadow: 0 0 0 3px var(--sd-orange); }
  50% { box-shadow: 0 0 0 6px rgba(247, 148, 29, 0.35); }
}

@media (prefers-reduced-motion: reduce) {
  .sd .sd-btn.hint { animation: none; }
}

.sd-ask {
  margin: -4px 0 12px;
  padding: 8px 10px;
  border-left: 3px solid var(--sd-orange);
  background: var(--sd-surface-2);
  font-weight: 600;
}

.sd-plan-label {
  margin: 20px 0 6px;
  color: var(--sd-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Phones: three tiles to a row so the whole shelf sits above the checkout bar,
   and what is in the cart wraps as small pills instead of one row per item. */
@media (max-width: 519px) {
  .sd-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .sd-tile {
    min-height: 0;
    padding: 6px 8px;
    gap: 1px;
  }

  .sd-tile b {
    line-height: 1.15;
  }

  .sd-tile b {
    font-size: 13px;
  }

  .sd-tile .sd-price {
    font-size: 12px;
  }

  /* One fixed height: the next step, then cart pills and total on one row, then the pay buttons. */
  .sd-cartbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "next next" "lines total" "pay pay";
    gap: 8px 12px;
    padding-top: 10px;
  }

  .sd-next { grid-area: next; }
  .sd-total { grid-area: total; gap: 8px; }
  .sd-total .sd-amt { font-size: 18px; }
  .sd-cartbar > .sd-paybtns { grid-area: pay; }

  .sd-lines {
    grid-area: lines;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    max-height: none;
    min-height: 30px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .sd-line { flex: none; }

  .sd-line {
    gap: 6px;
    padding: 2px 10px 2px 2px;
    border: 1px solid var(--sd-line);
    border-radius: 999px;
    font-size: 13px;
  }

  .sd-line .sd-name {
    flex: none;
  }

  .sd-line .sd-amt {
    display: none;
  }

  .sd-minus {
    width: 26px;
    height: 26px;
  }
}
