/* ============================================================
   Retail Partner Portal — design system
   Standalone. Brand tokens mirror the Transaction Zone hub.
   ============================================================ */

:root {
  /* ---- Neutral palette: warm canvas, near-black ink ---- */
  --ink:       #1A1A18;   /* near-black ink (premium, not pure black) */
  --ink-soft:  #3A3A38;   /* secondary text                          */
  --muted:     #6B6E7A;   /* muted labels                            */
  --muted-2:   #9A9CA6;   /* hints / captions                        */
  --line:      #E7E5DE;   /* hairline border (warm)                  */
  --line-soft: #F0EEE8;   /* lighter internal divider                */
  --bg:        #F7F5F0;   /* warm canvas (kept per your call)         */
  --card:      #FFFFFF;   /* white surfaces                          */

  /* ---- ONE accent: royal blue. Used for buttons, links, the hero lift number. ----
     (Per-retailer --accent overrides this at login, as today.) */
  --accent:      #2D3ADC;  /* royal blue       */
  --accent-deep: #141C7A;  /* deep indigo      */
  --accent-soft: rgba(45, 58, 220, 0.08);

  /* ---- Structural dark + signature ---- */
  --royal:        #141C7A; /* deep indigo — hero panels, key headings */
  --royal-bright: #2D3ADC; /* royal blue                              */
  --paper:        #F7F5F0; /* match canvas                            */
  --paper-deep:   #ECEAE3; /* slightly deeper warm neutral (placeholders) */

  /* ---- DATA colors only (lift bars, status dots, L.E.A.D. coding, charts) ----
     This blue->teal scale encodes meaning; never used as decoration/chrome. */
  --mint: #45D3B5;   /* teal — strong/positive data        */
  --gold: #6EACDB;   /* mid blue (repurposed from gold)    */
  --lime: #3D90CF;   /* blue                               */
  --sky:  #76DFC9;   /* light mint                         */
  --ink-royal: #141C7A;

  /* ---- Semantic (kept functional; muted to fit the calm look) ---- */
  --green:      #1FB894;   /* teal-green positive  */
  --green-soft: rgba(31, 184, 148, 0.10);
  --amber:      #B57A1E;
  --amber-soft: rgba(181, 122, 30, 0.10);
  --red:        #C0392B;
  --red-soft:   rgba(192, 57, 43, 0.08);

  /* ---- Shape: soft, premium rounding ---- */
  --radius:    14px;       /* cards / surfaces (more generous, Apple-ish) */
  --radius-sm: 10px;       /* inputs, chips, smaller elements             */

  /* ---- Depth: very soft, flat-leaning shadows (no heavy drop shadows) ---- */
  --shadow-sm: 0 1px 2px rgba(20, 28, 48, 0.04);
  --shadow:    0 2px 10px rgba(20, 28, 48, 0.06);
  --shadow-lg: 0 8px 30px rgba(20, 28, 48, 0.10);

  /* ---- Display face — unchanged from the prior skin (weight is lightened
     in the heading rule, family kept per the re-skin brief) ---- */
  --font-display: "Source Serif 4", "Charter", Georgia, serif;

  /* ---- Motion easing — one signature curve, reused everywhere ---- */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

/* Let the serif display face pick its optical-size axis per heading size,
   so big headlines get true display cuts and small ones stay readable. */
h1, h2, h3, h4 { font-optical-sizing: auto; }

/* Accent-tinted text selection — a small, brand-consistent finish. */
::selection { background: var(--accent-soft); color: var(--accent-deep); }

h1, h2 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; color: var(--ink); line-height: 1.15; }
h3, h4 { font-weight: 500; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }

.tnum { font-feature-settings: "tnum" 1; font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted-2);
}
.muted { color: var(--muted); }

/* ---------- topbar ---------- */
.topbar {
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  transition: box-shadow 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
/* Browsers without backdrop-filter fall back to the solid surface so the
   bar never reads as washed-out over scrolled content. */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .topbar { background: var(--card); }
}
/* Once the page scrolls under it, the bar lifts off with a soft shadow
   (class toggled from app.js). At rest it stays flat. */
.topbar.scrolled { box-shadow: var(--shadow); }
.topbar-inner {
  height: 60px; display: flex; align-items: center; gap: 28px;
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 15px; letter-spacing: -0.02em;
  flex-shrink: 0;
}
/* Brand mark carrying a retailer logo instead of initials.
   FIXED 44px tile — never driven by the image's intrinsic size, so the
   topbar height is unchanged. overflow:hidden + a hard max on the image
   guarantee the logo is contained inside the tile (and a logo with its
   own opaque background reads as a tidy tile rather than bleeding across
   the bar). The image is centered and scaled to fit with object-fit. */
.brand-mark.has-logo {
  width: 44px; height: 44px; padding: 4px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  display: grid; place-items: center;
}
.brand-mark.has-logo img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text .b1 { font-weight: 800; font-size: 14px; letter-spacing: -0.02em; }
.brand-text .b2 { font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.nav a {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 8px 12px; border-radius: 6px; transition: 0.15s;
}
.nav a:hover { color: var(--ink); background: var(--line-soft); }
.nav a.active { color: var(--accent); background: var(--accent-soft); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta .name { font-size: 12.5px; font-weight: 700; }
.user-meta .role { font-size: 10.5px; color: var(--muted-2); }

.menu-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 16px; border-radius: 7px; border: 1px solid transparent;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s,
    transform 0.12s var(--ease-out), box-shadow 0.15s var(--ease-out);
  white-space: nowrap;
}
/* A touch of press feedback — buttons settle on click and the filled
   primary nudges up on hover. Keeps the UI feeling responsive, not floaty. */
.btn:active { transform: translateY(0.5px) scale(0.99); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-quiet { background: var(--line-soft); color: var(--ink-soft); }
.btn-quiet:hover { background: #E6E9EE; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { filter: brightness(0.93); }
.btn-danger { background: var(--card); color: var(--red); border-color: var(--red-soft); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 28px; }
.card-hover { transition: 0.18s; }
.card-hover:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }

/* ---------- tags / badges ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--line-soft); color: var(--ink-soft);
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending  { background: var(--amber-soft); color: var(--amber); }
.badge-approved { background: var(--green-soft); color: var(--green); }
.badge-changes  { background: var(--red-soft); color: var(--red); }
.badge-info     { background: var(--accent-soft); color: var(--accent); }
/* L.E.A.D. phase badges */
.badge-evaluate { background: var(--accent-soft); color: var(--accent); }
.badge-activate { background: var(--amber-soft); color: var(--amber); }
.badge-deploy   { background: var(--green-soft); color: var(--green); }

/* ---------- L.E.A.D. stepper ---------- */
.lead-stepper { display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.lead-step { display: flex; align-items: center; gap: 8px; }
.lead-step .ls-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11px; font-weight: 800;
  background: var(--line); color: var(--muted-2); border: 1px solid var(--line);
}
.lead-step .ls-label { font-size: 12px; font-weight: 700; color: var(--muted-2); letter-spacing: 0.02em; }
.lead-step.done .ls-dot { background: var(--green); color: #fff; border-color: var(--green); }
.lead-step.done .ls-label { color: var(--ink-soft); }
.lead-step.current .ls-dot { background: var(--accent); color: #fff; border-color: var(--accent); }
.lead-step.current .ls-label { color: var(--accent); }
.lead-sep { flex: 1; min-width: 18px; height: 2px; background: var(--line); margin: 0 10px; border-radius: 2px; }

/* ---------- evaluation (card click-in) ---------- */
/* Align to the top so the numbers panel sizes to its own content instead of
   stretching to match a tall block of stacked photos. */
.eval-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 820px) { .eval-hero { grid-template-columns: 1fr; } }
.eval-hero .photo { background: var(--ink) center/cover no-repeat; border-radius: var(--radius); min-height: 260px; }
.eval-hero .nums { display: flex; flex-direction: column; gap: 14px; }
/* Before / after store photos — two-up, stacking on narrow screens. Each shot
   holds a fixed landscape frame so portrait and landscape source images crop to
   the same tidy size instead of ballooning the hero. */
.eval-photos { display: grid; gap: 12px; }
.eval-photos.two,
.eval-photos.grid { grid-template-columns: 1fr 1fr; }
.eval-photos.one { grid-template-columns: 1fr; }
@media (max-width: 560px) { .eval-photos.two, .eval-photos.grid { grid-template-columns: 1fr; } }
.eval-shot { position: relative; margin: 0; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--ink); }
.eval-shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.eval-shot figcaption {
  position: absolute; top: 10px; left: 10px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(26,26,24,0.82); color: #fff; padding: 4px 10px; border-radius: 999px;
}
.eval-shot figcaption.after { background: var(--accent); }
.eval-num { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm); flex: 1; display: flex; flex-direction: column; justify-content: center; }
.eval-num .label { font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted-2); }
.eval-num .big { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-top: 8px; color: var(--accent); }
.eval-num .big.good { color: var(--green); }
.eval-num .hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

.eval-block { margin-top: 24px; }
.eval-block .card-pad { padding: 30px; }
.eval-block .eyebrow { color: var(--accent); }
.eval-block h2 { font-size: 21px; margin-top: 4px; }
/* Writeups run the full width of the card — the 72ch reading cap left the
   prose stopping short of the right edge on wide screens. */
.eval-block .lede { color: var(--ink-soft); margin-top: 10px; max-width: none; }

.quote { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 14px 18px; border-radius: 0 8px 8px 0; font-style: italic; color: var(--ink-soft); margin-top: 16px; }

/* PPO mini-tiles */
.ppo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 720px) { .ppo-grid { grid-template-columns: repeat(2, 1fr); } }
.ppo-tile { background: var(--line-soft); border-radius: var(--radius-sm); padding: 16px 18px; }
.ppo-tile .k { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.ppo-tile .v { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; margin-top: 5px; }

/* diagnostic scorecard */
.stage-row { display: grid; grid-template-columns: 200px 70px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line-soft); }
.stage-row:first-of-type { border-top: 0; }
@media (max-width: 720px) { .stage-row { grid-template-columns: 1fr; gap: 6px; } }
.stage-row .sname { font-weight: 700; font-size: 13.5px; }
.stage-row .sname .num { color: var(--muted-2); font-weight: 800; margin-right: 8px; }
.stage-row .sbar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 60px; }
.stage-row .sbar > span { display: block; height: 100%; border-radius: 4px; }
.stage-row .sfind { font-size: 12.5px; color: var(--muted); }
.stage-row.bind { background: var(--amber-soft); margin: 0 -12px; padding: 14px 12px; border-radius: 8px; border-top: 0; }
.stage-row.bind .sfind { color: var(--amber); font-weight: 600; }
.score-strong { background: var(--green); }
.score-mid    { background: var(--accent); }
.score-weak   { background: var(--red); }
.score-pill { font-size: 11px; font-weight: 800; color: var(--ink-soft); }

/* findings two-column */
.find-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 16px; }
@media (max-width: 720px) { .find-2 { grid-template-columns: 1fr; } }
.find-col h4 { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 8px; }
.find-col ul { list-style: none; }
.find-col li { font-size: 13px; color: var(--ink-soft); padding-left: 18px; position: relative; margin-bottom: 9px; }
.find-col li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* specs grid */
.specs { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
@media (max-width: 820px) { .specs { grid-template-columns: repeat(2, 1fr); } }
.spec { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec .k { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }
.spec .v { font-weight: 700; margin-top: 4px; }

/* CTA band */
.cta-band { position: relative; overflow: hidden; background: var(--royal); color: #fff; border-radius: var(--radius); padding: 28px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-top: 24px; }
.cta-band::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(110% 130% at 100% 0%, #000 14%, transparent 70%);
          mask-image: radial-gradient(110% 130% at 100% 0%, #000 14%, transparent 70%);
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h3 { color: #fff; font-size: 18px; }
.cta-band p { color: rgba(255,255,255,0.7); font-size: 13px; margin-top: 4px; }

/* approval-needed callout (Soon to Market) */
.approval-needed { display: flex; gap: 14px; align-items: center; background: var(--amber-soft); border: 1px solid var(--amber); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 18px; }
.approval-needed .ic { font-size: 18px; }
.approval-needed .k { font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--amber); }
.approval-needed .t { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 2px; }

/* objective callout */
.objective { display: flex; gap: 14px; align-items: flex-start; background: var(--accent-soft); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px; }
.objective .ic { font-size: 18px; line-height: 1.4; }
.objective .k { font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--accent); }
.objective .t { font-size: 14.5px; color: var(--ink); font-weight: 600; margin-top: 3px; }

/* what we've done — methods */
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; margin-top: 16px; }
@media (max-width: 720px) { .method-grid { grid-template-columns: 1fr; } }
.method h4 { font-size: 13px; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.method h4::before { content: '✓'; color: var(--accent); font-weight: 800; }
.method ul { list-style: none; }
.method li { font-size: 12.5px; color: var(--muted); padding-left: 14px; position: relative; margin-bottom: 6px; }
.method li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }

/* 3 key learnings */
.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
@media (max-width: 820px) { .learn-grid { grid-template-columns: 1fr; } }
.learn-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.learn-card .ln-num { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.learn-card h4 { font-size: 14.5px; margin: 12px 0 8px; letter-spacing: -0.01em; }
.learn-card p { font-size: 12.5px; color: var(--ink-soft); }

/* design guide pillars */
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
@media (max-width: 820px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-col { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.guide-col .gh { background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 11px 16px; }
.guide-col ul { list-style: none; padding: 14px 16px; }
.guide-col li { font-size: 12.5px; color: var(--ink-soft); padding-left: 16px; position: relative; margin-bottom: 9px; }
.guide-col li::before { content: ''; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

.breadcrumb { font-size: 12.5px; color: var(--muted); padding: 22px 0 0; display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--muted-2); }

/* ---------- page header ---------- */
.page-head { padding: 36px 0 8px; }
.page-head h1 { font-size: 26px; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 14px; max-width: 70ch; }
.page-section { padding: 22px 0 48px; }

/* ---------- stat grid ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 760px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out), border-color 0.18s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line); }
.stat .label { font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted-2); }
.stat .num { font-size: 32px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin-top: 10px; }
.stat .num.accent { color: var(--accent); }
.stat .num.good { color: var(--green); }
.stat .sub { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }

/* ---------- dashboard: bar charts ---------- */
.bars { display: grid; gap: 15px; padding: 4px 20px 20px; }
.bar-row { }
.bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 7px; }
.bar-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bar-val { font-size: 13px; font-weight: 800; color: var(--green); }
.bar-track { height: 8px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.bar-sub { font-size: 11px; color: var(--muted-2); margin-top: 5px; }

/* ---------- dashboard: leaderboard ---------- */
.lb { padding: 6px 12px 12px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 8px; text-decoration: none; color: inherit; transition: background .12s ease; }
.lb-row:hover { background: var(--accent-soft); }
.lb-rank { flex: none; width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--line); color: var(--muted); }
.lb-rank.gold { background: var(--accent); color: #fff; }
.lb-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.lb-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-track { height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.lb-fill { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.lb-val { flex: none; font-size: 14px; font-weight: 800; color: var(--green); }

/* ---------- dashboard: program status ---------- */
.seg-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line-soft); margin-top: 4px; }
.seg { height: 100%; }
.seg.live { background: var(--green); }
.seg.soon { background: var(--amber); }
.seg-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.seg-leg { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.seg-leg b { color: var(--ink); }
.seg-leg .dot { width: 9px; height: 9px; border-radius: 50%; }
.seg-leg .dot.live { background: var(--green); }
.seg-leg .dot.soon { background: var(--amber); }
.ps-note { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.ps-action { font-weight: 700; color: var(--accent); text-decoration: none; }
.ps-action:hover { text-decoration: underline; }
.ps-clear { font-weight: 600; color: var(--green); }

/* ---------- store / concept grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 980px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.thumb {
  aspect-ratio: 16 / 10; background: var(--ink) center/cover no-repeat;
  border-radius: var(--radius) var(--radius) 0 0; position: relative;
}
.thumb .thumb-tag {
  position: absolute; top: 10px; left: 10px;
  background: rgba(26,26,24,0.82); color: #fff; backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.thumb .thumb-badge { position: absolute; top: 10px; right: 10px; }

.store-card .body { padding: 16px; }
.store-card .city { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.store-card h3 { font-size: 15px; margin-top: 3px; letter-spacing: -0.02em; }
.store-card .metrics { display: flex; gap: 18px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.store-card .metric .v { font-size: 18px; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; }
.store-card .metric .k { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); }

/* ---------- store card v2 (dark hero + status) ---------- */
.store-card-v2 { display: block; overflow: hidden; }
.sc-hero {
  position: relative; aspect-ratio: 16 / 11; overflow: hidden;
  background: var(--royal);
  padding: 20px 22px; display: flex; flex-direction: column; color: #fff;
}
.sc-hero > * { position: relative; z-index: 1; }
/* Optional store photo banner behind the hero text. Hidden until it loads
   (so a missing file never flashes a broken icon); a scrim keeps the white
   text legible over any photo. Falls back to the solid royal hero. */
.sc-hero img.sc-photo { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.35s ease; }
.sc-hero.has-photo img.sc-photo { opacity: 1; }
.sc-hero.has-photo::after { content: ''; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, rgba(20,21,40,0.28) 0%, rgba(20,21,40,0.70) 100%); }
.sc-div { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.55); }
.sc-num { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 52px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; }
.sc-num small { font-size: 10px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.55); margin-top: 8px; }
.sc-banner { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }

.sc-body { padding: 16px 18px 18px; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-loc { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.sc-name { font-size: 18px; margin-top: 8px; letter-spacing: -0.02em; }
.sc-addr { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sc-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tag-fill { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; padding: 5px 11px; border-radius: 6px; background: var(--accent); color: #fff; }
.tag-line { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 6px; border: 1px solid var(--line); color: var(--ink-soft); }
.sc-constraint { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 6px 11px; border-radius: 6px; }
.sc-meta { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted-2); margin-top: 14px; }
.sc-div-line { height: 1px; background: var(--line-soft); border: 0; margin: 14px 0; }
.sc-inmarket { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.sc-inmarket span:first-child { color: var(--muted); font-weight: 600; }
.sc-inmarket span:last-child { color: var(--ink-soft); font-weight: 700; }

/* ---------- solutions catalog ---------- */
.sol-card .thumb { aspect-ratio: 16 / 9; }
.sol-bestfor { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.sol-bestfor .eyebrow { display: block; margin-bottom: 8px; }
.sol-bestfor ul { list-style: none; }
.sol-bestfor li { font-size: 12.5px; color: var(--ink-soft); padding-left: 18px; position: relative; margin-bottom: 7px; }
.sol-bestfor li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 800; font-size: 11px; }

/* ---------- before/after ---------- */
.ba { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.ba figure { position: relative; margin: 0; }
.ba img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--ink); }
.ba figcaption {
  position: absolute; bottom: 8px; left: 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(26,26,24,0.82); color: #fff; padding: 3px 8px; border-radius: 5px;
}
.ba figcaption.after { background: var(--accent); }

/* ---------- table ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left; font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-2); padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.tbl tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--line-soft); }

/* ---------- forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { resize: vertical; min-height: 84px; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } }
.auth-aside {
  background: var(--royal);
  color: #fff; padding: 56px 56px; display: flex; flex-direction: column; justify-content: space-between;
}
@media (max-width: 900px) { .auth-aside { display: none; } }
.auth-aside .pitch h2 { color: #fff; font-size: 34px; line-height: 1.1; max-width: 16ch; }
.auth-aside .pitch p { color: rgba(255,255,255,0.7); margin-top: 16px; font-size: 15px; max-width: 44ch; }
.auth-feats { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; }
.auth-feat { display: flex; gap: 12px; align-items: flex-start; }
.auth-feat .ic { width: 30px; height: 30px; border-radius: 8px; background: rgba(255,255,255,0.12); display: grid; place-items: center; flex-shrink: 0; }
.auth-feat .t { font-size: 13.5px; font-weight: 700; }
.auth-feat .d { font-size: 12.5px; color: rgba(255,255,255,0.6); }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 24px; }
.auth-card .sub { color: var(--muted); margin: 6px 0 26px; font-size: 13.5px; }

.notice { font-size: 12.5px; padding: 11px 13px; border-radius: 8px; margin-bottom: 16px; }
.notice-err { background: var(--red-soft); color: var(--red); }
.notice-info { background: var(--accent-soft); color: var(--accent-deep); }
.notice-warn { background: var(--amber-soft); color: var(--amber); }

.demo-accounts { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.demo-accounts .eyebrow { display: block; margin-bottom: 10px; }
.demo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 0; font-size: 12.5px;
}
.demo-row .who { display: flex; align-items: center; gap: 8px; }
.demo-row .mono { font-family: 'Inter', monospace; color: var(--muted); font-size: 11.5px; }
.mini-mark { width: 18px; height: 18px; border-radius: 4px; display: grid; place-items: center; color: #fff; font-size: 9px; font-weight: 800; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: 0.25s; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- misc ---------- */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.spacer { flex: 1; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .big { font-size: 32px; margin-bottom: 8px; }
.divider { height: 1px; background: var(--line); margin: 28px 0; border: 0; }
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 18px 0 4px; }
.chip {
  font-size: 12.5px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: 0.15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Small live-count pill (e.g. "12 shown") — sits next to a section title
   or filter bar and tickers via Portal.countUp when its value changes. */
.count-pill {
  font-size: 12px; font-weight: 700; color: var(--muted);
  background: var(--line-soft); padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}

.fade-in { animation: fadeIn 0.4s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; background: #fff; border-bottom: 1px solid var(--line); padding: 8px; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; margin-left: auto; }
  .topbar-right .user-meta { display: none; }
}

/* ============================================================
   Transaction Zone signature styling — adapted from
   marsretaildesign.com: royal/cream colour-blocking, monospace
   kickers, oversized display headlines with italic emphasis,
   big figures with a raised unit, pastel L.E.A.D. category cards.
   ============================================================ */

/* Monospace kicker with a leading rule — "— THE PROGRAM" */
.kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', monospace;
  font-size: 11px; font-weight: 500; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--royal-bright);
}
.kicker::before { content: ''; width: 26px; height: 2px; background: currentColor; border-radius: 2px; opacity: 0.85; }
.kicker.on-dark { color: rgba(255, 255, 255, 0.82); }

/* Oversized display headline with italic-coloured emphasis */
.display {
  font-weight: 500; letter-spacing: -0.035em; line-height: 1.05;
  font-size: clamp(28px, 4.4vw, 46px); color: var(--ink-royal); margin-top: 14px;
}
.display em { font-style: italic; font-weight: 600; color: var(--royal-bright); }
.display.on-dark { color: #fff; }
.display.on-dark em { color: #fff; opacity: 0.78; }

/* Big figure with a small raised unit — "44.5%" */
.figure { font-weight: 600; letter-spacing: -0.04em; line-height: 1; font-size: clamp(36px, 4.8vw, 56px); }
.figure .unit { font-size: 0.4em; font-weight: 600; vertical-align: 0.72em; margin-left: 2px; letter-spacing: 0; opacity: 0.55; }
.figure .of { font-size: 0.34em; font-weight: 700; color: inherit; opacity: 0.5; letter-spacing: 0; }

/* Hero colour-block — uses the retailer accent so each brand keeps
   its colour while wearing the TZ layout. */
.hero-band {
  position: relative; overflow: hidden;
  background: var(--accent); color: #fff;
  border-radius: var(--radius); padding: 40px 40px 34px;
  box-shadow: var(--shadow-sm);
}
/* Depth on the flat accent block: a faint engineering grid (echoing the
   login hero) plus a soft corner sheen. Both are white-on-accent overlays,
   so they read correctly against ANY retailer's brand colour. */
.hero-band::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  -webkit-mask-image: radial-gradient(120% 130% at 100% 0%, #000 18%, transparent 72%);
          mask-image: radial-gradient(120% 130% at 100% 0%, #000 18%, transparent 72%);
}
.hero-band::after {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(75% 120% at 0% 0%, rgba(255, 255, 255, 0.16), transparent 58%);
}
.hero-band > * { position: relative; z-index: 1; }
.hero-band .sub { color: rgba(255,255,255,0.78); font-size: 14px; margin-top: 14px; max-width: 60ch; }

/* KPI figures inside the hero, divided by hairlines */
.hero-kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  margin-top: 28px; border-top: 1px solid rgba(255,255,255,0.22);
}
.hero-kpi { padding: 20px 22px 4px; border-left: 1px solid rgba(255,255,255,0.22); }
.hero-kpi:first-child { border-left: 0; padding-left: 2px; }
.hero-kpi .k { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.7); }
.hero-kpi .figure { color: #fff; margin-top: 12px; }
.hero-kpi .cap { font-size: 11.5px; color: rgba(255,255,255,0.66); margin-top: 10px; }
@media (max-width: 860px) {
  .hero-kpis { grid-template-columns: repeat(2, 1fr); }
  .hero-kpi:nth-child(odd) { border-left: 0; padding-left: 2px; }
  .hero-kpi:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.18); }
}

/* Section kicker row above a band of cards */
.sec-head { margin: 48px 0 18px; }
.sec-head h2 { font-size: 21px; letter-spacing: -0.03em; color: var(--ink-royal); margin-top: 12px; }

/* Pastel L.E.A.D. category card — index tile + coloured top rule */
.cat-card { border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out); }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.cat-card .cat-rule { height: 5px; }
.cat-card .cat-head { display: flex; align-items: center; gap: 13px; padding: 20px 22px 4px; }
.cat-idx { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: var(--ink-royal); }
.cat-card .cat-meta .ix { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.cat-card .cat-meta h3 { font-size: 16px; margin-top: 3px; color: var(--ink-royal); }
.cat-mint .cat-rule, .cat-mint .cat-idx { background: var(--mint); }
.cat-gold .cat-rule, .cat-gold .cat-idx { background: var(--gold); }
.cat-lime .cat-rule, .cat-lime .cat-idx { background: var(--lime); }
.cat-sky  .cat-rule, .cat-sky  .cat-idx { background: var(--sky); }

/* Footer caption inside a card — mono, hairline above */
.card-foot { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10.5px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--muted-2); padding: 14px 22px 18px; border-top: 1px solid var(--line-soft); margin-top: 6px; }

/* Pill CTA — the "Engage →" treatment */
.btn-pill { border-radius: 999px; padding: 9px 18px; font-weight: 700; }
.btn-pill.on-dark { background: #fff; color: var(--accent); border-color: #fff; }
.btn-pill.on-dark:hover { background: rgba(255,255,255,0.88); }

/* Refined card heading rows on the dashboard */
.card .card-pad h3 { color: var(--ink-royal); }

/* Bar-chart refinements for the signature look */
.bars { padding: 8px 22px 22px; gap: 17px; }
.bar-label { color: var(--ink-royal); font-weight: 700; }
.bar-val { color: var(--royal-bright); }
.bar-track { background: var(--paper-deep); height: 9px; }
.bar-fill { background: var(--accent); }
.bar-fill.c-mint { background: var(--mint); }
.bar-fill.c-gold { background: var(--gold); }
.bar-fill.c-lime { background: var(--lime); }

/* Leaderboard refinements */
.lb-rank { border-radius: 9px; background: var(--paper-deep); color: var(--royal-bright); }
.lb-rank.gold { background: var(--accent); color: #fff; }
.lb-name { color: var(--ink-royal); }
.lb-fill { background: var(--accent); }
.lb-val { color: var(--royal-bright); }

/* Soft entrance for dashboard cards */
.rise { animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Two-tier store view — Proof of Economics cards (reusing the
   existing .store-card-v2) on top, then a kit-grouped rollout
   gallery of lighter thumbnails below. Used on analysis.html
   only for retailers that have rollout-tier stores.
   ============================================================ */
.tier-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 22px 0 14px; }
.tier-head .eyebrow { color: var(--accent); }
.tier-head h2 { font-size: 22px; letter-spacing: -0.02em; }
.tier-head .tier-count { font-size: 13px; font-weight: 600; color: var(--muted); }
/* A collapsible tier heading (e.g. Tier 1) toggles its content below. */
.tier-head.collapsible { cursor: pointer; user-select: none; }
.tier-head.collapsible:hover h2 { color: var(--accent); }
.tier-head.collapsible:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: var(--radius-sm); }
.tier-chevron { flex: none; align-self: center; margin-left: auto; color: var(--muted-2); transition: transform 0.2s ease; }
.tier-head.collapsible[aria-expanded="true"] .tier-chevron { transform: rotate(90deg); }

/* Rollout: one collapsible row per kit size */
.rollout-groups { display: grid; gap: 12px; margin-top: 14px; }
.kit-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; box-shadow: var(--shadow-sm); }
.kit-group-head {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 16px 18px; background: none; border: 0; cursor: pointer; font: inherit; color: inherit;
  transition: background 0.15s ease;
}
.kit-group-head:hover { background: var(--accent-soft); }
.kit-badge {
  flex: none; min-width: 42px; height: 30px; padding: 0 10px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: 8px;
  font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
  background: var(--accent); color: #fff;
}
.kit-group-title { font-size: 15px; font-weight: 700; color: var(--ink-royal); }
.kit-group-count { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kit-chevron { margin-left: auto; flex: none; color: var(--muted-2); transition: transform 0.2s ease; }
.kit-group-head[aria-expanded="true"] .kit-chevron { transform: rotate(90deg); }
.kit-group-body { padding: 0 16px 16px; }
.kit-group-body[hidden] { display: none; }

/* Lighter thumbnail card grid inside an expanded kit group */
.rt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 980px) { .rt-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .rt-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .rt-grid { grid-template-columns: 1fr; } }

.rt-thumb {
  display: block; border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--card); text-decoration: none; color: inherit;
  transition: 0.16s;
}
.rt-thumb:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.rt-thumb-img { position: relative; aspect-ratio: 16 / 10; background: var(--paper-deep); overflow: hidden; }
/* Placeholder: the store number, shown until (or unless) the photo paints over it */
.rt-thumb-img::after {
  content: attr(data-num); position: absolute; inset: 0; z-index: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--muted-2);
}
.rt-thumb-img img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s ease; }
.rt-thumb-img img.loaded { opacity: 1; }
.rt-thumb-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; }
.rt-thumb-name { font-size: 13px; font-weight: 700; color: var(--ink-royal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   Premium polish layer — finish & motion.
   Centralised, additive, and reversible. Applies across every
   page via portal.css; nothing here changes layout or content.
   ============================================================ */

/* ---- Keyboard focus ring — visible only for keyboard users, so it
   never intrudes on mouse/touch clicks but keeps the portal accessible. */
a:focus-visible,
button:focus-visible,
.chip:focus-visible,
.btn:focus-visible,
.lb-row:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---- Thin, warm scrollbar to match the canvas (WebKit + Firefox). ---- */
* { scrollbar-width: thin; scrollbar-color: var(--muted-2) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D8D5CC; border: 3px solid var(--bg); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

/* ---- Animated data fills — bars, leaderboard rows and the program
   status segments grow in on first paint. Done with scaleX from a left
   origin so the inline target width (set per-row in JS) stays exact: no
   measurement, no parsing, no JS. Track backgrounds show through as they
   grow, reading like a live read-out rather than a static chart. ---- */
.bar-fill, .lb-fill, .seg, .stage-row .sbar > span {
  transform-origin: left center;
  animation: growX 0.85s var(--ease-out) both;
}
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- Respect a user's reduced-motion preference: drop every entrance
   animation, fill growth, and hover/press transform. The interface stays
   fully functional and instant — just still. (Health + accessibility:
   this site animates a fair amount and previously had no such guard.) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .bar-fill, .lb-fill, .seg, .stage-row .sbar > span { transform: none !important; }
  .btn:hover, .stat:hover, .cat-card:hover, .card-hover:hover, .rt-thumb:hover {
    transform: none !important;
  }
}

/* ---- Color-scheme-aware "dusk" tint ----------------------------------
   For visitors whose OS is in dark mode, soften the canvas from bright
   paper to a dimmer warm paper and drop pure-white surfaces to a calm
   off-white — easier on the eyes at night without inverting the design
   or its meaning. This is a *tint*, not a dark theme: ink stays dark, so
   every text/surface contrast pair holds, and the per-retailer accent
   (set inline on <html> at login) is deliberately left untouched.
   Driven entirely through the design tokens, so it reaches every page. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #E7E4DC;   /* dimmer warm canvas        */
    --card:      #F4F1EA;   /* off-white surface         */
    --line:      #D9D5CB;   /* slightly firmer hairline  */
    --line-soft: #E4E0D7;
    --paper:     #E7E4DC;
    --paper-deep:#DCD7CD;
  }
  /* Keep the few literal-white surfaces on the same dusk paper as cards. */
  .topbar { background: rgba(244, 241, 234, 0.72); }
  .field input, .field select, .field textarea,
  .chip { background: var(--card); }
  /* Trim shadows so cards still read as raised on the deeper canvas. */
  .card, .stat, .cat-card, .kit-group { box-shadow: 0 1px 2px rgba(20, 28, 48, 0.05); }
}

/* ============================================================
   Dashboard modules — Insights ("what your data is telling you")
   and the Learn case study. Reuse the card system; only the
   inner treatments are new.
   ============================================================ */

/* ---- Action band: the promoted sign-off queue ---- */
.action-band { border-color: var(--amber); }
.action-band .ab-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); }
.action-band .ab-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 800; color: var(--ink); }
.action-band .ab-title .ab-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--amber-soft); color: var(--amber); display: grid; place-items: center; font-size: 14px; }
.action-row { display: flex; gap: 13px; align-items: center; padding: 13px 22px; border-top: 1px solid var(--line-soft); text-decoration: none; color: inherit; transition: background 0.12s ease; }
.action-row:first-of-type { border-top: 0; }
.action-row:hover { background: var(--amber-soft); }
.action-row .ar-thumb { width: 62px; min-width: 62px; height: 42px; border-radius: 7px; background: var(--paper-deep) center/cover no-repeat; }
.action-row .ar-main { flex: 1; min-width: 0; }
.action-row .ar-title { font-weight: 700; font-size: 13.5px; }
.action-row .ar-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.action-row .ar-gate { display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 3px 9px; border-radius: 999px; }

/* ---- Insight card: a label, a serif takeaway, a one-line "so what" ---- */
.insight { display: flex; flex-direction: column; height: 100%; }
.insight .ins-take { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.22; letter-spacing: -0.02em; color: var(--ink-royal); margin-top: 13px; }
.insight .ins-take b { color: var(--accent); font-weight: 600; font-style: italic; }
.insight .ins-sub { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.insight .ins-link { margin-top: auto; padding-top: 14px; font-size: 12.5px; font-weight: 700; color: var(--accent); }
.insight .ins-link:hover { text-decoration: underline; }

/* ---- Measured-vs-projected proof strip ---- */
.proof-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
@media (max-width: 640px) { .proof-strip { grid-template-columns: 1fr; } }
.proof-cell { padding: 4px 22px; border-left: 1px solid var(--line-soft); }
.proof-cell:first-child { border-left: 0; padding-left: 0; }
@media (max-width: 640px) { .proof-cell { border-left: 0; padding-left: 0; border-top: 1px solid var(--line-soft); padding-top: 14px; margin-top: 14px; } .proof-cell:first-child { border-top: 0; margin-top: 0; padding-top: 0; } }
.proof-cell .pc-k { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.proof-cell .pc-v { font-weight: 600; font-size: 26px; letter-spacing: -0.03em; margin-top: 8px; color: var(--ink-royal); }
.proof-cell .pc-v.good { color: var(--green); }
.proof-cell .pc-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; }

/* ---- Learn: featured case study ---- */
.case { overflow: hidden; display: grid; grid-template-columns: 1.05fr 1fr; }
@media (max-width: 760px) { .case { grid-template-columns: 1fr; } }
.case .case-media { position: relative; min-height: 250px; background: var(--royal) center/cover no-repeat; }
.case .case-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,21,40,0.10) 0%, rgba(20,21,40,0.66) 100%); }
.case .case-stat { position: absolute; left: 18px; bottom: 16px; z-index: 1; color: #fff; }
.case .case-stat .cs-big { font-weight: 600; font-size: 40px; letter-spacing: -0.03em; line-height: 1; }
.case .case-stat .cs-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.78); margin-top: 6px; }
.case .case-body { padding: 26px 28px; display: flex; flex-direction: column; }
.case .case-body h3 { font-size: 17px; color: var(--ink-royal); margin-top: 6px; }
.case .case-flow { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.case .case-step { font-size: 12.5px; color: var(--ink-soft); padding-left: 22px; position: relative; }
.case .case-step .cf-k { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted-2); display: block; margin-bottom: 2px; }
.case .case-step::before { content: ''; position: absolute; left: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.case .case-body .btn { margin-top: auto; align-self: flex-start; }
