/* ==========================================================================
   ScopeSky Wallet — sandbox demo
   Palette sampled from the official ScopeSky mark and carried over from the
   AiiACo design reference (index.html). One screen, one decision.
   ========================================================================== */

:root {
  --navy: #004969;
  --deep: #082d42;
  --blue: #0078ad;
  --sky: #0094da;
  --pale: #eaf7fd;
  --ink: #0a2b3d;
  --muted: #5c7688;
  --muted-2: #87a0b0;
  --line: #dfeaf1;
  --line-soft: #edf4f8;
  --bg: #f5f9fb;
  --card: #ffffff;
  --ok: #0c8a5f;
  --warn: #a8431f;

  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  --sh-1: 0 1px 2px rgba(8, 45, 66, 0.05);
  --sh-2: 0 12px 32px -18px rgba(8, 45, 66, 0.35);
  --sh-3: 0 30px 70px -35px rgba(8, 45, 66, 0.45);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

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

/* --------------------------------------------------------------------------
   Stage: a phone on mobile, a phone on a desk on desktop
   -------------------------------------------------------------------------- */

.stage {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 0;
  background:
    radial-gradient(900px 520px at 50% -8%, #e8f6fd 0%, rgba(245, 249, 251, 0) 70%),
    var(--bg);
}

.frame {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.stage-note { display: none; }

@media (min-width: 900px) {
  .stage { padding: 40px 24px; gap: 22px; }

  .frame {
    height: min(848px, calc(100dvh - 120px));
    max-width: 402px;
    border-radius: 46px;
    box-shadow:
      0 0 0 1px rgba(8, 45, 66, 0.07),
      0 2px 4px rgba(8, 45, 66, 0.04),
      0 40px 90px -40px rgba(8, 45, 66, 0.5);
    background: var(--card);
  }

  .stage-note {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--muted);
  }

  .stage-note a {
    color: var(--navy);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 73, 105, 0.25);
    padding-bottom: 1px;
  }

  .stage-note a:hover { border-bottom-color: var(--navy); }
  .stage-note .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 58px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  flex: 0 0 auto;
  background: rgba(245, 249, 251, 0.86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s var(--ease);
}

.topbar.is-scrolled { border-bottom-color: var(--line-soft); }

.topbar.is-inner {
  background: rgba(245, 249, 251, 0.92);
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -8px;
  border-radius: 50%;
  color: var(--navy);
  transition: background 0.16s var(--ease);
}

.iconbtn:hover { background: rgba(0, 148, 218, 0.09); }
.iconbtn:active { background: rgba(0, 148, 218, 0.16); }
.iconbtn svg { width: 22px; height: 22px; }

.topbar-title {
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.012em;
  color: var(--ink);
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }

.brand img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  border-radius: 8px;
}

.brand span {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.brand span em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--pale);
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 148, 218, 0.18);
}

/* --------------------------------------------------------------------------
   Screens
   -------------------------------------------------------------------------- */

.screen {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px calc(28px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.screen::-webkit-scrollbar { display: none; }

.screen.enter > * { animation: rise 0.34s var(--ease) both; }
.screen.enter > *:nth-child(1) { animation-delay: 0.01s; }
.screen.enter > *:nth-child(2) { animation-delay: 0.04s; }
.screen.enter > *:nth-child(3) { animation-delay: 0.07s; }
.screen.enter > *:nth-child(4) { animation-delay: 0.1s; }
.screen.enter > *:nth-child(5) { animation-delay: 0.13s; }
.screen.enter > *:nth-child(6) { animation-delay: 0.16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

/* Navigation row on inner screens */
.navrow {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 46px;
  margin-left: -8px;
}

.navrow button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 10px 0 6px;
  border-radius: 10px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 550;
  transition: background 0.16s var(--ease);
}

.navrow button:hover { background: rgba(0, 148, 218, 0.08); }
.navrow button:active { background: rgba(0, 148, 218, 0.14); }
.navrow svg { width: 20px; height: 20px; }

.title {
  font-size: 30px;
  line-height: 1.14;
  letter-spacing: -0.032em;
  font-weight: 680;
  color: var(--ink);
  margin: 6px 0 6px;
}

.lede {
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
  letter-spacing: -0.005em;
}

.section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 30px 0 10px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.section-label button {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--blue);
}

/* --------------------------------------------------------------------------
   Balance
   -------------------------------------------------------------------------- */

.balance-block { padding: 18px 0 4px; }

.balance-label {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  letter-spacing: 0.005em;
}

.balance-amount {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.balance-amount strong {
  font-size: 52px;
  line-height: 1.04;
  font-weight: 640;
  letter-spacing: -0.045em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.balance-amount span {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: 0.01em;
}

.balance-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  min-height: 19px;
}

/* --------------------------------------------------------------------------
   Context card — the one thing worth doing next
   -------------------------------------------------------------------------- */

.context {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 20px;
  padding: 16px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.context:hover { border-color: #cfe3ee; box-shadow: var(--sh-2); }
.context:active { transform: scale(0.988); }

.context .glyph {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--pale);
  color: var(--navy);
}

.context .glyph svg { width: 21px; height: 21px; }
.context .glyph.ok { background: #e8f7f0; color: var(--ok); }

.context .body { flex: 1 1 auto; min-width: 0; }

.context .kicker {
  display: block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.context .headline {
  display: block;
  font-size: 15.5px;
  font-weight: 620;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin-top: 2px;
}

.context .sub {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 1px;
}

.context .chev { color: var(--muted-2); flex: 0 0 auto; }
.context .chev svg { width: 18px; height: 18px; display: block; }

/* --------------------------------------------------------------------------
   Action grid
   -------------------------------------------------------------------------- */

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 22px;
}

.action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 2px 8px;
  border-radius: var(--r-md);
  transition: background 0.16s var(--ease);
}

.action:hover { background: rgba(0, 148, 218, 0.06); }
.action:active .ring { transform: scale(0.94); }

.action .ring {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pale);
  color: var(--navy);
  transition: transform 0.16s var(--ease);
}

.action .ring svg { width: 22px; height: 22px; }

.action span {
  font-size: 12px;
  font-weight: 580;
  letter-spacing: -0.005em;
  color: var(--navy);
  text-align: center;
  line-height: 1.25;
}

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

.list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.list > li + li { border-top: 1px solid var(--line-soft); }

.row {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  transition: background 0.14s var(--ease);
}

.row:hover { background: #fbfdfe; }
.row:active { background: #f4fafd; }

.row .glyph {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--pale);
  color: var(--navy);
}

.row .glyph svg { width: 18px; height: 18px; }
.row .glyph.in { background: #e8f7f0; color: var(--ok); }
.row .glyph.out { background: #fdf1ec; color: #b0532c; }
.row .glyph.neutral { background: #f0f4f7; color: var(--muted); }

.row .body { flex: 1 1 auto; min-width: 0; }

.row .line1 {
  display: block;
  font-size: 15px;
  font-weight: 580;
  letter-spacing: -0.012em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .line2 {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row .amount {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--ink);
}

.row .amount.in { color: var(--ok); }
.row .amount.pending { color: var(--muted-2); }

.row .chev { color: var(--muted-2); }
.row .chev svg { width: 17px; height: 17px; display: block; }

/* Choice rows (amounts, recipients) */
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 18px 18px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: transform 0.14s var(--ease), border-color 0.14s var(--ease);
}

.choice + .choice { margin-top: 10px; }
.choice:hover { border-color: #cde2ee; }
.choice:active { transform: scale(0.99); }

.choice .label {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  font-variant-numeric: tabular-nums;
}

.choice .hint { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.choice .chev { color: var(--muted-2); }
.choice .chev svg { width: 18px; height: 18px; display: block; }

.choice.is-muted { background: transparent; border-style: dashed; box-shadow: none; }
.choice.is-muted .label { font-weight: 550; color: var(--navy); }

/* Empty state */
.empty {
  padding: 26px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-size: 16.5px;
  font-weight: 620;
  letter-spacing: -0.012em;
  transition: transform 0.14s var(--ease), background 0.16s var(--ease),
    opacity 0.16s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.btn:active { transform: scale(0.982); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

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

.btn-soft { background: var(--pale); color: var(--navy); }
.btn-soft:hover { background: #ddf1fb; }

.btn-quiet {
  min-height: 46px;
  background: transparent;
  color: var(--muted);
  font-weight: 550;
  font-size: 14.5px;
}

.btn-quiet:hover { color: var(--navy); }

.btn-danger-quiet { color: var(--muted); font-size: 14px; font-weight: 520; }
.btn-danger-quiet:hover { color: var(--warn); }

.actions-stack { display: grid; gap: 10px; margin-top: 26px; }

.footnote {
  margin-top: 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted-2);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Amount entry
   -------------------------------------------------------------------------- */

.amount-entry {
  margin: 22px 0 0;
  padding: 22px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  text-align: center;
}

.amount-entry .field {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.amount-entry input {
  width: 100%;
  max-width: 240px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 40px;
  font-weight: 620;
  letter-spacing: -0.04em;
  text-align: right;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.amount-entry input::-webkit-outer-spin-button,
.amount-entry input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.amount-entry .unit {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-2);
}

.amount-entry .hint { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.error-text {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--warn);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Code card — the handshake between phone and counter
   -------------------------------------------------------------------------- */

.code-card {
  margin-top: 20px;
  padding: 26px 20px 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  text-align: center;
}

.code-card .shop {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.code-card .shop strong { color: var(--navy); font-weight: 650; }

.code-digits {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px 0 6px;
}

.code-digits span {
  width: 56px;
  height: 70px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--pale);
  color: var(--navy);
  font-size: 38px;
  font-weight: 620;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.code-amount {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--ink);
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

.code-instruction {
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 4px;
}

.waiting {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #f2f8fc;
  color: var(--navy);
  font-size: 13px;
  font-weight: 550;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sky);
  position: relative;
}

.pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--sky);
  opacity: 0.45;
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.7); opacity: 0.5; }
  70% { transform: scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}

/* --------------------------------------------------------------------------
   Bill card
   -------------------------------------------------------------------------- */

.bill-card {
  margin-top: 20px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}

.bill-card .top { display: flex; align-items: center; gap: 13px; }

.bill-card .mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--pale); color: var(--navy);
}
.bill-card .mark svg { width: 22px; height: 22px; }

.bill-card .plan { display: block; font-size: 15.5px; font-weight: 620; letter-spacing: -0.012em; }
.bill-card .meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

.bill-card hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 16px 0;
}

.bill-card .due { display: flex; align-items: baseline; justify-content: space-between; }
.bill-card .due .label { font-size: 13px; color: var(--muted); }

.bill-card .due .value {
  font-size: 30px;
  font-weight: 630;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.bill-card .due .value small { font-size: 13px; font-weight: 600; color: var(--muted-2); margin-left: 4px; letter-spacing: 0; }

.bill-card .facts {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  font-size: 13px;
}

.bill-card .facts div { display: flex; justify-content: space-between; gap: 12px; }
.bill-card .facts dt { color: var(--muted); }
.bill-card .facts dd { margin: 0; color: var(--ink); font-weight: 550; text-align: right; }

/* --------------------------------------------------------------------------
   Sheets
   -------------------------------------------------------------------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 29, 42, 0.34);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s var(--ease);
  z-index: 70;
}

.sheet-backdrop.is-open { opacity: 1; }

.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(440px, 100%);
  transform: translate(-50%, 102%);
  background: var(--card);
  border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px -20px rgba(8, 45, 66, 0.45);
  transition: transform 0.34s var(--ease);
  z-index: 71;
}

.sheet.is-open { transform: translate(-50%, 0); }

.sheet .grab {
  width: 38px; height: 4px; border-radius: 99px;
  background: #d9e5ed; margin: 6px auto 16px;
}

.sheet h2 {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.sheet p { font-size: 14px; color: var(--muted); line-height: 1.5; }

.sheet .sheet-actions { display: grid; gap: 8px; margin-top: 20px; }

.sheet .receipt-lines {
  margin: 18px 0 4px;
  display: grid;
  gap: 11px;
  font-size: 13.5px;
}

.sheet .receipt-lines div { display: flex; justify-content: space-between; gap: 16px; }
.sheet .receipt-lines dt { color: var(--muted); }
.sheet .receipt-lines dd { margin: 0; font-weight: 550; text-align: right; font-variant-numeric: tabular-nums; }

.sheet .receipt-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.sheet .receipt-total strong {
  font-size: 26px;
  font-weight: 640;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   Success overlay
   -------------------------------------------------------------------------- */

.success {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 32px 24px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  text-align: center;
  animation: fade 0.28s var(--ease) both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.success .check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e6f6ef;
  color: var(--ok);
  animation: pop 0.42s var(--ease) both;
}

.success .check svg { width: 36px; height: 36px; }
.success .check svg path {
  stroke-dasharray: 26;
  stroke-dashoffset: 26;
  animation: draw 0.42s var(--ease) 0.16s forwards;
}

@keyframes pop { from { transform: scale(0.86); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.success .kicker {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.success .amount {
  margin-top: 8px;
  font-size: 40px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.success .detail {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.5;
}

.success .new-balance {
  margin-top: 26px;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--muted);
}

.success .new-balance strong { color: var(--ink); font-weight: 620; font-variant-numeric: tabular-nums; }

.success .success-actions .btn-quiet { font-size: 14px; font-weight: 520; }
.success .success-actions {
  margin-top: 30px;
  width: 100%;
  max-width: 320px;
  display: grid;
  gap: 8px;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  max-width: min(400px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(10, 43, 61, 0.94);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  z-index: 90;
  backdrop-filter: blur(8px);
}

.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Demo footer link
   -------------------------------------------------------------------------- */

.demo-foot {
  margin: 30px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted-2);
  letter-spacing: 0.01em;
}

.demo-foot button {
  color: var(--muted-2);
  font-size: 11.5px;
  text-decoration: underline;
  text-decoration-color: rgba(135, 160, 176, 0.5);
  text-underline-offset: 3px;
}

.demo-foot button:hover { color: var(--navy); }

/* ==========================================================================
   Counter view
   ========================================================================== */

.counter-page {
  min-height: 100dvh;
  background:
    radial-gradient(900px 460px at 50% -12%, #e8f6fd 0%, rgba(245, 249, 251, 0) 72%),
    var(--bg);
  padding: 0 0 40px;
}

.counter-wrap {
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.counter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 0 6px;
}

.counter-top .who { display: flex; align-items: center; gap: 11px; }
.counter-top .who img { width: 32px; height: 32px; object-fit: contain; border-radius: 9px; }
.counter-top .who div { line-height: 1.25; }
.counter-top .who strong { display: block; font-size: 14.5px; font-weight: 640; letter-spacing: -0.012em; }
.counter-top .who span { font-size: 12px; color: var(--muted); }

.counter-top a {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--navy);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(0, 73, 105, 0.06);
}

.counter-top a:hover { background: rgba(0, 73, 105, 0.1); }

.counter-title {
  font-size: 32px;
  font-weight: 680;
  letter-spacing: -0.035em;
  margin: 18px 0 4px;
}

.drawer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.drawer div {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
}

.drawer span { display: block; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); font-weight: 650; }
.drawer strong { display: block; font-size: 16px; font-weight: 620; letter-spacing: -0.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }

.counter-modes { display: grid; gap: 10px; margin-top: 18px; }

.mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--navy);
  color: #fff;
  text-align: left;
  transition: transform 0.14s var(--ease), background 0.16s var(--ease);
}

.mode-btn:hover { background: #005b83; }
.mode-btn:active { transform: scale(0.99); }

.mode-btn.soft { background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--sh-1); }
.mode-btn.soft:hover { background: #fbfdfe; }

.mode-btn .glyph {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}
.mode-btn.soft .glyph { background: var(--pale); color: var(--navy); }
.mode-btn .glyph svg { width: 20px; height: 20px; }
.mode-btn > svg { width: 19px; height: 19px; opacity: 0.55; flex: 0 0 auto; }
.mode-btn.soft > svg { opacity: 0.35; }

.mode-btn .txt { flex: 1 1 auto; }
.mode-btn .txt strong { display: block; font-size: 16px; font-weight: 620; letter-spacing: -0.015em; }
.mode-btn .txt span { display: block; font-size: 12.5px; opacity: 0.78; margin-top: 2px; }
.mode-btn.soft .txt span { color: var(--muted); opacity: 1; }

.keypad-wrap { margin-top: 20px; }

.code-slots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 6px 0 20px;
}

.code-slots span {
  width: 58px; height: 68px;
  border-radius: 16px;
  border: 1.5px solid var(--line);
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 620;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.code-slots span.filled { border-color: var(--sky); background: var(--pale); color: var(--navy); }
.code-slots span.active { border-color: var(--sky); box-shadow: 0 0 0 4px rgba(0, 148, 218, 0.12); }

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.keypad button {
  height: 60px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 23px;
  font-weight: 550;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: background 0.12s var(--ease), transform 0.1s var(--ease);
}

.keypad button:hover { background: #f7fbfd; }
.keypad button:active { transform: scale(0.97); background: var(--pale); }
.keypad button.ghost { background: transparent; border-color: transparent; font-size: 14px; color: var(--muted); font-weight: 550; }

.keypad button svg { width: 22px; height: 22px; margin: 0 auto; display: block; }

.code-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}

.code-chip .digits { display: flex; gap: 8px; }

.code-chip .digits b {
  display: grid;
  place-items: center;
  width: 38px;
  height: 44px;
  border-radius: 10px;
  background: var(--pale);
  color: var(--navy);
  font-size: 21px;
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

.code-chip .change {
  font-size: 13.5px;
  font-weight: 560;
  color: var(--blue);
  padding: 8px 10px;
  border-radius: 9px;
}

.code-chip .change:hover { background: rgba(0, 148, 218, 0.08); }

.lookup-card {
  margin-top: 18px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  animation: rise 0.28s var(--ease) both;
}

.lookup-card .who { display: flex; align-items: center; gap: 13px; }
.lookup-card .avatar { width: 44px; height: 44px; font-size: 15px; }

.lookup-card .kind {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.lookup-card .amount {
  font-size: 34px;
  font-weight: 640;
  letter-spacing: -0.038em;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}

.lookup-card .amount small { font-size: 14px; font-weight: 600; color: var(--muted-2); margin-left: 5px; letter-spacing: 0; }

.lookup-card .after {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.lookup-card .cta { margin-top: 18px; display: grid; gap: 8px; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7f3;
  color: #8f3f1e;
  font-size: 13px;
  line-height: 1.45;
}

.banner svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }
.banner.ok { background: #eefaf4; color: #0a6a4a; }
.banner.info { background: #eff8fd; color: var(--navy); }

.pending-list { margin-top: 10px; }

.pending-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  border-top: 1px solid var(--line-soft);
  transition: background 0.14s var(--ease);
}

.pending-item:first-child { border-top: 0; }
.pending-item:hover { background: #fbfdfe; }

.pending-item .code {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
  width: 62px;
}

.pending-item .txt { flex: 1 1 auto; }
.pending-item .txt strong { display: block; font-size: 13.5px; font-weight: 580; }
.pending-item .txt span { font-size: 12px; color: var(--muted); }
.pending-item .amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pending-item .chev { color: var(--muted-2); display: grid; place-items: center; }
.pending-item .chev svg { width: 17px; height: 17px; display: block; }

.shop-receipt {
  margin-top: 18px;
  padding: 24px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  text-align: center;
  animation: rise 0.3s var(--ease) both;
}

.shop-receipt .check {
  width: 58px; height: 58px; border-radius: 50%;
  margin: 0 auto;
  display: grid; place-items: center;
  background: #e6f6ef; color: var(--ok);
}

.shop-receipt .check svg { width: 28px; height: 28px; }

.shop-receipt .action {
  margin-top: 16px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.shop-receipt .amt {
  margin-top: 4px;
  font-size: 36px;
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.shop-receipt .amt small { font-size: 14px; color: var(--muted-2); margin-left: 5px; letter-spacing: 0; }

.shop-receipt .lines {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  gap: 9px;
  font-size: 13px;
  text-align: left;
}

.shop-receipt .lines div { display: flex; justify-content: space-between; gap: 14px; }
.shop-receipt .lines dt { color: var(--muted); }
.shop-receipt .lines dd { margin: 0; font-weight: 550; font-variant-numeric: tabular-nums; }

.shop-receipt .cta { margin-top: 20px; display: grid; gap: 8px; }

/* ==========================================================================
   Presenter console
   ========================================================================== */

.presenter-page {
  min-height: 100dvh;
  background: var(--bg);
  padding: 0 0 60px;
}

.presenter-wrap { width: min(880px, 100%); margin: 0 auto; padding: 0 24px; }

.presenter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 0 0;
  flex-wrap: wrap;
}

.presenter-top .who { display: flex; align-items: center; gap: 12px; }
.presenter-top .who img { width: 38px; height: 38px; object-fit: contain; border-radius: 10px; }
.presenter-top .who strong { display: block; font-size: 15px; font-weight: 640; letter-spacing: -0.015em; }
.presenter-top .who span { font-size: 12.5px; color: var(--muted); }

.presenter-top nav { display: flex; gap: 8px; flex-wrap: wrap; }

.presenter-top nav a {
  font-size: 13px;
  font-weight: 560;
  text-decoration: none;
  color: var(--navy);
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
}

.presenter-top nav a:hover { border-color: #c9e0ed; }

.presenter-page h1 {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 680;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin: 30px 0 8px;
}

.presenter-page .sub { font-size: 15px; color: var(--muted); max-width: 620px; line-height: 1.55; }

.pgrid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; margin-top: 26px; }

@media (max-width: 820px) {
  .pgrid { grid-template-columns: 1fr; }
  .presenter-wrap { padding: 0 16px; }
}

.pcard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--sh-1);
}

.pcard h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 14px;
}

.balance-live {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.balance-live strong {
  font-size: 46px;
  font-weight: 650;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.balance-live span { font-size: 14px; font-weight: 600; color: var(--muted-2); }

.steps { display: grid; gap: 0; margin-top: 16px; }

.step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 13.5px;
}

.step:first-child { border-top: 0; }

.step .tick {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  border-radius: 50%;
  border: 1.5px solid #cfe0e9;
  display: grid; place-items: center;
  margin-top: 1px;
  color: transparent;
  transition: all 0.25s var(--ease);
}

.step .tick svg { width: 12px; height: 12px; }

.step.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.done .label strong { color: var(--muted); }

.step .label strong { display: block; font-weight: 590; }
.step .label span { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.pbtns { display: grid; gap: 8px; margin-top: 18px; }
.pbtns .btn { min-height: 46px; font-size: 14.5px; }

.ledger-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ledger-table th {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 700;
  padding: 0 0 8px;
}
.ledger-table td { padding: 8px 0; border-top: 1px solid var(--line-soft); }
.ledger-table td:last-child, .ledger-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-table tr.total td { border-top: 1.5px solid var(--line); font-weight: 650; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.chip svg { width: 13px; height: 13px; flex: 0 0 auto; }
.chip.ok { background: #e8f7f0; color: #0a6a4a; }
.chip.bad { background: #fdeee8; color: #a8431f; }
.chip.info { background: var(--pale); color: var(--navy); }

.runsheet { margin-top: 18px; }
.runsheet ol { margin: 0; padding-left: 20px; display: grid; gap: 12px; font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.runsheet ol strong { color: var(--ink); font-weight: 600; }

.runsheet .say {
  display: block;
  margin-top: 4px;
  padding-left: 10px;
  border-left: 2px solid var(--pale);
  color: var(--navy);
  font-style: italic;
}

.sim-note {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: #fff9f4;
  border: 1px solid #f3e0d2;
  font-size: 12.5px;
  line-height: 1.55;
  color: #8a4a2b;
}

.presenter-page footer {
  margin-top: 34px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
