/* Sales rep and owner rep-admin screens. Mobile first. */
:root {
  --navy: #0d1b2e;
  --navy-2: #16304f;
  --accent: #1a73e8;
  --accent-dk: #1557b0;
  --gold: #f5c518;
  --ink: #0d1b2e;
  --muted: #5c6b7e;
  --line: #e3e8ef;
  --bg: #f4f7fb;
  --card: #fff;
  --ok: #137333;
  --warn: #8a5a00;
  --bad: #b3261e;
  --pad: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "DM Sans", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 {
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: .95;
  margin: 0;
}
.top {
  background: var(--navy);
  color: #fff;
  padding: 14px var(--pad);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  color: #fff;
  text-decoration: none;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.brand i { font-style: normal; color: #8eb6f8; }
.top nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.top a.nav, .top button.linkish {
  color: #fff;
  text-decoration: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 16px var(--pad) 48px; }
/* Sign-in column. 442px of content measures about 420px at a 1280px window,
   where the page is zoomed to 95%. The card fills that column. */
body[data-page="login"] main.wrap { max-width: calc(442px + (var(--pad) * 2)); }
.lede { color: var(--muted); margin: 8px 0 0; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}
.card h2 { font-size: 26px; margin-bottom: 8px; }
label { display: block; font-weight: 700; font-size: 14px; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  border: 1px solid #cfd6e0;
  border-radius: 10px;
  padding: 12px;
  background: #fff;
  min-height: 48px;
}
textarea { min-height: 88px; resize: vertical; }
.row { display: grid; gap: 10px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.btn.secondary { background: var(--navy); }
.btn.ghost {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ic, .ic { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -0.15em; }
.ic svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.err, .warn, .okmsg {
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
}
.err { background: #fdecea; color: var(--bad); }
.warn { background: #fff6e0; color: var(--warn); }
.okmsg { background: #e8f6ee; color: var(--ok); }
.hidden { display: none !important; }
label.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  margin: 14px 0;
}
label.check input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 1px;
}
label.check span { font-weight: 600; line-height: 1.35; flex: 1; min-width: 0; }
h1 { overflow-wrap: anywhere; }
button.textlink {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: none;
  border: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  cursor: pointer;
  padding: 8px 4px;
}
.lede, .card, .meta { overflow-wrap: anywhere; }
.variant {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.variant img { width: 56px; height: 56px; object-fit: contain; background: #f7f8fa; border-radius: 8px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}
.stepper b { min-width: 28px; text-align: center; font-size: 18px; }
.choice { display: flex; gap: 8px; align-items: center; padding: 10px 0; }
.choice input { width: auto; min-height: 0; }
.store-pick, .target, .order {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  background: #fff;
  text-align: left;
  width: 100%;
  cursor: pointer;
  line-height: 1.45;
  text-decoration: none;
  color: inherit;
}
.order > div, .order .meta {
  display: block;
  line-height: 1.45;
  margin-top: 6px;
}
.store-pick.active, .target.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(26,115,232,.2); }
.meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #e8eef8;
  color: var(--navy);
}
.badge.paid { background: #e8f6ee; color: var(--ok); }
.badge.sent { background: #e8f1fd; color: var(--accent-dk); }
.badge.overdue { background: #fdecea; color: var(--bad); }
.badge.void { background: #eee; color: #555; }
.summary { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px; margin-top: 12px; }
.summary h2 { color: #fff; }
.summary .line { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.summary .total { font-size: 28px; font-family: "Barlow Condensed", Arial, sans-serif; font-weight: 900; }
.bars { display: grid; gap: 10px; margin-top: 8px; }
.bar label { margin: 0 0 4px; font-size: 13px; }
.track { height: 10px; background: #e6edf6; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--accent); width: 0; }
.map {
  width: 100%;
  height: 220px;
  border: 0;
  border-radius: 12px;
  margin-top: 8px;
  background: #dfe6ef;
}
.qr { width: min(280px, 100%); height: auto; display: block; margin: 12px auto; background: #fff; border-radius: 12px; }
.qr svg { width: 100%; height: auto; display: block; }
.center { text-align: center; }
.links { display: grid; gap: 8px; }
.links a {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: var(--ink);
}
.links a b { display: block; }
.links a span { color: var(--muted); font-size: 13px; }
.split { display: grid; gap: 10px; }
.remind {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  margin-top: 8px;
  background: #fffdf6;
  border-radius: 10px;
}
.remind.overdue { border-left-color: var(--bad); background: #fdecea; }
.remind b { display: block; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions a, .actions button.mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  text-decoration: none;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
}
.badge.ready { background: #fff6e0; color: var(--warn); }
.badge.shipped, .badge.planned { background: #e8f1fd; color: var(--accent-dk); }
.badge.waiting, .badge.new { background: #eee; color: #555; }
.badge.delivered, .badge.done { background: #e8f6ee; color: var(--ok); }
.badge.cancelled, .badge.declined { background: #fdecea; color: var(--bad); }
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  min-height: 36px;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.range-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 6px;
  flex: 1 1 300px;
  min-width: min(100%, 220px);
  max-width: 100%;
}
.range-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 96px;
  min-width: 0;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
}
.range-field input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 36px;
  padding: 4px 6px;
  font-size: 12px;
}
.range-apply {
  width: auto;
  flex: 0 0 auto;
  min-height: 36px;
  margin: 0;
  padding: 0 8px;
  font-size: 13px;
  letter-spacing: 0;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}
.kpi {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  height: 100%;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px 6px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.kpi b {
  display: block;
  margin-top: 3px;
  font-family: "Barlow Condensed", Arial, sans-serif;
  font-size: 24px;
  font-weight: 900;
  font-synthesis: none;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
  -webkit-text-stroke: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  white-space: nowrap;
  max-width: 100%;
}
.kpi small { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; line-height: 1.25; }
.kpi small.rule {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.kpi small.pending { color: var(--warn); font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.kpi small.deduct {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
.color-qty {
  display: inline-grid;
  grid-template-columns: 44px max-content 4.5rem;
  column-gap: 8px;
  row-gap: 8px;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin: 8px 0 4px;
  vertical-align: top;
}
.color-qty #lines,
.color-qty .qty-line,
.color-qty .qty-sum { display: contents; }
.color-qty .qty-line img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
}
.color-qty .qty-name {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0;
  line-height: 1.15;
  font-weight: 700;
  white-space: nowrap;
}
.color-qty .qty-name b { font-size: 15px; }
.color-qty .qty-name span { font-size: 12px; color: var(--muted); font-weight: 700; }
.color-qty .qty-line input {
  width: 4.5rem;
  min-height: 40px;
  padding: 6px 4px;
  text-align: center;
}
.color-qty #deductNote {
  grid-column: 1 / 3;
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.3;
}
.color-qty #qtyTotal {
  grid-column: 3;
  margin: 2px 0 0;
  text-align: center;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.spark { display: block; width: 100%; height: 24px; margin-top: auto; flex: 0 0 auto; }
.spark-base { stroke: var(--gold); stroke-width: 1; }
.spark-bar { fill: var(--navy); }
.spark-hit { fill: transparent; cursor: pointer; }
.spark text {
  fill: var(--muted);
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
}
.spark-tip {
  min-height: 0;
  margin: 1px 0 0;
  color: var(--navy);
  font-size: 9px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.spark-tip:empty { display: none; }
.mat-jump-row { margin: 0; }
.mat-jump {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mat-jump:hover { color: var(--navy); }
.card.marketing { padding: 10px 10px 8px; min-width: 0; max-width: 100%; scroll-margin-top: 12px; }
.card.marketing h2 { margin-bottom: 6px; font-size: 18px; }
.strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.piece {
  flex: 0 0 104px;
  width: 104px;
  min-width: 104px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}
.piece img { width: 100%; height: 108px; object-fit: cover; object-position: top center; display: block; background: #eef2f7; }
.piece b {
  display: block;
  padding: 4px 6px 5px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.summary a,
.viewer a:not(.btn),
.top a[href^="mailto:"] {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}
.top .signin-with {
  flex: 1 0 100%;
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.top .signin-with span {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(13, 27, 46, .94);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.viewer-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
}
.viewer-bar b { margin-right: auto; font-size: 16px; }
.viewer-bar .btn { width: auto; min-height: 40px; padding: 0 12px; }
.stage {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage img {
  max-width: 92%;
  max-height: 92%;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}
body.viewer-open { overflow: hidden; }
.stage { position: relative; }
.viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  cursor: pointer;
}
.viewer-arrow:hover { background: rgba(255, 255, 255, .26); }
.viewer-arrow:focus-visible { outline: 2px solid #8eb6f8; outline-offset: 2px; }
.viewer-arrow.prev { left: 12px; }
.viewer-arrow.next { right: 12px; }
.viewer-arrow svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.viewer-arrow.hidden { display: none; }
.viewer-ask {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(13, 27, 46, .7);
}
.viewer-ask.hidden { display: none; }
.viewer-ask-card { background: #fff; color: var(--navy); border-radius: 14px; padding: 18px; max-width: 24rem; width: 100%; }
.viewer-ask-card p { margin: 0 0 14px; font-weight: 700; font-size: 16px; line-height: 1.35; }
.viewer-ask-row { display: flex; gap: 8px; justify-content: flex-end; }
.viewer-ask-row .btn { width: auto; min-height: 40px; padding: 0 16px; }

/* Owner-only Reps page and the read-only view of another rep's dashboard. */
.rep-top .page-nav a.nav[hidden] { display: none; }
body[data-page="reps"] .wrap { max-width: 1240px; }
.rep-tile span { white-space: nowrap; }
.store-logo {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e6edf7;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.store-logo.big { flex-basis: 48px; width: 48px; height: 48px; border-radius: 12px; font-size: 16px; }
.store-logo.has-img { background: #fff; border: 1px solid var(--line); }
.store-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cust-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cust-head h2 { min-width: 0; }
.store-pick .prospect-mark { margin-right: 4px; }
.rep-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-top: 12px; }
.rep-card { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rep-card-head { display: flex; align-items: center; gap: 12px; }
.rep-card-head h2 { font-size: 24px; }
.rep-card-head .meta { margin: 2px 0 0; }
.rep-card-avatar {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.rep-card-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rep-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rep-tile { background: #f4f7fb; border-radius: 10px; padding: 8px 10px; min-width: 0; }
.rep-tile b { display: block; font-size: 17px; color: var(--navy); overflow-wrap: anywhere; }
.rep-tile span { font-size: 11px; color: var(--muted); }
.rep-card .btn { margin-top: auto; }
.view-as-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px var(--pad);
  background: #fff7d6;
  color: var(--navy);
  border-bottom: 1px solid #ecd98a;
  font-size: 14px;
}
.view-as-bar .btn { width: auto; min-height: 36px; padding: 0 14px; }
.target.done { opacity: .62; }
.task-row { display: flex; gap: 10px; align-items: flex-start; }
.task-row input[type="checkbox"] { width: auto; min-height: 0; margin-top: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.row-actions .btn { width: auto; min-height: 44px; padding: 0 14px; font-size: 16px; }
@media (min-width: 720px) {
  .split.two { grid-template-columns: 1fr 1fr; }
  .row.three { grid-template-columns: 1.4fr .8fr .6fr; }
  .btn.inline { width: auto; padding: 0 22px; }
  .map { height: 280px; }
}
.kpi small.wait {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
input:disabled { background: #f4f7fb; color: var(--muted); }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 359px) {
  :root { --pad: 12px; }
  .variant { grid-template-columns: 44px 1fr; }
  .stepper { grid-column: 1 / -1; }
}
#tour-numbers { min-width: 0; max-width: 100%; }
body.tour-open .wrap { padding-bottom: 70vh; }
.default-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  background: #fff6e0;
  color: var(--ink);
  border: 1px solid #e6d48a;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}
.default-notice p { flex: 1 1 180px; margin: 0; font-weight: 700; }
.default-notice button {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}
.tour-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.tour-replay { margin: 8px 0 0; }
.tour-replay button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-dk);
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.tour { position: fixed; inset: 0; z-index: 80; }
.tour-dim { position: fixed; background: rgba(13, 27, 46, .72); z-index: 80; }
.tour-ring {
  position: fixed;
  z-index: 81;
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(245, 197, 24, .28);
  pointer-events: auto;
}
.tour-tip {
  position: fixed;
  z-index: 82;
  background: #fff;
  color: var(--ink);
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 16px);
  overflow: auto;
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 12px 40px rgba(13, 27, 46, .28);
}
.tour-row { display: flex; gap: 10px; align-items: flex-start; }
.tour-ic {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tour-ic .ic { width: 20px; height: 20px; color: #fff; }
.tour-row p { margin: 2px 0 0; font-size: 15px; line-height: 1.4; overflow-wrap: break-word; }
.tour-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.tour-count { font-size: 13px; font-weight: 700; color: var(--muted); }
.tour-skip {
  background: none;
  border: 0;
  padding: 8px 4px;
  min-height: 44px;
  color: var(--accent-dk);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.tour-nav-btns { margin-left: auto; display: flex; gap: 8px; }
.tour-tip .btn { width: auto; min-height: 44px; padding: 0 16px; font-size: 16px; background: var(--accent-dk); }
.tour-tip .btn.ghost { background: #fff; color: var(--navy); }
@media (max-width: 640px) {
  .tour-tip {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 42vh;
    padding: 14px 14px calc(12px + env(safe-area-inset-bottom));
  }
  .tour-nav { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .tour-skip { justify-self: end; }
  .tour-nav-btns { grid-column: 1 / -1; margin-left: 0; }
  .tour-nav-btns .btn { flex: 1; }
}
.page-stack { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.page-stack > * { min-width: 0; max-width: 100%; }
.page-stack > #tour-numbers { order: 1; }
.page-stack > .mat-jump-row { order: 2; }
.page-stack > main.wrap { order: 3; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.dash-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.dash-hello {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
.rep-avatar {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--navy-2);
  color: #fff;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(13, 27, 46, .18);
}
.rep-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.rep-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.rep-avatar.has-photo .rep-avatar-fallback { visibility: hidden; }
h1.dash-name {
  flex: 0 1 11rem;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.1;
}
.dash-row .filters {
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.preset-chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
.dash-row .chip { white-space: nowrap; }
.preset-select-label { display: none; margin: 0; min-width: 0; position: relative; }
.preset-select {
  width: 6.6rem;
  min-width: 0;
  min-height: 32px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.preset-cal { display: none; }
.dash-row .range-row {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  align-items: center;
  gap: 4px;
}
.dash-row .range-field {
  flex: 1 1 0;
  flex-direction: row;
  align-items: center;
  min-width: 0;
  margin: 0;
  gap: 4px;
}
.dash-row .range-lab { font-size: 11px; white-space: nowrap; }
.date-shell { display: block; min-width: 0; flex: 1 1 auto; width: 100%; }
.date-shell input { width: 100%; }
.date-face { display: none; width: 100%; }
.dash-row .range-apply .apply-icon,
.dash-row .signout .signout-icon { display: none; }
.tool-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.tool-btn .ic { width: 16px; height: 16px; }
.tool-btn.preset-cal { display: none; }
.fold {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-height: 32px;
}
.fold h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 22px;
}
.chev {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--navy);
}
.chev svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fold[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.fold-body { margin-top: 8px; }
.fold:focus-visible, .tool-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.store-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 8px;
  margin-top: 6px;
  cursor: default;
}
.store-line .store-name {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}
.store-line .store-contact {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.store-line .actions {
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  margin-top: 0;
  gap: 4px;
}
.store-line .act,
.task-line .act {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  cursor: pointer;
  box-sizing: border-box;
}
.store-line .act .ic,
.task-line .act .ic {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}
.act-label {
  display: none;
}
.order-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 6px 8px;
  margin-top: 6px;
  font-size: 13px;
}
.order-line .ol-id,
.order-line .ol-fig,
.order-line .ol-comm { flex: 0 0 auto; min-width: 0; white-space: nowrap; }
.order-line .ol-id { color: inherit; text-decoration: none; }
.order-line .ol-who {
  flex: 1 1 auto;
  min-width: 2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-line .ol-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}
.order-line .ol-track {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--navy);
}
.order-line .ol-track .ic { width: 14px; height: 14px; }
.order-line { container-type: inline-size; }
@container (max-width: 560px) {
  .order-line .ol-badges .badge:nth-child(n+2),
  .order-line .ol-track { display: none; }
}
@container (max-width: 420px) {
  .order-line .ol-units,
  .order-line .ol-state { display: none; }
}
@media (max-width: 999px) {
  /* From and To already show the days, so the long range text does not squeeze them. */
  .dash-row .range-label { display: none; }
  .hello-pre, .dash-row .range-lab, .apply-text, .signout-text { 
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .dash-row .range-apply .apply-icon,
  .dash-row .signout .signout-icon { display: inline-flex; }
  .dash-row .range-apply,
  .dash-row .signout {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
  }
  h1.dash-name { flex-basis: 4.5rem; min-width: 2.6rem; font-size: 14px; }
  .dash-hello { gap: 6px; }
  .rep-avatar { flex-basis: 28px; width: 28px; height: 28px; font-size: 11px; }
  .dash-row .range-field input {
    min-height: 32px;
    padding: 0 2px;
    font-size: 11px;
  }
  .preset-chips { display: none; }
  .preset-select-label { display: block; flex: 0 1 6.6rem; }
  .date-shell { position: relative; min-height: 32px; }
  .date-shell input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    min-height: 0;
    padding: 0;
  }
  .date-face {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    border: 1px solid #cfd6e0;
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
  }
}
@media (max-width: 720px) {
  .store-line { flex-wrap: wrap; row-gap: 4px; }
}
@media (max-width: 480px) {
  .dash-row { gap: 4px; padding: 6px; }
  .preset-select-label { display: none; }
  .preset-cal {
    display: inline-flex;
    width: 32px;
    min-width: 32px;
    padding: 0;
  }
  .dash-row .filters { position: relative; }
  .preset-chips {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    flex-direction: column;
    align-items: stretch;
    min-width: 148px;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(13, 27, 46, .18);
  }
  .filters.presets-open .preset-chips { display: flex; }
  .preset-chips .chip { width: 100%; text-align: left; }
  .order-line { font-size: 12px; gap: 4px; padding: 4px 6px; }
  .order-line .badge { padding: 2px 5px; font-size: 10px; }
  .tool-btn.preset-cal { display: inline-flex; }
}
@media (max-width: 359px) {
  .store-line .actions { flex: 1 0 100%; }
}

.fold-stat {
  flex: 0 1 auto;
  margin-left: 8px;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
}
.fold-stat b { color: var(--bad); }
.next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  max-width: 100%;
}
.next-act {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  text-decoration: none;
}
.next-act.hot { border-color: var(--bad); color: var(--bad); }
.task-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
}
.task-line:last-child { border-bottom: 0; }
.due-chip, .age-chip, .prospect-mark {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--navy);
  white-space: nowrap;
}
.due-chip.overdue, .age-chip.stale { background: #fdecea; color: var(--bad); }
.due-chip.today { background: #fff6d8; color: #8a5a00; }
.task-who {
  flex: 0 1 auto;
  max-width: 40%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
.task-title {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 13px;
}
.task-line .actions {
  flex: 0 0 auto;
  gap: 4px;
  margin: 0;
  flex-wrap: nowrap;
  flex-shrink: 0;
}
.ol-date {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.sample-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  padding: 3px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.sample-line:last-child { border-bottom: 0; }
.sample-line b {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sample-line .badge { flex: 0 0 auto; }
.sample-line .sample-meta {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}
.cust-map { margin-top: 6px; }
.cust-map:not([open]) > :not(summary) { display: none; }
.cust-map summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}
.cust-map .map { height: 140px; margin-top: 6px; }
.empty-line,
body[data-page="dashboard"] .hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
}
.info-h { font-size: 16px; margin: 8px 0 2px; }
.info-h:first-child { margin-top: 0; }
body[data-page="dashboard"] .wrap {
  width: 100%;
  max-width: var(--dash-max, 1240px);
  padding-top: 8px;
  padding-bottom: 24px;
}
body[data-page="dashboard"] .card { padding: 8px 10px; margin-top: 8px; }
body[data-page="dashboard"] .fold h2 { font-size: 18px; }
body[data-page="dashboard"] .fold-body { margin-top: 4px; }
body[data-page="dashboard"] .fold-body > .actions,
body[data-page="dashboard"] .tour-actions { margin-top: 6px; }
body[data-page="dashboard"] .target,
body[data-page="dashboard"] .order { padding: 4px 8px; margin-top: 4px; }
@media (max-width: 720px) {
  .cust-map .map { height: 120px; }
  .task-line { gap: 4px; }
  .due-chip, .age-chip, .prospect-mark { font-size: 10px; padding: 1px 5px; }
}
@media (max-width: 389px) {
  .kpi b { font-size: 20px; }
  .kpi { padding: 6px 6px 4px; }
}

/* Dashboard column on a wide monitor. The navy header and the filter bar
   stay full width. Their contents, the KPI row, banners, and sections share
   one centered 1240px column. Long copy stays near 80-100 characters. */
body[data-page="dashboard"] {
  --dash-max: 1240px;
  color-scheme: light;
}
/* A short page has no scrollbar and a long one does, which made the bar 15px
   wider on Customers than on Home. Reserve the gutter on every page. */
html { scrollbar-gutter: stable; }
/* Desktop reads about 5% smaller (Oz, Oct 23 2026). One zoom on the root keeps
   the top bar and the content in step on every page; phones are untouched. */
@media (min-width: 1000px) { html { zoom: .95; } }
/* One top bar on every rep page: the dashboard's centered 1240px column. */
.rep-top {
  --dash-max: 1240px;
  padding-left: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
  padding-right: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
}
body[data-page="dashboard"] .top {
  padding-left: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
  padding-right: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
}
body[data-page="dashboard"] .dash-row {
  padding-left: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
  padding-right: max(var(--pad), calc((100% - var(--dash-max)) / 2 + var(--pad)));
}
body[data-page="dashboard"] .kpi-wrap { padding-bottom: 0; }
body[data-page="dashboard"] .mat-jump-row {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--dash-max);
  margin: 2px auto 0;
  padding: 0 var(--pad);
}
body[data-page="dashboard"] #info .hint { max-width: 65ch; }
body[data-page="dashboard"] .fold-body > .hint,
body[data-page="dashboard"] main.wrap > .hint { max-width: 65ch; }
@media (min-width: 1000px) {
  .dash-row .range-row {
    flex: 0 1 auto;
    width: auto;
  }
  .dash-row .range-field {
    flex: 0 0 auto;
    width: auto;
  }
  .dash-row .date-shell {
    flex: 0 1 140px;
    width: 140px;
    max-width: 140px;
    min-width: 112px;
  }
  .dash-row .date-shell input {
    width: 100%;
    max-width: 140px;
    min-width: 0;
    min-height: 32px;
    padding: 2px 4px;
    font-size: 13px;
  }
}

/* Sample rows: where the sample is, when to expect it, when to follow up. */
.sample-line .sample-ship {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--navy);
  font-size: 12px;
  font-weight: 700;
}
.sample-line .sample-track {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.sample-line .sample-track:hover { text-decoration: underline; }
.sample-ship.is-ok { color: var(--ok); }
.sample-ship.is-due { color: var(--warn); }
.sample-ship.is-late { color: var(--bad); }
.target .sample-ship { font-weight: 700; }
@media (max-width: 720px) {
  .sample-line { flex-wrap: wrap; row-gap: 2px; }
  .sample-line .sample-ship { flex: 1 0 100%; order: 3; white-space: normal; }
  .sample-line .sample-meta { flex: 1 1 100%; order: 4; }
}

/* Rep dashboard top section, in the PatchDesign rep dashboard's shape:
   brand lockup at the left, page nav, the rep's name and title with an
   avatar button that opens the account menu at the right. The date presets
   row sits under it with the resolved range at its end, above the KPIs. */
.rep-top {
  flex-wrap: nowrap;
  gap: 10px 16px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  flex: 0 1 auto;
}
.rep-top .brand { font-size: 20px; line-height: 1; }
h1.dash-label {
  margin: 0;
  color: #8eb6f8;
  font-family: "DM Sans", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.15;
  text-transform: none;
  white-space: nowrap;
}
.rep-top .page-nav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.rep-top .page-nav a.nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: transparent;
  color: rgba(255, 255, 255, .78);
  padding: 8px 12px;
}
.rep-top .page-nav a.nav[aria-current] {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
}
.rep-top .page-nav .ic,
.account-menu .ic { width: 16px; height: 16px; flex: 0 0 16px; }
.rep-top .page-nav .ic svg,
.account-menu .ic svg,
.fold-add svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.account {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}
.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 2px 2px 2px 12px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}
.account-trigger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.account-hello {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.account-trigger .rep-avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  box-shadow: none;
}
.account-id {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 0;
  max-width: 10rem;
  line-height: 1.15;
}
.account-id strong,
.account-id span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-id strong { font-size: 13px; }
.account-id span { color: #8eb6f8; font-size: 11px; font-weight: 700; }
.avatar-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: var(--navy-2);
  color: #fff;
  cursor: pointer;
}
.avatar-btn .rep-avatar { flex: 0 0 36px; box-shadow: none; }
.avatar-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.account-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(260px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  box-shadow: 0 12px 32px rgba(13, 27, 46, .18);
  text-align: left;
}
.account-menu[hidden] { display: none; }
.account-who {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.account-who strong { font-size: 14px; }
.account-who span { color: var(--muted); font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
.account-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu .menu-item:hover,
.account-menu .menu-item:focus-visible { background: #eef3fb; outline: none; }
.dash-row .filters { flex-wrap: nowrap; }
.range-label {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.range-label:empty { display: none; }

/* A round "+" beside each home section: its own control, outside the
   toggle, so it is never a button inside a button. */
.fold-row { display: flex; align-items: center; gap: 8px; }
.fold-row .fold { flex: 1 1 auto; min-width: 0; width: auto; }
.fold-add {
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f3f7fd;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.fold-add svg { width: 16px; height: 16px; stroke-width: 2.4; }
.fold-add:hover { background: #e3edfb; }
.fold-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* The arrow beside a section title opens that section's own page. It sits
   right after the fold button (title, count, chevron), never inside it, in
   the same 44px touch box as the "+" so it is easy to hit on a phone. The
   fold chevron stays navy and points down; this arrow is accent and points
   right. The "+" keeps the right edge. */
.fold-row .fold { flex: 0 1 auto; }
.fold-open {
  flex: 0 0 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: -6px;
  padding: 0;
  border-radius: 999px;
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.fold-open svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.fold-open:hover { background: #e3edfb; }
.fold-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fold-row .fold-add { margin-left: auto; }
/* 44px hit area for the "+" as well, without changing its 30px look. */
.fold-row .fold-add { position: relative; }
.fold-row .fold-add::after { content: ""; position: absolute; inset: -7px; border-radius: 999px; }

/* Range presets: the clicked chip turns on at once (no transition), and the
   board dims until the new range arrives. */
.chip { transition: none; }
body.dash-loading #kpis,
body.dash-loading .page-stack .card { opacity: .55; }
@keyframes dashPulse { 50% { opacity: .35; } }
body.dash-loading #kpis,
body.dash-loading .page-stack .card { animation: dashPulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  body.dash-loading #kpis,
  body.dash-loading .page-stack .card { animation: none; }
}
body.dash-loading .range-label { opacity: .5; }

@media (max-width: 999px) {
  .rep-top .page-nav a.nav { padding: 8px 10px; }
  .rep-top .page-nav .nav-text { font-size: 12px; }
  .account-id { max-width: 7rem; }
  .avatar-btn { width: 36px; height: 36px; }
  .avatar-btn .rep-avatar { flex-basis: 32px; width: 32px; height: 32px; }
}
@media (max-width: 720px) {
  /* On a phone the page nav is a bar along the bottom, as on PatchDesign. */
  .rep-top { gap: 8px; }
  .rep-top .page-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    grid-auto-flow: column;
    height: 60px;
    gap: 0;
    padding: 0 4px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(13, 27, 46, .06);
  }
  .rep-top .page-nav a.nav {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
  }
  .rep-top .page-nav a.nav[aria-current] { color: var(--accent); background: transparent; }
  .rep-top .page-nav .ic { width: 20px; height: 20px; flex-basis: 20px; }
  body.has-rep-nav { padding-bottom: 64px; }
  body[data-page="dashboard"] .tour-tip { bottom: 64px; }
  .account-id { max-width: 6rem; }
  .account-id strong { font-size: 12px; }
}
@media (max-width: 480px) {
  .range-label { font-size: 11px; margin: 0 2px; }
  .filters.presets-open .range-label { display: none; }
}
.dash-row .filters .range-row { display: flex; }

/* A folded home section: three rows, then a "See more (n)" pill. */
.is-folded { display: none !important; }
.see-more {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 8px 0 2px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.see-more:hover { background: #f3f7fd; border-color: var(--accent); color: var(--accent); }
.see-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Help chat. The button sits above the phone bottom bar. */
.help-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
}
.help-btn, .help-close {
  display: grid;
  place-items: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  background: var(--navy);
}
.help-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(13, 27, 46, .28);
}
.help-btn svg, .help-close svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.help-btn:focus-visible, .help-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 140px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--navy);
  box-shadow: 0 12px 32px rgba(13, 27, 46, .18);
}
.help-panel[hidden] { display: none; }
.help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--navy);
  color: #fff;
}
.help-head h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
}
.help-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: transparent;
}
.help-close svg { width: 18px; height: 18px; }
.help-log {
  flex: 1 1 auto;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
.help-note { margin: 0; color: var(--muted); font-size: 13px; }
.help-msg {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
}
.help-msg p { margin: 0 0 6px; }
.help-msg p:last-child { margin-bottom: 0; }
.help-msg.user { align-self: flex-end; background: var(--navy); color: #fff; }
.help-msg.model { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.help-sources { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12px; }
.help-starters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 8px;
}
.help-starters button {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
}
.help-starters button:hover { border-color: var(--accent); color: var(--accent); }
.help-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.help-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}
.help-form button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
@media (max-width: 720px) {
  /* Stretch the anchor so the panel is inset from both sides. 100vw is wider
     than the page when a scrollbar is reserved, and that pushed the panel off. */
  .help-chat {
    left: 10px;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
  }
  .help-panel {
    left: 0;
    right: 0;
    width: auto;
    height: min(480px, calc(100vh - 170px));
  }
}
@media (max-width: 359px) {
  .help-chat { left: 8px; right: 8px; }
  .help-btn { width: 48px; height: 48px; }
}

/* Sample progress: green once a step is done, outlined for the next one. */
.sample-steps {
  flex: 1 0 100%;
  order: 4;
  display: flex;
  margin: 4px 0 2px;
  padding: 0;
  list-style: none;
}
.sample-step {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}
.sample-step::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--line);
}
.sample-step:first-child::before { display: none; }
.sample-step.is-done::before { background: var(--ok); }
.sample-step .dot {
  position: relative;
  z-index: 1;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
}
.sample-step .dot svg { width: 11px; height: 11px; fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.sample-step.is-done .dot { background: var(--ok); border-color: var(--ok); }
.sample-step.is-current .dot { border-color: var(--accent-dk); }
.sample-step.is-bad .dot { border-color: var(--bad); }
.sample-step.is-due .dot { border-color: var(--warn); }
.sample-step .step-name { font-weight: 700; color: var(--navy); }
.sample-step.is-done .step-name,
.sample-step.is-done .step-when { color: var(--ok); }
.sample-step .step-when { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-step.is-bad .step-when { color: var(--bad); }
.sample-step.is-due .step-when { color: var(--warn); }
.target .sample-steps { margin: 6px 0 4px; }

.commission-note {
  margin: 16px 0 24px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.sample-step .step-notes {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.sample-step .step-notes:hover { text-decoration: underline; }
