﻿:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Shared horizontal gutter for every screen */
  --page-x: var(--space-4);

  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  --transition-interactive: 200ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --font-display: 'Switzer', 'Inter', 'Segoe UI', sans-serif;
  --font-body: 'Switzer', 'Inter', 'Segoe UI', sans-serif;
  --font-num: 'Switzer', 'Inter', sans-serif;
}

/* ---------- THEME (ivory dial, light only) ---------- */
:root {
  --bg: #f4f2ec;
  --surface: #fffefb;
  --surface-2: #faf8f2;
  --surface-3: #f0ede3;
  --surface-inset: #eae7dd;
  --border: #ddd8ca;
  --border-soft: #e7e3d7;

  --text: #131c2c;
  --text-muted: #5d6a80;
  --text-faint: #94a0b2;
  --text-on-gold: #1a1206;

  --gold: #9a7712;
  --gold-bright: #b58c19;
  --gold-soft: #6b5309;
  --gold-wash: rgba(154, 119, 18, 0.1);
  --gold-line: rgba(154, 119, 18, 0.28);

  /* Lighter gold fills for solid backgrounds that carry dark text/icons on top
     (scan icons, points hero, primary CTA) — kept separate from --gold/--gold-bright
     so foreground text/icon uses of gold elsewhere are untouched. */
  --gold-fill-1: #f2d67e;
  --gold-fill-2: #e0ba52;
  --gold-fill-3: #cfa23a;

  --success: #1c7d5c;
  --success-wash: rgba(28, 125, 92, 0.1);
  --danger: #b8342d;
  --danger-wash: rgba(184, 52, 45, 0.1);
  --info: #2c6799;
  --info-wash: rgba(44, 103, 153, 0.1);

  --shadow-sm: 0 1px 2px rgba(30, 25, 10, 0.06);
  --shadow-md: 0 8px 22px rgba(30, 25, 10, 0.09);
  --shadow-lg: 0 20px 44px rgba(30, 25, 10, 0.14);
  --sheen: linear-gradient(150deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 60%);
}

/* ============================================================
   Titan IBS — Partner PWA (demo)
   Art direction: "Midnight & Gold" — navy lacquer dial, gold indices
   ============================================================ */


/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  width: 100%;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  width: 100%;
  max-width: 100vw;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: var(--app-vh, 100dvh);
  overflow: hidden;
}
img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
h1,
h2,
h3,
h4 {
  line-height: 1.2;
  text-wrap: balance;
  font-weight: 600;
}
a {
  color: var(--gold);
  text-decoration: none;
}
::selection {
  background: var(--gold-wash);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
.tnum {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* ============================================================
   DESKTOP STAGE + PHONE FRAME
   ============================================================ */
.stage {
  min-height: var(--app-vh, 100dvh);
  display: grid;
  place-items: center;
  padding: var(--space-8) var(--space-6);
  background: #ffffff;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}
.stage-grid {
  display: grid;
  place-items: center;
  width: 100%;
  margin-inline: auto;
}

.device {
  position: relative;
  width: 402px;
  height: 844px;
  flex: 0 0 auto;
  margin-inline: auto;
  border-radius: 56px;
  padding: 13px;
  background: linear-gradient(155deg, #46536e 0%, #131b2c 38%, #0a1120 72%, #3b4760 100%);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.07),
    var(--shadow-lg),
    0 60px 90px -40px rgba(0, 0, 0, 0.7);
}
.device::after {
  /* dynamic island */
  content: '';
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 104px;
  height: 26px;
  background: #05080f;
  border-radius: var(--radius-full);
  z-index: 60;
  pointer-events: none;
}
.viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border-radius: 44px;
  overflow: hidden;
  background: var(--bg);
  isolation: isolate;
}

@media (max-width: 900px) {
  .stage {
    padding: 0;
    display: block;
    background: var(--bg);
  }
  .stage-grid {
    display: block;
    max-width: none;
  }
  .device {
    width: 100%;
    height: var(--app-vh, 100dvh);
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: var(--bg);
  }
  .device::after {
    display: none;
  }
  .viewport {
    border-radius: 0;
  }
}

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  background: var(--bg);
}
/* Each shell child is pinned to its own row. Without this, hiding the
   install banner shifts the tab bar up into the flexible row, which
   stretches it far taller than its content and strands the icons. */
.app > .topbar {
  grid-row: 1;
}
.app > .install-banner {
  grid-row: 2;
}
.app > .store-context-bar {
  grid-row: 3;
}
.app > .screen {
  grid-row: 4;
}
.app > .tabbar {
  grid-row: 5;
}
.app.is-auth {
  grid-template-rows: minmax(0, 1fr);
}
.app.is-auth > .screen {
  grid-row: 1;
}
/* ABM shell: topbar + screen only, no install banner and no tab bar. */
.app.is-abm {
  grid-template-rows: auto minmax(0, 1fr);
}
.app.is-abm > .screen {
  grid-row: 2;
}

.install-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--gold-wash);
  border-bottom: 1px solid var(--gold-line);
  position: relative;
  z-index: 15;
}
.install-banner[hidden] {
  display: none;
}
.install-banner-ico {
  width: 35px;
  height: 35px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--gold-fill-1), var(--gold-fill-3));
  color: var(--text-on-gold);
  padding:5px;
}
.install-banner-copy {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 1px;
}
.install-banner-copy b {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text);
}
.install-banner-copy span {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
}
.install-banner-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-faint);
}
.install-banner-close:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* --- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: calc(var(--space-4) + 28px) var(--page-x) var(--space-3);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  z-index: 20;
}
@media (max-width: 900px) {
  .topbar {
    padding-top: max(var(--space-4), env(safe-area-inset-top));
  }
}
.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}
.topbar-title strong {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-title span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--transition-interactive);
}
/*.icon-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border);
}*/
.brand-mark {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.brand-mark svg {
  color: var(--gold);
  flex: 0 0 auto;
}
/* Real Titan marks: white PNG artwork (base64 in logo.js) applied as a mask so the
   glyph takes the current text colour — gold on the dark theme, navy on the light one. */
.titan-mark,
.titan-word {
  display: block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.titan-mark {
  width: 22px;
  height: 20px;
  -webkit-mask-image: var(--logo-mark);
  mask-image: var(--logo-mark);
}
.titan-word {
  width: 132px;
  height: 19px;
  -webkit-mask-image: var(--logo-word);
  mask-image: var(--logo-word);
}
.brand-mark .titan-mark {
  color: var(--gold);
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}
.wordmark b {
  font-weight: 600;
}
.wordmark i {
  font-style: normal;
  color: var(--gold);
}

/* --- scroll area --- */
.screen {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.screen::-webkit-scrollbar {
  width: 5px;
}
.screen::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 9px;
}
.pad {
  padding: var(--space-4) var(--page-x) var(--space-8);
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
.view {
  display: none;
  animation: viewIn 320ms var(--ease-out) both;
}
.view.is-active {
  display: block;
}
.auth.is-active {
  display: grid;
}
[hidden] {
  display: none !important;
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --- bottom nav --- */
.tabbar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: var(--space-2) var(--page-x) max(var(--space-2), env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-soft);
  position: relative;
  z-index: 20;
}
.tab {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 6px 2px;
  border-radius: var(--radius-md);
  color: var(--text-faint);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0;
  transition: all var(--transition-interactive);
}
/* Labels stay on one line so every icon sits at the same height
   and nothing bleeds into the neighbouring tab. */
.tab > span:not(.tab-ico) {
  display: block;
  width: 100%;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  line-height: 1.2;
}
.tab:hover {
  color: var(--text-muted);
}
.tab.is-active {
  color: var(--gold);
}
.tab.is-active .tab-ico {
  background: var(--gold-wash);
  box-shadow: inset 0 0 0 1px var(--gold-line);
}
.tab.is-nav-gated,
.quick.is-nav-gated,
.rewards-link.is-nav-gated {
  opacity: 0.42;
  cursor: not-allowed;
}
.tab-ico {
  width: 38px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-interactive);
}
@media (max-width: 359px) {
  .tab {
    font-size: 0.625rem;
  }
  .tab-ico {
    width: 32px;
  }
}

/* ============================================================
   PRIMITIVES
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.card-flush {
  padding: 0;
  overflow: hidden;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.section-head h2 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.eyebrow {
    font-size: 0.6875rem;
    /*font-size: 0.9375rem;*/
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-faint);
    font-weight: 600;
}
.link-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-btn:hover {
  color: var(--gold-bright);
}
.muted {
  color: var(--text-muted);
}
.faint {
  color: var(--text-faint);
}
.tiny {
  font-size: var(--text-xs);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.8rem var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: all var(--transition-interactive);
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-gold {
  background: linear-gradient(180deg, var(--gold-fill-1), var(--gold-fill-3));
  color: var(--text-on-gold);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.btn-gold:not(:disabled):hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}
.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: var(--surface-2);
}
.btn-ghost:hover {
  background: var(--surface-3);
  border-color: var(--gold-line);
}
.btn-quiet {
  color: var(--text-muted);
}
.btn-quiet:hover {
  color: var(--text);
}
.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-wash);
}
.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 0.5rem 0.85rem;
  font-size: var(--text-xs);
}
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface-2);
  white-space: nowrap;
}
.chip-gold {
  color: var(--gold);
  border-color: var(--gold-line);
  background: var(--gold-wash);
}
.chip-ok {
  color: var(--success);
  border-color: transparent;
  background: var(--success-wash);
}
.chip-bad {
  color: var(--danger);
  border-color: transparent;
  background: var(--danger-wash);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.field label {
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
    .field input,
    .field select,
    .field textarea {
        width: 100%;
        /*padding: 0.7rem 0.85rem;*/
        padding: 0.5rem 0.85rem;
        background: var(--surface-inset);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        font-size: var(--text-sm);
        transition: all var(--transition-interactive);
    }
.field textarea {
  resize: none;
  line-height: 1.5;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-faint);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.field input:read-only {
  color: var(--text-muted);
}
.field-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
/* Read-only mobile takes only what it needs so the longer
   email address gets the remaining width and stays legible. */
.field-2.tight-first {
  grid-template-columns: 116px minmax(0, 1fr);
}
/* Settings fits in one screen: no scrolling for basic info. */
#v-settings.is-active {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
#v-settings .settings-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}
#v-settings .settings-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-2) var(--page-x) var(--space-2);
    /*display: grid;
    gap: var(--space-2);*/
    /*margin-bottom: 10px;*/
    align-content: start;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
#v-settings .settings-logout {
  flex: 0 0 auto;
  padding: var(--space-3) var(--page-x) max(var(--space-3), env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-soft);
}
#v-settings .settings-user-card,
#v-settings .settings-details-card {
  display: grid;
  gap: var(--space-3);
}
#v-settings .field input[readonly] {
  background: var(--surface-inset);
  color: var(--text-muted);
  cursor: default;
}
#v-settings .pad {
  gap: var(--space-3);
  padding-bottom: var(--space-4);
}
.field-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
}

/* ============================================================
   LOGIN / OTP
   ============================================================ */
.auth {
  position: absolute;
  inset: 0;
  display: none;
  grid-template-rows: 1fr auto;
  width: 100%;
  max-width: 100%;
  padding: var(--space-8) var(--page-x) var(--space-6);
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(130% 60% at 50% 0%, rgba(201, 162, 39, 0.14), transparent 62%),
    linear-gradient(180deg, var(--surface-2), var(--bg) 45%);
}
.auth-inner {
  align-self: center;
  display: grid;
  gap: var(--space-6);
  /*padding-top: var(--space-8);*/
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.auth-brand {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  text-align: center;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--gold);
  filter: drop-shadow(0 8px 22px rgba(201, 162, 39, 0.3));
}
.brand-lockup .titan-word {
  width: 178px;
  height: 26px;
}
.auth-brand.is-compact .brand-lockup .titan-word {
  width: 150px;
  height: 22px;
}
.auth-brand p {
  font-size: var(--text-xs);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  /* Near-black slate: clearly legible on the light background, held just under
     full --text so the Titan logo above still leads the lockup. */
  color: color-mix(in srgb, var(--text) 88%, transparent);
  font-weight: 600;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-5);
  box-shadow: var(--shadow-md);
  background-image: var(--sheen);
  display: grid;
  gap: var(--space-5);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.auth-card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
.auth-card h2 + p {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 4px;
}
.phone-input {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.15rem 0.85rem;
  transition: all var(--transition-interactive);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.phone-input:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.phone-input .cc {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  padding-right: var(--space-3);
  white-space: nowrap;
  flex: 0 0 auto;
}
.flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.phone-input input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  padding: 0.75rem 0.15rem 0.75rem 0;
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
}
.phone-input input:focus {
  outline: none;
}
.otp-boxes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
    max-width: 280px; 
    margin-inline: auto;
}
/*.otp-boxes input {
  aspect-ratio: 6/6;
  text-align: center;
  font-size: 1.375rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  padding: 0;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all var(--transition-interactive);
}*/
/*.otp-boxes input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.otp-boxes input.filled {
  border-color: var(--gold-line);
  color: var(--gold);
}*/

    .otp-boxes input {
        aspect-ratio: 1;
        width: 100%;
        max-width: 50px; /* hard cap so they stay small */
        height: auto;
        margin-inline: auto;
        text-align: center;
        font-size: 1.375rem;
        letter-spacing: 0.05em;
        font-weight: 600;
        padding: 0;
        background: var(--surface-inset);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        transition: all var(--transition-interactive);
    }

        .otp-boxes input:focus {
            outline: none;
            border-color: var(--gold);
            box-shadow: 0 0 0 3px var(--gold-wash);
        }

        .otp-boxes input.filled {
            border-color: var(--gold-line);
            color: var(--gold);
        }

/* Suppress the native reveal affordance some browsers add to password inputs,
   so the code can never be read back off screen. */
.otp-boxes input::-ms-reveal,
.otp-boxes input::-ms-clear {
  display: none;
}
.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.check-row input {
  accent-color: var(--gold);
  width: 16px;
  height: 16px;
}
.auth-split {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
}
.auth-foot {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--text-faint);
  padding-top: var(--space-6);
}
.auth-foot b {
  color: var(--text-muted);
  font-weight: 600;
}
.demo-note {
  display: flex;
  gap: var(--space-2);
  align-items: flex-start;
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--info-wash);
  border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}
.demo-note svg {
  flex: 0 0 auto;
  color: var(--info);
  margin-top: 1px;
}

/* ============================================================
   HOME / DASHBOARD
   ============================================================ */
.hero-greet {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}
.hero-greet > div {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
}
.hero-greet h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
.hero-greet .eyebrow {
  margin-bottom: 3px;
}

/* Opt-in darker eyebrow. Scoped to this class so the shared .eyebrow used
   elsewhere in the app keeps its lighter weight. */
.eyebrow.is-strong {
  color: var(--text-muted);
}

.kpi-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-line);
  padding: var(--space-5);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(201, 162, 39, 0.2), transparent 58%),
    linear-gradient(160deg, var(--surface-3), var(--surface));
  box-shadow: var(--shadow-md);
  display: grid;
  gap: var(--space-4);
}
.kpi-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.kpi-amount {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2.25rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.kpi-amount small {
  font-family: var(--font-body);
  font-size: 1.125rem;
  color: var(--gold);
  margin-right: 3px;
}
.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--success);
}
.delta.is-down {
  color: var(--danger);
}
.kpi-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.kpi-mini div {
  min-width: 0;
}
.kpi-mini b {
  display: block;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
}
.kpi-mini span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}
.quick {
  position: relative;
  display: flex;
  align-items: center;
  /* Two-up tiles must hold "Incentive Schemes" and "Redemptions" unclipped on a
     360px phone, so the box stays tight and the label does the fitting. */
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--gold-line);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-interactive);
  min-height: 76px;
  overflow: hidden;
}
/* Soft gold glow anchored behind the icon so the tiles read as
   premium rather than plain white boxes. */
.quick::before {
  content: "";
  position: absolute;
  top: -40%;
  left: -12%;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-wash), transparent 70%);
  pointer-events: none;
}
.quick:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.quick .q-ico {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--gold-fill-1), var(--gold-fill-3));
  color: var(--text-on-gold);
  box-shadow: 0 2px 6px rgba(154, 119, 18, 0.28);
}
.quick span:not(.q-ico) {
  position: relative;
  min-width: 0;
}
.quick span {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
  text-align: left;
  line-height: 1.3;
}

/* bar chart */
.chart {
  display: grid;
  gap: var(--space-3);
}
.bars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 7px;
  align-items: end;
  height: 108px;
}
.bar-col {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: 6px;
  height: 100%;
  min-width: 0;
}
.bar {
  width: 100%;
  max-width: 26px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--gold-bright), color-mix(in srgb, var(--gold) 45%, transparent));
  transform-origin: bottom;
  animation: barGrow 700ms var(--ease-out) both;
  position: relative;
}
.bar-col.is-today .bar {
  background: linear-gradient(180deg, #fff0c2, var(--gold));
  box-shadow: 0 0 14px rgba(201, 162, 39, 0.45);
}
.bar-col small {
  font-size: 0.625rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}
.bar-col.is-today small {
  color: var(--gold);
  font-weight: 700;
}
@keyframes barGrow {
  from {
    transform: scaleY(0);
    opacity: 0.3;
  }
}

/* target ring */
.target-row {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.ring {
  flex: 0 0 auto;
  position: relative;
  width: 86px;
  height: 86px;
}
.ring svg {
  transform: rotate(-90deg);
}
.ring-val {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring-val b {
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ring-val span {
  font-size: 0.5rem;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.target-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: start;
}
.target-copy b {
  font-size: var(--text-sm);
}
.target-copy p {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ============================================================
   LISTS / ROWS
   ============================================================ */
.row-list {
  display: grid;
}
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  width: 100%;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--transition-interactive);
}
.row:last-child {
  border-bottom: none;
}
.row:hover {
  background: var(--surface-2);
}
.row-main {
  min-width: 0;
}
.row-main b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-main span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-side {
  text-align: right;
  white-space: nowrap;
  display: grid;
  gap: 2px;
  justify-items: end;
}
.row-side b {
  font-size: var(--text-sm);
  font-weight: 600;
}
.row-side span {
  font-size: 0.6875rem;
  color: var(--text-faint);
}

.month-strip {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.month-strip::-webkit-scrollbar {
  display: none;
}
.mchip {
  flex: 0 0 auto;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: all var(--transition-interactive);
  white-space: nowrap;
}
.mchip:hover {
  border-color: var(--gold-line);
}
.mchip.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--text-on-gold);
}

.watch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}
.wchip {
  padding: 0.45rem 0.35rem;
  border-radius: var(--radius-md);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25;
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
  transition: all var(--transition-interactive);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  word-break: normal;
  overflow-wrap: normal;
}
.wchip:hover,
.wchip:active {
  border-color: var(--gold-line);
  color: var(--text);
  background: var(--surface-2);
}

.scan-row {
  display: grid;
  /*grid-template-columns: 1fr 1fr;*/
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
/*.scan-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-5) var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-line);
  background: var(--gold-wash);
  text-align: center;
  transition: all var(--transition-interactive);
}*/

.scan-card:hover,
.scan-card:active {
  border-color: var(--gold);
  transform: translateY(-1px);
}
/*.scan-card-ico {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-fill-1), var(--gold-fill-3));
  color: var(--text-on-gold);
}
.scan-card b {
  font-size: 0.8125rem;
  color: var(--text);
}*/

.scan-row {
    /*display: flex;*/
    /*justify-content: flex-end;*/
    margin-bottom: var(--space-0);
}

.scan-card {
    width: 100%;
    height: 60px; /* Reduced height */
    padding: 10px 14px;
    display: flex;
    flex-direction: row; /* Icon + text horizontally */
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid var(--gold-line);
    background: var(--gold-wash);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scan-card-ico {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #e5b93f;
    color: #172033;
    flex-shrink: 0;
}

.scan-card b {
    font-size: 14px;
    font-weight: 600;
    color: #172033;
    white-space: nowrap;
}

.ai-scan-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 700ms linear infinite;
  flex-shrink: 0;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.searchbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  transition: all var(--transition-interactive);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.seg-btn {
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 3px);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-interactive);
}
.seg-btn.is-active {
  background: var(--surface);
  color: var(--gold);
  box-shadow: var(--shadow-sm);
}
.searchbar:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.searchbar svg {
  color: var(--text-faint);
  flex: 0 0 auto;
}
.searchbar input {
  flex: 1 1 auto;
  min-width: 0;
  background: none;
  border: none;
  padding: 0.7rem 0;
  font-size: var(--text-sm);
}
.searchbar input:focus {
  outline: none;
}
.rs-search-wrap {
  position: relative;
  z-index: 3;
}
.rs-results {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 280px;
  overflow-y: auto;
}
.rs-results.is-open {
  display: block;
}
.rs-results .result:last-child {
  border-bottom: none;
}
.result-status {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-xs);
  color: var(--text-faint);
}
#rs-invoice-card .section-head {
  margin-bottom: var(--space-3);
}
#rs-invoice-card .field input[type='date'] {
  min-height: 2.7rem;
}

.empty {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-4);
  text-align: center;
}
.empty svg {
  color: var(--text-faint);
  opacity: 0.55;
}
.empty b {
  font-size: var(--text-sm);
}
.empty p {
  font-size: var(--text-xs);
  color: var(--text-faint);
  max-width: 26ch;
}

/* ============================================================
   CART / INVOICE BUILDER
   ============================================================ */
.line {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  animation: viewIn 260ms var(--ease-out) both;
}
.line-compact {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.6rem var(--space-4);
}
.line-compact .line-name {
  flex: 1 1 auto;
}
.line:last-child {
  border-bottom: none;
}
.line-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: var(--space-2);
  align-items: start;
}
.line-name {
  min-width: 0;
}
.line-name b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
}
.line-name span {
  display: block;
  font-size: 0.6875rem;
  color: var(--text-faint);
  word-break: break-all;
}
.line-amt {
  text-align: right;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.line-del {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--text-faint);
}
.line-del:hover {
  color: var(--danger);
  background: var(--danger-wash);
}
.line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.pill {
  font-size: 0.625rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  white-space: nowrap;
}
.pill b {
  color: var(--text);
  font-weight: 600;
}

.totals {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.trow {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.trow b {
  color: var(--text);
  font-weight: 600;
}
.trow.grand {
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border);
  font-size: var(--text-base);
  color: var(--text);
}
.trow.grand b {
  font-size: var(--text-lg);
  color: var(--gold);
  font-weight: 700;
}

.qty-step {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface-inset);
  flex-shrink: 0;
}
.qty-step button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--text-muted);
}
.qty-step-sm button {
  width: 30px;
  height: 30px;
}
.qty-step-sm input {
  width: 32px;
  padding: 0.35rem 0;
  font-size: var(--text-xs);
}
.qty-step button:hover {
  background: var(--surface-3);
  color: var(--gold);
}
.qty-step input {
  /*width: 44px;*/
  text-align: center;
  background: none;
  border: none;
  border-inline: 1px solid var(--border);
  /*padding: 0.6rem 0;*/
  font-weight: 600;
  font-size: var(--text-sm);
}
.qty-step input:focus {
  outline: none;
}

.sticky-cta {
  position: sticky;
  bottom: 0;
  margin: 0 calc(var(--space-4) * -1) calc(var(--space-8) * -1);
  padding: var(--space-2) var(--space-4) var(--space-4);
  background: linear-gradient(180deg, transparent, var(--bg) 42%, var(--bg));
}

/* icons inside flex rows must never be squeezed */
.btn > svg,
.quick svg,
.icon-btn svg,
.chip svg,
.tab svg,
.toast > svg,
.pick-row > svg,
.searchbar > svg,
.result svg,
.row-side svg {
  flex: 0 0 auto;
}

/* ============================================================
   SCANNER
   ============================================================ */
.scanner {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: none;
  grid-template-rows: auto 1fr auto;
  background: #05070c;
}
.scanner.is-open {
  display: grid;
  animation: viewIn 240ms var(--ease-out) both;
}
.scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: calc(var(--space-4) + 28px) var(--space-4) var(--space-3);
  color: #eef2f8;
}
.scan-head b {
  font-size: var(--text-sm);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scan-head .icon-btn {
  color: #9fb0c8;
}
.scan-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 50% 40%, rgba(120, 145, 180, 0.18), transparent 70%),
    repeating-linear-gradient(115deg, #0a0f18 0 12px, #0c1220 12px 24px);
}
.scan-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(28% 18% at 32% 26%, rgba(255, 255, 255, 0.1), transparent 70%),
    radial-gradient(20% 14% at 72% 68%, rgba(255, 255, 255, 0.06), transparent 70%);
}
.reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  box-shadow: 0 0 0 2000px rgba(4, 7, 12, 0.62);
}
.scan-stage.has-photo {
  background: #05070c;
}
.scan-stage.has-photo #ai-scan-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.92;
}
.scan-stage.has-photo .reticle {
  width: 80%;
  aspect-ratio: 3/4;
  box-shadow: 0 0 0 2000px rgba(4, 7, 12, 0.5);
}
.scan-stage.is-camera {
  background: #05070c;
}
.scan-stage.is-camera #ai-scan-img,
.scan-stage.is-camera .reticle {
  display: none;
}
.scan-stage.is-camera .scan-camera-host {
  display: block;
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.scan-camera-host:not([hidden]) {
  display: block;
}
.reticle i {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2.5px solid var(--gold);
  border-radius: 4px;
}
.reticle i:nth-child(1) {
  top: -2px;
  left: -2px;
  border-right: 0;
  border-bottom: 0;
}
.reticle i:nth-child(2) {
  top: -2px;
  right: -2px;
  border-left: 0;
  border-bottom: 0;
}
.reticle i:nth-child(3) {
  bottom: -2px;
  left: -2px;
  border-right: 0;
  border-top: 0;
}
.reticle i:nth-child(4) {
  bottom: -2px;
  right: -2px;
  border-left: 0;
  border-top: 0;
}
.laser {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
  box-shadow: 0 0 14px 3px rgba(227, 189, 74, 0.55);
  animation: laser 1.7s ease-in-out infinite;
}
@keyframes laser {
  0%,
  100% {
    top: 12%;
  }
  50% {
    top: 88%;
  }
}
.scan-foot {
  padding: var(--space-4) var(--space-4) max(var(--space-5), env(safe-area-inset-bottom));
  display: grid;
  gap: var(--space-3);
  text-align: center;
  color: #c8d3e2;
}
.scan-foot p {
  font-size: var(--text-xs);
  color: #8c9db4;
  margin-inline: auto;
}
.scan-status {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  gap: var(--space-2);
  align-items: center;
  justify-content: center;
}
.scan-status .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-bright);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.25;
    transform: scale(0.7);
  }
}
.ean-readout {
  font-family: var(--font-num);
  font-size: var(--text-base);
  letter-spacing: 0.14em;
  color: var(--gold-soft);
}

/* ============================================================
   SHEETS / MODALS
   ============================================================ */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 12, 0.6);
  backdrop-filter: blur(3px);
  display: none;
}
.scrim.is-open {
  display: block;
  animation: fadeIn 200ms both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
}
#sheet-host {
  position: absolute;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: auto;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: sheetUp 320ms var(--ease-out) both;
}
@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4) var(--space-3);
  border-bottom: 1px solid var(--border-soft);
  flex: 0 0 auto;
}
.sheet-head::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 38px;
  height: 4px;
  border-radius: 3px;
  background: var(--border);
}
.sheet-head h3 {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-body {
  overflow-y: auto;
  padding: var(--space-4);
  display: grid;
  gap: var(--space-4);
  align-content: start;
}
.sheet-body.flush {
  padding: 0;
  gap: 0;
}
.sheet-foot {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.spec {
  min-width: 0;
}
.spec span {
  display: block;
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 600;
}
.spec b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  word-break: break-word;
  line-height: 1.35;
}
.spec.wide {
  grid-column: 1 / -1;
}

.result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}
.result:hover {
  background: var(--surface-2);
}
.result-main {
  min-width: 0;
}
.result-main b {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-main span {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.result-main span mark {
  background: var(--gold-wash);
  color: var(--gold);
  border-radius: 3px;
  padding: 0 2px;
}
.pick-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  text-align: left;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
}
.pick-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  border: 1.5px solid var(--border);
  background: var(--surface-inset);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: border-color 160ms, background 160ms;
}
.pick-row input[type='checkbox'] {
  border-radius: 6px;
}
.pick-row input:checked {
  border-color: var(--gold);
  background: var(--gold);
}
.pick-row input:checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background: no-repeat center/11px 11px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1206' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4.5 12.5 5 5 10-11'/%3E%3C/svg%3E");
}
.pick-row input:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pick-row input:focus-visible {
  outline: 2px solid var(--gold-line);
  outline-offset: 2px;
}

/* ============================================================
   SUCCESS
   ============================================================ */
.success-wrap {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  text-align: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: var(--space-5) var(--page-x) var(--space-4);
  min-height: 100%;
  align-content: start;
}
.success-wrap > .card,
.success-wrap > .action-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tick {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--success-wash);
  color: var(--success);
  animation: pop 500ms var(--ease-out) both;
  flex-shrink: 0;
}
@keyframes pop {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  60% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.tick svg path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: draw 520ms 220ms var(--ease-out) forwards;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.success-wrap h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
}
.success-wrap h2 b {
  color: var(--gold);
  font-weight: 600;
}

.points-burst {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 4px;
  width: min(210px, 100%);
  /*min-height: 210px;*/
  height: auto;
  /*padding: var(--space-4) 0 var(--space-2);
  margin-bottom: var(--space-2);*/
  flex-shrink: 0;
}
.burst-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--gold-line);
  opacity: 0;
}
.burst-ring.r2 {
  inset: 14px;
}
.points-burst.is-live .burst-ring {
  animation: burst-ring 900ms var(--ease-out) both;
}
.points-burst.is-live .burst-ring.r2 {
  animation-delay: 90ms;
}
@keyframes burst-ring {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}
.burst-coin {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--gold-fill-1), var(--gold-fill-3));
  color: var(--text-on-gold);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-2);
}
.points-burst.is-live .burst-coin {
  animation: burst-coin 560ms var(--ease-out) both;
}
@keyframes burst-coin {
  0% {
    transform: scale(0.4) rotate(-14deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.12) rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}
.burst-figure {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 3.25rem;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--gold);
}
.burst-figure small {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 4px;
}
.burst-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Short phones: scale the points hero down so the confirmation
   screen still fits without scrolling behind the tab bar. */
@media (max-height: 730px) {
  /* Home must never scroll. The header now carries a third line (the person
     signed in), so reclaim that space on short screens. */
  #v-home .pad {
    gap: var(--space-3);
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }
  #v-home .rewards-hero {
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-2);
  }
  .hero-greet h1 {
    font-size: var(--text-base);
  }
  #home-store {
    -webkit-line-clamp: 1;
  }
  .success-wrap {
    gap: var(--space-2);
    padding: var(--space-3) var(--page-x) var(--space-3);
  }
  .points-burst {
    width: min(148px, 100%);
    min-height: 148px;
    height: auto;
    padding: var(--space-2) 0 var(--space-1);
    margin-bottom: var(--space-1);
  }
  .burst-coin {
    width: 58px;
    height: 58px;
    margin-bottom: var(--space-1);
  }
  .burst-coin svg {
    width: 30px;
    height: 30px;
  }
  .burst-figure {
    font-size: 2.4rem;
  }
  .burst-figure small {
    font-size: 1rem;
  }
  .burst-label {
    font-size: var(--text-xs);
  }
}
.qr-card {
  padding: var(--space-3);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: grid;
  gap: 6px;
  justify-items: center;
}
.qr-card canvas,
.qr-card img {
  width: 108px;
  height: 108px;
  image-rendering: pixelated;
}
.qr-card small {
  font-size: 0.625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  width: 100%;
  flex-shrink: 0;
}
/* "Home" is one short word and "Report another sale" is four. Splitting the
   row 50/50 wrapped the long label, so the columns are weighted instead. */
/*.action-grid.cols-2 {
  grid-template-columns: auto minmax(0, 1fr);
}*/
    .action-grid.cols-2 {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 50% - 50% */
        gap: 12px;
    }
#sx-actions.action-grid {
    display: grid;
    grid-template-columns: 36% 60%;
    gap: 10px;
}
.action {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: var(--space-2) 2px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-soft);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
  transition: all var(--transition-interactive);
}
.action:hover {
  border-color: var(--gold-line);
  color: var(--text);
  transform: translateY(-2px);
}
.action svg {
  color: var(--gold);
  flex: 0 0 auto;
}
/* Two-up actions (sale confirmation) get readable, tappable labels
   laid out as an icon + text row rather than tiny stacked captions. */
.action-grid.cols-2 .action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-2);
    min-height: 48px;
    min-width: 0;
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.2;
    color: var(--text);
    white-space: normal;
    text-align: center;
    width: 100%;
}
.action-grid.cols-2 .action span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.action-grid.cols-2 .action svg {
  flex-shrink: 0;
}
.receipt {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-wrap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 84px;
  z-index: 120;
  display: grid;
  gap: var(--space-2);
  padding: 0 var(--page-x);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--surface-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  font-size: var(--text-xs);
  animation: toastIn 300ms var(--ease-out) both;
}
.toast.out {
  animation: toastOut 260ms var(--ease-out) forwards;
}
.toast svg {
  flex: 0 0 auto;
  color: var(--success);
}
.toast.warn svg {
  color: var(--gold);
}
.toast span {
  min-width: 0;
}
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}
@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px);
  }
}










.accordion {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  margin-top:10px;
}
.acc-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    text-align: left;
    padding: var(--space-2);
    background: var(--surface-2);
}
.acc-head .a-ico {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--gold-wash);
  color: var(--gold);
  flex: 0 0 auto;
}
.acc-head b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--text-sm);
  font-weight: 600;
}
.acc-head .caret {
  transition: transform var(--transition-interactive);
  color: var(--text-faint);
  flex: 0 0 auto;
}
.accordion.is-open .acc-head .caret {
  transform: rotate(180deg);
}
.acc-body {
  display: none;
  padding: var(--space-3) var(--space-4) var(--space-4);
  gap: var(--space-3);
  border-top: 1px solid var(--border-soft);
}
.accordion.is-open .acc-body {
  display: grid;
  animation: viewIn 260ms var(--ease-out) both;
}
.preview-num {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
}
.preview-num b {
  color: var(--gold);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.stack {
  display: grid;
  gap: var(--space-3);
}
.divider {
  height: 1px;
  background: var(--border-soft);
}

/* ============================================================
   REPORT SALES / SCHEMES / EARNINGS / REDEMPTIONS
   ============================================================ */
.rewards-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: var(--space-2);
  justify-items: start;
  padding: var(--space-6) var(--space-5);
  border-radius: var(--radius-xl);
  /*margin-bottom: var(--space-4);*/
  background: linear-gradient(135deg, #f6e0a0 0%, #ecc768 42%, #ddb64f 100%);
  color: #1a1206;
  box-shadow: var(--shadow-md);
}
.rewards-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.35), transparent 55%);
  pointer-events: none;
}
.rewards-hero .eyebrow {
  position: relative;
  color: rgba(41, 32, 10, 0.72);
  font-weight: 700;
}
.rewards-figure {
  position: relative;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 1.7rem + 2vw, 2.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #201804;
}
.rewards-figure small {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(41, 32, 10, 0.75);
  margin-left: 4px;
}
.rewards-links {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}
.rewards-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: #201804;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.38);
  transition: background var(--transition-interactive);
}
.rewards-link:hover,
.rewards-link:active {
  background: rgba(255, 255, 255, 0.55);
}
.rewards-sep {
  display: none;
}

/* ---- Target progress ----
   The multiplier is unreadable without knowing where the store stands, so the
   bar travels with the balance on Home and heads the programme page. */
/* Short viewports (e.g. 360x640) need the hero tightened so Home never
   scrolls now that the monthly target strip lives inside it. */
@media (max-height: 700px) {
  .rewards-hero {
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 6px;
    margin-bottom: 6px;
  }
  .tgt {
    margin-top: 8px;
  }
  .tgt-row {
    margin-bottom: 4px;
  }
  .rewards-links {
    margin-top: 6px;
    gap: 6px var(--space-2);
  }
  .rewards-figure {
    font-size: 1.875rem;
  }
  .rewards-link {
    padding: 5px 10px;
  }
}

.tgt {
  margin-top: var(--space-3);
}
.tgt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 5px;
}
.tgt-lbl {
    /*font-size: 0.6875rem;*/
    font-size: 0.9375rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-on-gold);
    opacity: 0.72;
}
.tgt-mult {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-on-gold);
}
/* Sits where the multiplier used to, on the gold Home hero. */
.tgt-ach {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-on-gold);
  white-space: nowrap;
}
.tbar {
  height: 6px;
  border-radius: 999px;
  background: rgba(26, 18, 6, 0.16);
  overflow: hidden;
}
.tbar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--text-on-gold);
  opacity: 0.82;
  transition: width var(--transition-interactive);
}
/* On the programme page the bar sits on a white card, not the gold hero. */
#schemes-list .tbar {
  background: var(--gold-wash);
  height: 7px;
}
#schemes-list .tbar > i {
  background: var(--gold);
  opacity: 1;
}
.tgt-big {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 4px 0 var(--space-3);
}
.tgt-big b {
  font-family: var(--font-display);
  /* The month's target is the headline number on this page — sized to read
     as such, not as a caption. */
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1;
}
.mult-pill {
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--gold-wash);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  white-space: nowrap;
}
/* "Achieved ₹8L of ₹10L" — the plain-language restatement under the bar.
   Deliberately larger than a caption: it is the sentence that tells the
   partner where they stand. Overrides the .tiny it is tagged with. */
.tgt-note {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  line-height: 1.35;
}
.tgt-note b {
  font-weight: 700;
  color: var(--text);
}

/* ---- Reward band table ----
   Three columns on a 360px screen: the price band flexes, the two rate
   columns are fixed. Their headings are full words that wrap onto several
   short lines, so the columns are sized for the wrapped heading rather than
   the two- or three-digit figures beneath them. The column matching the rate
   currently being earned is highlighted so the live rate is unmistakable. */
.band-intro {
  margin: 4px 0 var(--space-4);
  line-height: 1.5;
}
.band-tbl {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
}
/* When the table follows the card heading directly, it needs the breathing
   room the removed intro paragraph used to provide. */
.band-tbl-top {
  margin-top: var(--space-3);
}
.band-r {
  display: grid;
  /* Sized so the widest band label ("₹15,000 to ₹24,999" plus its badge) and
     the widest heading word ("ACHIEVEMENT") each hold one line at 360px. */
  grid-template-columns: minmax(0, 1fr) 48px 68px;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-3);
}
.band-r + .band-r {
  border-top: 1px solid var(--border-soft);
}
.band-r > span:not(.band-range) {
  text-align: center;
  font-size: var(--text-xs);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.band-hd {
  background: var(--surface-inset);
}
.band-hd > span:first-child {
  text-align: left;
  /*font-size: 0.5625rem;*/
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}
/* The compound selector matters: `.band-r > span:not(.band-range)` above is
   more specific than a lone `.band-hc`, and would otherwise force these
   headings back up to 13px, breaking "ACHIEVEMENT" across two lines. */
.band-r.band-hd > span.band-hc {
  min-width: 0;
  /*font-size: 0.5625rem;*/
  font-size: 10px;
  /* No tracking: "ACHIEVEMENT" is the longest word in the table and any
     letter-spacing pushes it past its column. */
  letter-spacing: 0;
  text-transform: uppercase;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-muted);
  text-align: right;
}
/* ---- Target column: always the standout ----
   A continuous gold strip runs down the last column (column width + row
   padding + half the gap), with gold bold figures on top of it. */
.band-tbl {
  --tcol: calc(68px + var(--space-3) + 3px);
}
.band-r {
  background-image: linear-gradient(to left, var(--gold-wash) var(--tcol), transparent var(--tcol));
}
.band-r > span:not(.band-range):not(.is-target) {
  color: var(--text);
}
.band-r > span.is-target {
  color: var(--gold);
  font-weight: 800;
  font-size: var(--text-sm);
}
.band-r.band-hd > span.band-hc.is-target {
  color: var(--gold);
  font-weight: 800;
}
/* The 2x pill in the Multiplier applied row. */
.band-x {
  display: inline-block;
  font-style: normal;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--gold-fill-2);
  color: var(--text-on-gold);
  box-shadow: 0 1px 0 var(--gold-line);
}
.band-range {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--text);
  /* The ranges read as single units ("₹10,000 to ₹14,999"), so they hold one
     line rather than breaking after "to". */
  white-space: nowrap;
}
.band-id {
  flex-shrink: 0;
  font-style: normal;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--gold-wash);
  color: var(--gold);
}
.band-foot {
  margin-top: var(--space-3);
  line-height: 1.5;
}

/* ---- Points breakdown ----
   Sales are listed at base points and never restated; the multiplier is a
   monthly award, carried as its own line that keeps moving until month close. */
.bd-list {
  margin: var(--space-3) 0 0;
  display: grid;
}
.bd-row {
    /*padding: var(--space-3) 0;*/
    padding: var(--space-3) 0 0 0;
    border-top: 1px solid var(--border-soft);
}
.bd-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 3px;
}
.bd-top b {
  font-size: var(--text-sm);
  font-weight: 600;
}
.bd-live {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--gold-wash);
  color: var(--gold);
  white-space: nowrap;
}
.bd-lines {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.bd-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.bd-line b {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
}
.bd-line b.is-gold {
  color: var(--gold);
}
.bd-line.is-total {
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-soft);
  color: var(--text);
  font-weight: 600;
}
.bd-line.is-total b {
  font-size: var(--text-base);
  font-weight: 700;
}

/* ---- Program page text blocks ---- */
.prog-title {
  display: block;
}
.prog-dates {
  margin-top: 2px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gold);
}
.prog-list {
    margin: var(--space-2) 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: var(--space-2);
    /*font-size: var(--text-sm);*/
    font-size: var(--text-xs);
    line-height: 1.45;
    color: var(--text-muted);
}
/* Last table row: the multiplier each column applies. */
.band-r.band-mult {
  background-color: var(--surface-2);
}
.band-mult > .band-range {
  font-weight: 700;
}

/* ---- CRO attribution ---- */
.cro-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.cro-card input {
  margin: 0;
}
.cro-card b {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}
.cro-head {
  display: grid;
  gap: 2px;
}
.cro-head b {
  font-size: var(--text-sm);
  font-weight: 600;
}
.cro-card .segmented {
  margin-bottom: 0;
}

/* Band tag and CRO tag on ledger rows. */
.led-band {
    display: inline-block;
    font-size: 0.7125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 1px 4px;
    border-radius: 3px;
    background: var(--gold-wash);
    color: var(--gold);
}
.led-tag.led-cro {
  background: var(--gold-wash);
  color: var(--gold);
}

/* Retained: the programme page still labels a field this way. */
.scheme-fact-label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
}

/* ---- Earnings ledger ---- */
.led-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  padding: 0 var(--space-4) var(--space-3);
}
.led-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}
.led-search svg {
  position: absolute;
  left: 10px;
  color: var(--text-faint);
  pointer-events: none;
}
.led-search input {
  width: 100%;
  min-width: 0;
  padding: 9px 10px 9px 31px;
  font-size: var(--text-xs);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.led-search input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.led-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}
.led-sort {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text);
  background: var(--surface-inset);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  white-space: nowrap;
  transition: all var(--transition-interactive);
}
.led-sort:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.led-sort svg {
  color: var(--text-faint);
  flex: 0 0 auto;
}
.led-sort:hover svg {
  color: var(--gold);
}
.led-list {
  display: grid;
}
.led-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-soft);
}
.led-main {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.led-main b {
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.led-sub {
  font-size: var(--text-xs);
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.led-tag {
  font-weight: 600;
  color: var(--danger);
}
.led-pts {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
  color: var(--text-faint);
}
.led-pts.is-earned {
  color: var(--gold);
}


/* ============================================================
   STORE PROFILE CARD  (Settings)
   Titan owns these values, so the card reads as a summary and
   carries no inputs. The two user slots follow below it.
   ============================================================ */
.store-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gold-line);
  background:
    radial-gradient(110% 140% at 0% 0%, rgba(201, 162, 39, 0.18), transparent 62%),
    linear-gradient(160deg, var(--surface-3), var(--surface));
}
.store-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}
.store-top b {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.25;
  min-width: 0;
}
.store-addr {
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
}
.store-facts {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-soft);
}
.store-fact {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.store-fact:last-child {
  text-align: right;
}
.store-fact-label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
}
.store-fact b {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
}

/* Store classification: KAM or EMM. Describes the store, never the user. */
.store-pill {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--gold-line);
  background: var(--gold-wash);
  color: var(--gold);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1.5;
  white-space: nowrap;
}

/* Home header carries the same classification, without the address. */
.home-store-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    min-width: 0;
    max-width: 100%;
}
.home-store-row h1,
#home-store {
  min-width: 0;
  flex: 1 1 auto;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.home-store-id {
  font-size: var(--text-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* The user slots hold no address — the store profile above owns it. */
.acc-body > .tiny.faint {
  margin-top: calc(var(--space-1) * -1);
}

/* ============================================================
   ABM (Area Business Manager) — ranked partner list
   ============================================================ */
.abm-entry {
  display: block;
  width: 100%;
  margin-top: var(--space-4);
  padding: var(--space-2);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.abm-entry:hover,
.abm-entry:focus-visible {
  color: var(--gold);
}

/* ---- ABM partner card ----
   One card per partner, deliberately taller than a list row so it can hold
   the full trading name plus both figures an ABM works from. The name is
   allowed to wrap rather than truncate: knowing which store this is matters
   more than keeping every card the same height. */
.abm-card {
  display: grid;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.abm-card:hover,
.abm-card:focus-visible {
  border-color: var(--gold-line);
}
/* Stores at or past target. */
.abm-card.is-over {
  border-color: var(--gold-line);
  background: linear-gradient(180deg, var(--gold-wash) 0%, var(--surface) 46%);
}
.abm-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-3);
}
.abm-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}
.abm-rank.is-top {
  background: var(--gold-wash);
  color: var(--gold);
}
.abm-card.is-over .abm-rank {
  background: var(--surface);
  color: var(--gold);
}
.abm-card-id {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.abm-card-id b {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.25;
  /* Full name, wrapped rather than clipped. */
  overflow-wrap: break-word;
}
.abm-card-sub {
  font-size: var(--text-xs);
  color: var(--text-faint);
}
.abm-chev {
  color: var(--text-faint);
  flex-shrink: 0;
  padding-top: 4px;
}
.abm-bar {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.abm-bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--gold);
}
.abm-card-stats {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding-top: var(--space-1);
  border-top: 1px solid var(--border-soft);
}
.abm-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.abm-stat-pts {
  justify-items: end;
  text-align: right;
}
.abm-stat-label {
  font-size: 0.5625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-faint);
}
.abm-stat-val {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.abm-stat-val b {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}
/* The whole figure line reads at one size — target and percentage are as
   much the point as the rupee value. Only colour separates them. */
.abm-stat-of {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
}
.abm-stat-pct {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.abm-card.is-over .abm-stat-pct {
  color: var(--gold);
}

/* ---------- consistent gutters on notched / narrow screens ---------- */
@supports (padding: max(0px)) {
  .pad,
  .auth,
  .success-wrap,
  .topbar,
  .tabbar,
  .toast-wrap {
    padding-left: max(var(--page-x), env(safe-area-inset-left, 0px));
    padding-right: max(var(--page-x), env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 480px) {
  .auth {
    padding-top: var(--space-6);
    padding-bottom: var(--space-4);
  }
  .auth-inner {
    /*padding-top: var(--space-4);*/
    gap: var(--space-4);
  }
  .auth-card {
    padding: var(--space-4);
    gap: var(--space-4);
  }
  .auth-brand p {
    letter-spacing: 0.16em;
  }
}

@media (max-width: 360px) {
  .otp-boxes {
    gap: var(--space-1);
  }
  .otp-boxes input {
    font-size: 1.125rem;
  }
  .brand-lockup .titan-word {
    width: 150px;
    height: 22px;
  }
}
.line-stack {
    display: flex;
    flex-direction: column;
    gap: 0.10rem;
    padding: 0.3rem 0.8rem var(--space-4);
    border-bottom: 1px solid var(--border-soft);
    animation: viewIn 260ms var(--ease-out) both;
}

    .line-stack:last-child {
        border-bottom: none;
    }

.line-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.line-row-title .line-title {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
}

.line-row-mid {
    justify-content: space-between;
}

    .line-row-mid .line-sub {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.6875rem;
        color: var(--text-faint);
        /*word-break: break-all;*/
    }

.line-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
}

.line-row-meta span {
    font-size: 0.7875rem;
    color: #555;

}

/* ============================================================
   STOCK TAKE
   ============================================================ */
#v-stocktake .scan-card {
    width: auto;
    /*min-width: 165px;*/
    max-width: 100%;
    padding: 10px 16px;
}

.btn-st-start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    width: 100%;
    /*margin-top: var(--space-5);*/
    padding: var(--space-4) var(--space-5);
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #e87722 0%, #d45f0a 100%);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(212, 95, 10, 0.28);
}

.btn-st-start:not(:disabled):hover,
.btn-st-start:not(:disabled):active {
    filter: brightness(1.04);
}

/*.btn-st-home {
    margin-top: var(--space-5);
}*/

.st-or-add {
    margin: var(--space-4) 0 var(--space-3);
}

.st-search-wrap {
    margin-bottom: var(--space-0);
}

#v-stocktake .scan-row {
    margin-bottom: var(--space-4);
}

#v-stocktake .st-search-wrap {
    margin-bottom: var(--space-5);
}

#v-stocktake .st-draft-card {
    margin-top: var(--space-2);
}

.st-toolbar {
    margin: var(--space-3) 0 var(--space-4);
}

.st-toolbar .btn {
    width: 100%;
}

.st-filter-card {
    margin: var(--space-4) 0;
}

.st-filter-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
}

.st-filter-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: 0.6875rem;
    color: var(--text-faint);
}

.st-filter-field input {
    font-size: var(--text-sm);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
}

.st-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) var(--space-4);
    border-top: 1px solid var(--border-soft);
}

.st-pagination-meta {
    font-size: 0.6875rem;
    color: var(--text-faint);
}

.st-submitted-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-bottom: var(--space-2);
}

.st-history-title {
    font-size: 1.125rem;
    /*font-weight: 700;*/
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 var(--space-1);
}

.st-history-summary-card {
    padding: var(--space-4);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.st-history-summary-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.st-history-batch-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.st-history-kicker {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.st-history-batch-id {
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    word-break: break-all;
}

.st-history-status-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #1a6b45;
    background: color-mix(in srgb, #34c759 18%, var(--surface));
    border: 1px solid color-mix(in srgb, #34c759 35%, transparent);
}

.st-history-summary-divider {
    height: 1px;
    margin: var(--space-3) 0;
    background: var(--border-soft);
}

.st-history-summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
}

.st-history-summary-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 0 var(--space-3);
}

.st-history-summary-stat:first-child {
    padding-left: 0;
    border-right: 1px solid var(--border-soft);
}

.st-history-summary-stat:last-child {
    padding-right: 0;
}

.st-history-summary-stat dt {
    margin: 0;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.st-history-summary-stat dd {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

.st-history-search-card {
    padding: var(--space-4);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.st-history-list-card {
    overflow: hidden;
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}

.st-history-search-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
}

.st-history-searchbar {
    margin: 0;
}

.st-history-table-host {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

. /*st-submitted-table {
    margin: 0;
}

.st-submitted-table th,
.st-submitted-table td {
    padding: var(--space-3) var(--space-4);
    vertical-align: top;
}

.st-submitted-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--surface-2) 85%, var(--bg));
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border-soft);
}

.st-submitted-table tbody tr {
    border-bottom: 1px solid var(--border-soft);
}

.st-submitted-table tbody tr:last-child {
    border-bottom: none;
}

.st-submitted-table tbody td {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.st-submitted-table tbody td.st-history-col-sku {
    color: var(--text);
}*/
.st-submitted-table {
    margin: 0;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.st-submitted-table th,
.st-submitted-table td {
    padding: var(--space-3) var(--space-4);
    vertical-align: top;
}

    /* SKU */
    .st-submitted-table th:nth-child(1),
    .st-submitted-table td:nth-child(1) {
        width: 25%;
    }

    /* Description */
    .st-submitted-table th:nth-child(2),
    .st-submitted-table td:nth-child(2) {
        width: 65%;
    }

    /* Quantity */
    .st-submitted-table th:nth-child(3),
    .st-submitted-table td:nth-child(3) {
        width: 10%;
        text-align:center;
    }

.st-submitted-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: color-mix(in srgb, var(--surface-2) 85%, var(--bg));
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1px solid var(--border-soft);
}

.st-submitted-table tbody tr {
    border-bottom: 1px solid var(--border-soft);
}

    .st-submitted-table tbody tr:last-child {
        border-bottom: none;
    }

.st-submitted-table tbody td {
    /*font-size: var(--text-sm);*/
    font-size: 0.7375rem;
    color: var(--text-muted);
}

    .st-submitted-table tbody td.st-history-col-sku {
        color: var(--text);
    }

.st-history-col-sku {
    width: 30%;
    font-weight: 500;
    font-size: var(--text-sm);
}

.st-history-col-desc {
    font-size: var(--text-sm);
    line-height: 1.35;
}

.st-history-pagination {
    background: var(--surface);
}

.st-history-empty-inline {
    padding: var(--space-6) var(--space-4);
    text-align: center;
    color: var(--text-faint);
}

.st-history-empty-inline b {
    display: block;
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text);
}

.st-history-empty-inline p {
    margin: var(--space-2) 0 0;
    font-size: 0.6875rem;
    line-height: 1.45;
}

.st-locked-note {
    margin: 0;
    padding: var(--space-3) var(--space-4);
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--text-faint);
    border-radius: var(--radius-md);
    background: color-mix(in srgb, var(--surface-2) 70%, transparent);
    border: 1px solid var(--border-soft);
}

@media (max-width: 360px) {
    .st-history-summary-top {
        flex-direction: column;
        align-items: stretch;
    }

    .st-history-status-badge {
        align-self: flex-start;
    }

    .st-history-batch-id {
        font-size: 0.9375rem;
    }
}

.st-confirm-host {
    position: absolute;
    inset: 0;
    z-index: 350;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.st-confirm-host[hidden] {
    display: none !important;
}

.st-confirm-scrim {
    position: absolute;
    inset: 0;
    background: rgba(12, 10, 8, 0.45);
}

.st-confirm-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 22rem);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.st-confirm-dialog h3 {
    font-size: var(--text-md);
    margin-bottom: var(--space-2);
}

.st-confirm-dialog p {
    font-size: var(--text-sm);
    line-height: 1.45;
    color: var(--text-faint);
    margin-bottom: var(--space-4);
}

.st-confirm-actions {
    margin-top: var(--space-2);
}

.st-draft-card {
    margin-bottom: var(--space-0);
}

.st-draft-lines {
    display: flex;
    flex-direction: column;
}

.st-draft-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-soft);
}

.st-draft-line:last-child {
    border-bottom: none;
}

.st-draft-line-main {
    flex: 1 1 auto;
    min-width: 0;
}

.st-draft-line-sku {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    word-break: break-all;
}

.st-draft-line-desc {
    display: block;
    margin-top: 2px;
    font-size: 0.6875rem;
    line-height: 1.35;
    word-break: break-word;
    color: var(--text);
}

.st-draft-line-cat {
    display: block;
    margin-top: 2px;
    font-size: 0.6875rem;
    line-height: 1.35;
    word-break: break-word;
    color: var(--text-faint);
}

.st-draft-line-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.st-history-block {
    margin-top: var(--space-5);
}

.st-history-block .section-head {
    margin-bottom: var(--space-4);
}

.st-history-block .section-head h2 {
    font-size: var(--text-sm);
    font-weight: 600;
}

.st-history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.st-history-empty {
    padding: var(--space-4);
    text-align: center;
}

.st-history-empty-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-6) var(--space-5);
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border);
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
    text-align: center;
}

.st-history-empty-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.08);
    color: var(--brand);
    margin-bottom: var(--space-1);
}

.st-history-empty-card b {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

.st-history-empty-card p {
    margin: 0;
    max-width: 18rem;
    font-size: 0.6875rem;
    line-height: 1.45;
    color: var(--text-faint);
}

.st-history-acc {
    margin-bottom: var(--space-2);
}

.st-history-acc .acc-head {
    cursor: pointer;
}

.st-history-acc-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.st-history-acc-date {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text);
}

.st-history-acc-id {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-faint);
    word-break: break-all;
}

.st-history-badge {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.08);
    color: var(--brand);
    font-size: 0.6875rem;
    font-weight: 600;
}

.st-history-body {
    display: none;
    gap: var(--space-2);
}

.st-history-acc.is-open .st-history-body {
    display: grid;
}

.st-history-detail-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.6875rem;
}

.st-history-detail-table th,
.st-history-detail-table td {
    padding: var(--space-2) var(--space-3);
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: top;
}

.st-history-detail-table th {
    font-weight: 600;
    color: var(--text-faint);
    background: var(--surface);
}

.st-history-col-sku {
    width: 28%;
    white-space: nowrap;
    word-break: keep-all;
}

.st-history-col-desc {
    width: auto;
    word-break: break-word;
}

.st-history-col-qty,
.st-history-detail-table th:last-child {
    width: 3rem;
    text-align: right;
    white-space: nowrap;
}

.st-history-loading {
    padding: var(--space-3) 0;
    font-size: 0.6875rem;
    color: var(--text-faint);
    text-align: center;
}

.st-scanner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    background: #05070c;
}

.st-scanner.is-open {
    display: block;
}

.st-scanner-stage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    background: #05070c;
}

.st-scanner-stage .scan-camera-host {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.st-scanner-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: calc(var(--space-4) + 28px) var(--space-4) var(--space-3);
    color: #eef2f8;
    background: linear-gradient(180deg, rgba(5, 7, 12, 0.88), transparent);
    pointer-events: none;
}

.st-scanner-head .icon-btn {
    pointer-events: auto;
}

.st-scanner-head b {
    font-size: var(--text-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.st-scanner-head .icon-btn {
    color: #9fb0c8;
}

.st-scanner-status {
    position: absolute;
    left: var(--space-4);
    right: var(--space-4);
    bottom: calc(30% + var(--space-3));
    z-index: 3;
    color: #eef2f8;
    pointer-events: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.st-scan-batch {
    margin: 4px 0 0;
    font-size: 0.6875rem;
    color: #9fb0c8;
    letter-spacing: 0;
    text-transform: none;
}

.st-scanner-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    display: flex;
    flex-direction: column;
    height: 40%;
    max-height: 40%;
    background: linear-gradient(180deg, rgba(244, 242, 236, 0.82), rgba(244, 242, 236, 0.96));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
    touch-action: none;
    pointer-events: auto;
}

.st-scan-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: var(--space-3) var(--space-4) var(--space-2);
}

.st-scan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.st-scan-card-rows {
    display: flex;
    flex-direction: column;
}

.st-scan-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-3);
    border-bottom: 1px solid var(--border-soft);
}

.st-scan-item:last-child {
    border-bottom: none;
}

.st-scan-item-ico {
    flex-shrink: 0;
    color: var(--text-faint);
}

.st-scan-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.st-product-id {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.st-id-val {
    display: block;
    font-size: 0.6875rem;
    line-height: 1.35;
    word-break: break-word;
    color: var(--text);
    min-width: 0;
}

.st-id-sku {
    font-weight: 600;
}

.st-id-desc {
    color: var(--text-muted);
}

/* Draft + search: SKU and description only */
.st-product-id--list .st-id-sku {
    font-size: 0.8125rem;
    line-height: 1.35;
}

.st-product-id--list .st-id-desc {
    font-size: 0.6875rem;
    line-height: 1.35;
}

/* Scan session: EAN, SKU (larger), then description */
.st-product-id--scan .st-id-ean,
.st-product-id--scan .st-id-sku {
    font-size: 0.875rem;
    line-height: 1.35;
}

.st-product-id--scan .st-id-desc {
    font-size: 0.6875rem;
    line-height: 1.35;
    color: var(--text-muted);
}

.st-scan-item-sku {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    word-break: break-all;
}

.st-scan-item-desc {
    display: block;
    margin-top: 4px;
    font-size: 0.6875rem;
    color: var(--text-faint);
    line-height: 1.35;
    word-break: break-word;
}

.st-scan-item-qty {
    flex-shrink: 0;
    align-self: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text);
    min-width: 2.75rem;
    text-align: right;
}

.st-scan-item-del {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #dc2626;
    padding: 4px;
}

.st-scanner-actions {
    flex-shrink: 0;
    padding: var(--space-3) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
    background: rgba(244, 242, 236, 0.98);
    border-top: 1px solid var(--border);
    touch-action: manipulation;
}

.st-scanner-actions .btn-row {
    margin: 0;
}

.st-line-pending {
    opacity: 0.72;
}

.st-scan-empty {
    padding: var(--space-4) 0;
    text-align: center;
    font-size: 0.6875rem;
    color: var(--text-faint);
}

.pill-band {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #e8f0fe;
    color: #1a56db;
    margin-right: 6px;
    white-space: nowrap;
}
.line-sku {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.line-cat {
    font-size: 13px;
    color: #666;
    margin-top: 1px;
}

.line-row-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 2px;
}

.line-row-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.line-sku {
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.line-cat {
    font-size: 13px;
    color: #666;
    margin-top: 1px;
}

.line-row-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 0 2px;
}

.line-row-meta {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}

.pill-band {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #e8f0fe;
    color: #1a56db;
    white-space: nowrap;
}
.pill-pts {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    background: linear-gradient(180deg, var(--gold-fill-1), var(--gold-fill-3));
    color: var(--text);
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ============================================================
   STORE SELECTION + ACTIVE STORE CONTEXT
   ============================================================ */
#v-store-select {
  grid-template-rows: auto 1fr auto;
}

#v-store-select .auth-inner {
  align-self: start;
  padding-top: var(--space-2);
}

.store-select-inner {
  width: min(100%, 420px);
}

.store-select-head {
  /*margin-bottom: var(--space-4);*/
}

.store-select-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  margin-left:5px;
}

.store-select-head p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.45;
}

.store-select-list {
  display: grid;
  gap: var(--space-3);
}

.store-select-empty {
  padding: var(--space-5) var(--space-4);
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-muted);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-lg);
}

.store-select-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4);
}

.store-select-card-body {
  min-width: 0;
  flex: 1;
}

.store-select-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.35;
}

.store-select-code {
  font-weight: 500;
  color: var(--text-muted);
}

.store-select-addr {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.45;
  color: var(--text-muted);
}

.store-select-addr svg {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--gold);
}

.store-select-checkin {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.store-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
  min-width: 0;
  max-width: 100%;
}

.store-context-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}
.store-context-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
    .store-context-copy strong,
    .store-context-id {
        display: inline;
    }
.store-context-icon {
    flex-shrink: 0;
    color: var(--gold);
}

.store-context-label {
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-faint);
}

.store-context-copy strong {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.25;
}

.store-context-id {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.store-context-change {
  flex-shrink: 0;
}

/* Right-side action button */
.right-action-wrap {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-3);
}

.right-action-btn {
    width: 150px;
    height: 60px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--gold-line);
    border-radius: 12px;
    background: var(--gold-wash);
    color: #172033;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .right-action-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 5px 14px rgba(0, 0, 0, 0.08);
    }

    .right-action-btn:active {
        transform: translateY(0);
    }

    .right-action-btn .right-action-icon {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 7px;
        border-radius: 9px;
        background: #e5b93f;
        color: #172033;
        flex-shrink: 0;
    }

    .right-action-btn span {
        white-space: nowrap;
    }

.rewards-bottom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

    .rewards-bottom-row .rewards-link {
        margin-left: auto;
    }
.er-points-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

    .er-points-row .eyebrow,
    .er-points-row .kpi-amount {
        margin: 0;
    }
#rs-count {
    font-size: 0.6875rem;
}
#rs-cro-name
{
    background:white;
    padding:0.7rem;
}
.info-card {
    padding: 16px;
    border: 1px solid var(--gold-border, #e6d9a8);
    border-radius: 16px;
    background: linear-gradient(135deg, #f6efdc 0%, #fffdf8 60%);
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.info-item--end {
    text-align: right;
    align-items: flex-end;
}

.info-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
}

/* long emails wrap instead of overflowing */
.info-value--wrap {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.info-divider {
    height: 1px;
    margin: 14px 0;
    background: rgba(0, 0, 0, 0.08);
}
.line-row-top {
    display: flex;
    align-items: center; /* centers the text block against the stepper */
    justify-content: space-between;
    gap: 12px;
}

.line-main {
    display: flex;
    flex-direction: column;
    gap: 2px; /* the tight space between SKU and name */
    min-width: 0;
}

    .line-main .line-title,
    .line-main .line-sku {
        margin: 0;
        line-height: 1.25;
    }

    .line-main .line-sku {
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap; /* keeps long names from pushing the stepper down */
    }
