/* Reporting page (rep-). Blue is marketing; orange is Rufen's own systems. */

/* ---- Hero canvas: dollars flowing to one point ---- */
.rep-hero-canvas {
  position: absolute; top: 0; right: 0; width: 48%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
.rep-hero-pause {
  position: absolute; right: 24px; bottom: 20px; z-index: 3;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--mkt-text-2); background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge);
  box-shadow: 0 0 0 1px var(--mkt-hairline);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.rep-hero-pause svg { width: 14px; height: 14px; }
.rep-hero-pause:focus-visible, .rep-board-pause:focus-visible, .rep-ch:focus-visible { outline: 2px solid var(--med-sea); outline-offset: 3px; }

/* ---- Proof pointer ---- */
.rep-proof { padding-top: 24px; padding-bottom: 8px; }
.rep-proof-line { display: flex; justify-content: center; align-items: baseline; gap: 14px; margin: 0; flex-wrap: wrap; }

/* ---- Problem: the trail that stops ---- */
.rep-broken { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 22px 0 26px; }
.rep-chip {
  padding: 7px 14px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: 0.86rem;
  color: var(--mkt-text); background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge); box-shadow: 0 0 0 1px var(--mkt-hairline);
}
.rep-chip--off { color: var(--mkt-text-2); border-style: dashed; background: transparent; box-shadow: 0 0 0 1px var(--mkt-hairline); min-width: 40px; text-align: center; }
.rep-dash { width: 26px; height: 2px; border-radius: 2px; background: var(--med-sea); }
.rep-dash--off { background: repeating-linear-gradient(90deg, var(--mkt-accent-line) 0 4px, transparent 4px 8px); }

/* ---- Dashboard ---- */
.rep-board { max-width: 920px; margin: 34px auto 0; padding: 22px 26px 18px; }
.rep-board-top { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.rep-board-sub { color: var(--mkt-text-2); font-size: 0.85rem; }
.rep-board-pause {
  margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  color: var(--mkt-text-2); background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge); box-shadow: 0 0 0 1px var(--mkt-hairline);
}
.rep-board-pause svg { width: 14px; height: 14px; }
.rep-board-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; align-items: start; }

.rep-channels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rep-ch {
  position: relative; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--mkt-text);
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 16px; border-radius: 14px; overflow: hidden;
  background: var(--mkt-glass); border: 1px solid var(--mkt-edge); box-shadow: 0 0 0 1px var(--mkt-hairline);
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.rep-ch strong { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.rep-ch em { font-style: normal; font-family: var(--font-mono); font-size: 0.85rem; color: var(--mkt-text-2); }
.rep-ch-bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--mkt-accent-soft); overflow: hidden; }
.rep-ch-bar span { display: block; height: 100%; width: var(--w, 50%); border-radius: inherit; background: linear-gradient(90deg, var(--med), var(--med-sea)); opacity: .55; transition: opacity .25s ease; }
.rep-ch.is-on {
  transform: translateX(6px); background: var(--mkt-glass-strong);
  box-shadow: 0 0 0 1px var(--mkt-accent-line), 0 12px 28px -14px rgba(15, 95, 166, 0.55);
}
.rep-ch.is-on .rep-ch-bar span { opacity: 1; }
.rep-ch::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--med-sea); transform: scaleY(0); transition: transform .3s ease; }
.rep-ch.is-on::before { transform: scaleY(1); }

.rep-trace { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.rep-step { position: relative; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 14px; padding: 7px 0; opacity: .38; transition: opacity .4s ease; }
.rep-step.is-lit { opacity: 1; }
.rep-step:not(:last-child)::after {
  content: ""; position: absolute; left: 18px; top: calc(50% + 19px); height: calc(100% - 38px + 14px); width: 2px; z-index: 0;
  background: var(--mkt-accent-line);
}
.rep-step.is-lit:not(:last-child)::after { background: linear-gradient(180deg, var(--med-sea), var(--med-sea)); }
.rep-step--sys.is-lit:not(:last-child)::after { background: var(--accent-orange, #ff6b00); }
.rep-step[data-k="calls"]::after { height: calc(100% - 24px + 26px); }
.rep-dot {
  position: relative; z-index: 1; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  color: var(--med); background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge); box-shadow: 0 0 0 1px var(--mkt-accent-line);
  transition: box-shadow .4s ease, background .4s ease, color .4s ease;
}
.rep-dot svg { width: 18px; height: 18px; }
.rep-step.is-lit .rep-dot { background: var(--med); color: #fff; box-shadow: 0 0 0 4px var(--mkt-accent-soft); }
.rep-step--sys .rep-dot { color: var(--accent-orange, #ff6b00); box-shadow: 0 0 0 1px rgba(255, 107, 0, .35); }
.rep-step--sys.is-lit .rep-dot { background: var(--accent-orange, #ff6b00); color: #fff; box-shadow: 0 0 0 4px rgba(255, 107, 0, .14); }
.rep-lab { color: var(--mkt-text-2); font-size: 0.92rem; }
.rep-val { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--mkt-text); font-variant-numeric: tabular-nums; }
.rep-from {
  display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 52px; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-orange, #ff6b00);
}
.rep-from::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-orange, #ff6b00); }
.rep-back { margin: 14px 0 0; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--mkt-accent); min-height: 1.6em; }
.rep-note { margin: 6px 0 0; text-align: center; font-size: 0.78rem; color: var(--mkt-text-2); }

.rep-scope { list-style: none; margin: 34px auto 0; padding: 0; max-width: 920px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.rep-scope li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.92rem; color: var(--mkt-text-2); line-height: 1.45; }
.rep-scope svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; color: var(--med); }

.rep-join-link { margin: 18px 0 0; }
.mkt-why-pills a { color: inherit; text-decoration: none; }
.mkt-why-pills a:hover { text-decoration: underline; }


@media (max-width: 992px) {
  .rep-hero-canvas, .rep-hero-pause { display: none; }
  .rep-scope { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .rep-board { padding: 18px 16px 14px; }
  .rep-board-body { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .rep-ch.is-on { transform: none; }
}
@media (max-width: 480px) {
  .rep-scope { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .rep-ch, .rep-step, .rep-dot, .rep-ch::before { transition: none; }
}

/* ---- Spend -> Clicks -> ? -> ?: builds once in view, the unknowns go red and shake ---- */
.rep-q { color: #e5484d; border-color: rgba(229, 72, 77, 0.55); background: rgba(229, 72, 77, 0.07); box-shadow: 0 0 0 1px rgba(229, 72, 77, 0.35); font-weight: 800; }
@media (prefers-reduced-motion: no-preference) {
  .rep-broken .rep-chip, .rep-broken .rep-dash { opacity: 0; }
  .rep-broken .rep-chip { transform: translateY(8px) scale(0.92); }
  .rep-broken .rep-dash { transform: scaleX(0); transform-origin: left center; }
  .rep-broken.is-on .rep-chip { animation: repChipIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) var(--d) forwards; }
  .rep-broken.is-on .rep-dash { animation: repDashIn 0.35s ease-out var(--d) forwards; }
  .rep-broken.is-on .rep-q {
    animation: repChipIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) var(--d) forwards,
               repShake 2.4s ease-in-out calc(2.7s + var(--sd, 0s)) infinite;
  }
}
@keyframes repChipIn { to { opacity: 1; transform: none; } }
@keyframes repDashIn { to { opacity: 1; transform: scaleX(1); } }
@keyframes repShake {
  0%, 30%, 100% { transform: none; }
  4% { transform: translateX(-4px) rotate(-6deg); }
  8% { transform: translateX(4px) rotate(6deg); }
  12% { transform: translateX(-3px) rotate(-4deg); }
  16% { transform: translateX(3px) rotate(4deg); }
  20% { transform: translateX(-1px) rotate(-1deg); }
}

/* ---- The trail: click to paid invoice, with who carries each step ---- */
.rep-join { max-width: 920px; margin: 0 auto; text-align: center; }
.rep-join .rep-join-lead { max-width: 640px; margin: 14px auto 0; color: var(--mkt-text-2); }
.rep-trail { margin: 36px auto 0; padding: 28px 24px 22px; border-radius: 20px; background: var(--mkt-glass-strong); border: 1px solid var(--mkt-edge); box-shadow: var(--mkt-shadow); }
.rep-trail-steps, .rep-trail-who { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; list-style: none; margin: 0; padding: 0; }
.rep-ts { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0 6px; }
.rep-ts + .rep-ts::before {          /* the line from the previous step */
  content: ""; position: absolute; top: 21px; right: calc(50% + 24px); width: calc(100% - 48px); height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,107,0,0.35), #ff6b00);
}
.rep-ts:nth-child(2)::before { background: linear-gradient(90deg, var(--med-sea), #ff6b00); }   /* blue hands over to orange */
.rep-ts-dot { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #ff6b00; background: rgba(255,107,0,0.1); box-shadow: 0 0 0 1px rgba(255,107,0,0.35); margin-bottom: 4px; }
.rep-ts-dot svg { width: 20px; height: 20px; }
.rep-ts--mkt .rep-ts-dot { color: var(--med); background: var(--mkt-accent-soft); box-shadow: 0 0 0 1px var(--mkt-accent-line); }
.rep-ts--end .rep-ts-dot { color: #fff; background: #ff6b00; box-shadow: 0 0 0 4px rgba(255,107,0,0.18), 0 8px 20px -8px rgba(255,107,0,0.7); }
.rep-ts b { font-family: var(--font-display); font-size: 0.98rem; color: var(--mkt-text); }
.rep-ts small { font-size: 0.76rem; color: var(--mkt-text-2); line-height: 1.3; }

.rep-trail-who { margin-top: 18px; align-items: start; }
.rep-who {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; margin: 0 8px; padding: 12px 10px 0;
  font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
}
.rep-who::before {                    /* a bracket over the steps this system carries */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; border: 2px solid currentColor; border-bottom: 0; border-radius: 6px 6px 0 0; opacity: 0.55;
}
.rep-who--mkt { grid-column: 1; color: var(--med); }
.rep-who--sys { color: #ff6b00; cursor: pointer; }
.rep-who--voice { grid-column: 2; }
.rep-who--wide { grid-column: 3 / 6; }
.rep-who svg { width: 14px; height: 14px; }
.rep-who--sys::after { content: "+"; margin-left: 2px; font-weight: 700; }
.rep-who--sys:hover { color: #e05e00; }
.rep-who--sys:hover::before { opacity: 0.9; }
.rep-who--sys:focus-visible { outline: 2px solid #ff6b00; outline-offset: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: no-preference) {
  .rep-ts, .rep-ts + .rep-ts::before, .rep-who { opacity: 0; }
  .rep-ts { transform: translateY(10px); }
  .rep-trail.is-on .rep-ts { animation: repChipIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) var(--d) forwards; }
  .rep-trail.is-on .rep-ts + .rep-ts::before { animation: repLine 0.4s ease-out calc(var(--d) - 0.15s) forwards; transform-origin: left center; transform: scaleX(0); }
  .rep-trail.is-on .rep-who { animation: repChipIn 0.5s ease-out 1.8s forwards; }
  .rep-trail.is-on .rep-ts--end .rep-ts-dot { animation: repGlow 2.6s ease-in-out 2.2s infinite; }
}
@keyframes repLine { to { opacity: 1; transform: scaleX(1); } }
@keyframes repGlow { 0%, 100% { box-shadow: 0 0 0 4px rgba(255,107,0,0.18), 0 8px 20px -8px rgba(255,107,0,0.7); } 50% { box-shadow: 0 0 0 9px rgba(255,107,0,0.1), 0 8px 26px -6px rgba(255,107,0,0.85); } }

@media (max-width: 640px) {
  .rep-trail { padding: 22px 12px 18px; }
  .rep-ts small { display: none; }
  .rep-ts b { font-size: 0.8rem; }
  .rep-ts-dot { width: 38px; height: 38px; }
  .rep-ts + .rep-ts::before { top: 18px; right: calc(50% + 21px); width: calc(100% - 42px); }
  .rep-trail-who { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
  .rep-who { margin: 0; }
}

/* Client results line: the label leads, the link follows quietly. */
.rep-proof-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--mkt-text); letter-spacing: -0.01em; }
.rep-proof-link { font-size: 0.92rem; font-weight: 500; color: var(--mkt-accent); text-decoration: none; }
.rep-proof-link:hover { text-decoration: underline; }

/* Who carries each step: a bracket over the steps, a pill under it. */
.rep-who { margin: 0 4px; padding: 14px 0 0; letter-spacing: 0; text-transform: none; font-family: inherit; }
.rep-who::after { content: none; }
.rep-who-pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 6px 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.64rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
}
.rep-who--mkt .rep-who-pill { color: var(--med); background: var(--mkt-accent-soft); box-shadow: 0 0 0 1px var(--mkt-accent-line); }
.rep-who--sys .rep-who-pill { color: #ff6b00; background: rgba(255,107,0,0.08); box-shadow: 0 0 0 1px rgba(255,107,0,0.35); transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.rep-who--sys .rep-who-pill::after { content: "+"; font-weight: 700; margin-left: 2px; }
.rep-who--sys:hover .rep-who-pill { background: rgba(255,107,0,0.16); box-shadow: 0 0 0 1px rgba(255,107,0,0.6), 0 8px 18px -10px rgba(255,107,0,0.7); transform: translateY(-1px); }
.rep-who--sys:hover { color: #ff6b00; }
.rep-who-pill svg { width: 13px; height: 13px; }
@media (max-width: 900px) { .rep-who-pill { padding: 5px 9px; font-size: 0.6rem; } }

/* Mars: the trail sits in the page, not in a card; the line under the heading
   is a quiet background note; the heading stays on one line on desktop. */
.rep-trail { background: none; border: 0; box-shadow: none; border-radius: 0; padding: 8px 0 0; }
.rep-join { max-width: 1160px; }
.rep-join .rep-join-lead { font-size: 0.92rem; line-height: 1.6; color: var(--mkt-text-2); opacity: 0.75; max-width: 600px; }
@media (min-width: 1100px) { .rep-join .section-title { white-space: nowrap; } }
/* This peel holds the one-line heading and the trail, so it runs wider than a text peel. */
#joined-up .bd-peel { max-width: 1160px; }
#joined-up .rep-join { max-width: none; }
/* Grey connectors between the steps; the dots carry the colour. */
.rep-ts + .rep-ts::before, .rep-ts:nth-child(2)::before { background: rgba(100, 116, 139, 0.32); }
#joined-up .bd-peel { max-width: 980px; }


/* ===== Dark mode (html[data-theme="dark"]) ===== */
:root[data-theme="dark"] .rep-hero-pause,:root[data-theme="dark"] .rep-board-pause{ box-shadow:none; -webkit-backdrop-filter:none; backdrop-filter:none; }
:root[data-theme="dark"] .rep-q{ color:var(--red-text); background:rgba(234,136,133,.10); border-color:rgba(234,136,133,.50); box-shadow:0 0 0 1px rgba(234,136,133,.30); }
/* dashboard: the card is s2 (it sits in a band); channels and the trace are panels one level up */
:root[data-theme="dark"] .rep-ch{ background:var(--dk-s3); border-color:var(--dk-line-3); box-shadow:none; }
:root[data-theme="dark"] .rep-ch.is-on{ background:var(--dk-s4); box-shadow:0 0 0 1px rgba(113,193,224,.45); }
:root[data-theme="dark"] .rep-ch-bar{ background:var(--dk-s2); }
:root[data-theme="dark"] .rep-step{ opacity:.78; }
:root[data-theme="dark"] .rep-step.is-lit{ opacity:1; }
:root[data-theme="dark"] .rep-step--sys{ opacity:.92; }
:root[data-theme="dark"] .rep-step--sys.is-lit{ opacity:1; }
:root[data-theme="dark"] .rep-step:not(:last-child)::after{ background:var(--dk-line-3); }
:root[data-theme="dark"] .rep-step.is-lit:not(:last-child)::after{ background:var(--blue-text); }
:root[data-theme="dark"] .rep-step--sys.is-lit:not(:last-child)::after{ background:#f39d5e; }
:root[data-theme="dark"] .rep-dot{ background:var(--dk-s3); border-color:var(--dk-line-3); box-shadow:none; color:var(--blue-text); }
:root[data-theme="dark"] .rep-step.is-lit .rep-dot{ background:var(--btn-mkt); border-color:var(--btn-mkt); color:#fff; box-shadow:0 0 0 4px rgba(113,193,224,.14); }
:root[data-theme="dark"] .rep-step--sys .rep-dot{ color:var(--orange-text); box-shadow:0 0 0 1px var(--dk-edge); }
:root[data-theme="dark"] .rep-step--sys.is-lit .rep-dot{ background:var(--btn-orange); border-color:var(--btn-orange); color:var(--btn-orange-ink); box-shadow:none; outline:1px solid #fa7c20; outline-offset:3px; }
:root[data-theme="dark"] .rep-from{ color:var(--orange-text); }
:root[data-theme="dark"] .rep-from::before{ background:#f39d5e; }
:root[data-theme="dark"] .rep-scope svg{ color:var(--blue-text); }
/* the trail */
:root[data-theme="dark"] .rep-ts + .rep-ts::before,:root[data-theme="dark"] .rep-ts:nth-child(2)::before{ background:rgba(150,190,220,.28); }
:root[data-theme="dark"] .rep-ts-dot{ color:var(--orange-text); background:var(--dk-s2); box-shadow:0 0 0 1px var(--dk-edge); }
:root[data-theme="dark"] .rep-ts--mkt .rep-ts-dot{ color:var(--blue-text); background:var(--mkt-accent-soft); box-shadow:0 0 0 1px var(--mkt-accent-line); }
:root[data-theme="dark"] .rep-ts--end .rep-ts-dot{ background:var(--btn-orange); color:var(--btn-orange-ink); box-shadow:none; outline:1px solid #fa7c20; outline-offset:3px; }
@media (prefers-reduced-motion:no-preference){
  @keyframes repGlowDark{ 0%,100%{ outline-offset:3px; } 50%{ outline-offset:6px; } }
  :root[data-theme="dark"] .rep-trail.is-on .rep-ts--end .rep-ts-dot{ animation-name:repGlowDark; }
}
:root[data-theme="dark"] .rep-who--mkt,:root[data-theme="dark"] .rep-who--mkt .rep-who-pill{ color:var(--blue-text); }
:root[data-theme="dark"] .rep-who--sys,:root[data-theme="dark"] .rep-who--sys:hover{ color:var(--orange-text); }
:root[data-theme="dark"] .rep-who--sys .rep-who-pill{ color:var(--orange-text); background:var(--dk-s2); box-shadow:0 0 0 1px var(--dk-edge); }
:root[data-theme="dark"] .rep-who--sys:hover .rep-who-pill{ background:var(--dk-s3); box-shadow:0 0 0 1px #f39d5e; }
:root[data-theme="dark"] .rep-join .rep-join-lead{ opacity:.92; }

/* Dark mode, orchestrator fix R3: the orange bracket over a system's steps at .55 opacity reads brown on navy */
:root[data-theme="dark"] .rep-who--sys::before{ opacity:.92; }
:root[data-theme="dark"] .rep-who--sys:hover::before{ opacity:1; }
