/* ============================================================
   Preferred Credit Repair — Portal styles
   Tokens taken from docs/DESIGN_SYSTEM.md
   ============================================================ */

/* Match the marketing site's fonts. Without this the portal falls back to
   Helvetica Neue / Arial — visibly thinner than the real Archivo Black. */
@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=Archivo+Black&display=swap');

:root {
  --bg:           #0A0A0A;
  --surface:      #111111;
  --surface-soft: #1A1A1A;
  --line:         #262626;
  --line-soft:    #1F1F1F;

  --ink:      #FFFFFF;
  --ink-soft: #EFEFEF;
  --muted:    #9A9A9A;
  --dim:      #6B6B6B;

  --gold:        #FFB800;
  --gold-bright: #FFCE3D;
  --gold-deep:   #E5A500;

  --green:      #3FD17A;
  --green-soft: rgba(63,209,122,0.12);
  --green-deep: #2BB566;
  --red:        #FF5E47;
  --red-soft:   rgba(255,94,71,0.12);

  /* Spacing — 4px grid, per docs/DESIGN_SYSTEM.md §2.7 */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-7:  28px;
  --space-8:  32px;
  --space-10: 40px;
  --space-14: 56px;
  --space-20: 80px;

  /* Radius — per §2.8 */
  --radius-sm:    6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   16px;
  --radius-pill: 100px;
  /* Legacy alias — keep both names mapped to spec values */
  --radius:      var(--radius-lg);

  /* Shadows — per §2.9 */
  --shadow-card:   0 20px 40px rgba(0,0,0,0.4);
  --shadow-button: 0 0 0 4px rgba(255,184,0,0.15), 0 10px 24px rgba(255,184,0,0.30);
  --shadow-focus:  0 0 0 3px rgba(255,184,0,0.15);

  --font-display: "Archivo Black", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Archivo", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-bright); }

/* ---------- Logo wordmark ---------- */
.brand-mark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.brand-mark .dot { color: var(--gold); }
/* Mobile: collapse the wordmark to "P.C.R" inside the dashboard topbar only.
   The login page (.login-card) keeps the full wordmark, scaled down a touch
   on very narrow screens so PREFERRED.CREDIT.REPAIR still fits on one line. */
@media (max-width: 640px) {
  .topbar .brand-mark .brand-tail { display: none; }
}
.login-card .brand-mark {
  font-size: clamp(13px, 4.6vw, 18px);
  white-space: nowrap;
}

/* ---------- Eyebrow pill (default: green with dot — DESIGN_SYSTEM §4.3) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(63,209,122,0.25);
  border-radius: var(--radius-pill);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.eyebrow.gold {
  background: rgba(255,184,0,0.12);
  color: var(--gold);
  border-color: rgba(255,184,0,0.30);
}
.eyebrow.gold::before { background: var(--gold); }
.eyebrow.blink::before { animation: eyebrow-blink 1.2s ease-in-out infinite; }
@keyframes eyebrow-blink {
  0%, 100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(63,209,122,0.55); }
  50%      { opacity: 0.4; box-shadow: 0 0 0 5px rgba(63,209,122,0); }
}

/* ---------- Primary button ---------- */
.btn-primary {
  display: inline-block;
  width: 100%;
  background: var(--gold);
  color: #000;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: var(--space-4) var(--space-6);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-button);
  transition: transform 0.06s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover {
  box-shadow: 0 0 0 5px rgba(255,184,0,0.20), 0 16px 32px rgba(255,184,0,0.40);
}
.btn-primary:hover    { background: var(--gold-bright); }
.btn-primary:active   { transform: translateY(1px); }
.btn-primary:disabled { background: var(--dim); cursor: not-allowed; box-shadow: none; }
/* Auto-width variant — DESIGN_SYSTEM §4.1 button padding 16px 28px */
.btn-primary.auto {
  width: auto;
  padding: var(--space-4) var(--space-7);
}

/* ---------- Login layout ---------- */
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255,184,0,0.08), transparent 70%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-7);
  box-shadow: var(--shadow-card);
}
.login-card header { text-align: center; margin-bottom: var(--space-6); }
.login-card h1 {
  margin: var(--space-4) 0 var(--space-1);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.login-card .sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.field { margin-bottom: var(--space-4); }
input[type="email"], input[type="password"], input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-focus);
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  font-size: 14px;
  display: none;
}
.alert.error { background: var(--red-soft); color: var(--red); display: block; }
.alert.success { background: var(--green-soft); color: var(--green); display: block; }

.fine-print {
  margin-top: 18px;
  color: var(--dim);
  font-size: 12px;
  text-align: center;
}

/* ---------- Dashboard layout ---------- */
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-shell > main { flex: 1 1 auto; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .right { display: flex; align-items: center; gap: var(--space-4); }
.topbar .user-name { color: var(--muted); font-size: 14px; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--gold); }

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-14);
  width: 100%;
}

/* Stack between the eyebrow and the hero greeting (12px) */
.eyebrow + .greeting { margin-top: var(--space-3); }

.greeting {
  margin: 0 0 var(--space-6);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-transform: uppercase;
}
.greeting .accent { color: var(--gold); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
}
.card .card-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}
.card .card-value {
  font-family: var(--font-display);
  font-size: 36px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: var(--space-1);
  letter-spacing: -0.02em;
}
.card .card-value.accent { color: var(--gold); }
.card .card-meta { color: var(--muted); font-size: 13px; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-soft) 0%, var(--line) 50%, var(--surface-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
  color: transparent;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.paused-banner {
  background: var(--red-soft);
  border: 1px solid var(--red);
  color: var(--red);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
  font-size: 14px;
}
.paused-banner strong { color: var(--ink); }

/* ============================================================
   Phase 1 — Dashboard parity components
   ============================================================ */

.section-block { margin-top: var(--space-10); }
.section-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0 0 var(--space-4) 0;
}
.section-meta { margin: var(--space-2) 0 0 0; font-size: 13px; color: var(--muted); }
.section-link { color: var(--gold); }

/* ---------- Bureau score cards ---------- */
.bureau-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-2);
}
.bureau-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
}
.bureau-name {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: var(--space-3);
}
/* Bureau logo SVG (replaces .bureau-name text) */
.bureau-logo {
  display: block;
  height: 28px;
  width: auto;
  max-width: 160px;
  margin-bottom: var(--space-4);
  object-fit: contain;
}
/* Score + change wrap. The wrap holds the tier color so the score and change badge inherit it. */
.bureau-score-wrap {
  position: relative;
  display: inline-block;
  margin: var(--space-2) 0 var(--space-4);
  color: var(--red);
  transition: color 0.6s ease;
}
.bureau-score-wrap:has(.tier-empty) { color: var(--muted); }
.bureau-score-wrap:has(.tier-amber) { color: var(--gold); }
.bureau-score-wrap:has(.tier-good)  { color: var(--green); }

.bureau-score {
  font-family: var(--font-display);
  font-size: clamp(72px, 9vw, 120px);
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  color: inherit;
  text-shadow: 0 4px 40px rgba(0,0,0,0.5);
  display: inline-block;
}
.bureau-score.skeleton {
  color: transparent;
  min-width: 2.4em;       /* roughly the width of "888" at this font size */
  height: 0.85em;
  vertical-align: top;
  text-shadow: none;
}

/* Change indicator floats at the top-right of the score, inheriting the tier color */
.bureau-change {
  position: absolute;
  top: 6px;
  right: -8px;
  transform: translateX(100%);
  font-family: var(--font-display);
  font-size: clamp(16px, 1.5vw, 22px);
  font-weight: 900;
  letter-spacing: -0.01em;
  white-space: nowrap;
  text-shadow: 0 2px 12px currentColor;
  pointer-events: none;
  color: inherit;
}
.bureau-change:empty { display: none; }
.bureau-change.skeleton {
  display: inline-block;
  min-width: 2.4em;
  height: 1em;
  border-radius: 4px;
  text-shadow: none;
}

.bureau-meta {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.bureau-date .pulled-label { color: var(--muted); }
.bureau-date .pulled-when  { color: var(--gold); margin-left: 6px; }
.bureau-date.skeleton {
  display: inline-block;
  width: 160px;
  height: 12px;
  border-radius: 4px;
}

/* ---------- Onboarding bar ---------- */
.onboarding-bar {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.onboarding-bar li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--muted);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.onboarding-bar li::before {
  content: "";
  width: 18px; height: 18px; flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--line);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
}
.onboarding-bar li.complete {
  color: var(--ink);
  border-color: rgba(63,209,122,0.4);
  background: linear-gradient(180deg, rgba(63,209,122,0.06), var(--surface));
}
.onboarding-bar li.complete::before {
  content: "\2713";
  color: #000;
  background: var(--green);
  border-color: var(--green);
}

/* ---------- Round stepper ---------- */
/* Up to 4 cells, never more — older rounds are truncated. */
.round-stepper {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--visible-rounds, 4), 148px);
  justify-content: center;
  gap: 0;
  position: relative;
}
.round-stepper li {
  text-align: center;
  position: relative;
  padding: 16px 0;
}
.round-stepper li::after {
  content: "";
  position: absolute;
  top: 61px;
  left: calc(50% + 46.5px);   /* circle radius (47.5) minus 1px so the line overlaps the border */
  right: calc(-50% + 46.5px);
  height: 5px;
  background: var(--line);
  z-index: 0;
}
.round-stepper li:last-child::after { display: none; }
.round-num {
  width: 95px; height: 95px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 5px solid var(--line);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.round-check {
  width: 38px;
  height: 38px;
  fill: var(--gold);
  display: block;
}
.round-stepper li.sent .round-num {
  background: var(--surface-soft);
  border-color: var(--gold);
  color: var(--gold);
}
.round-stepper li.sent::after { background: var(--gold); }
.round-stepper li.in-flight .round-num {
  border-color: var(--gold);
  color: var(--gold);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0   rgba(255,184,0,0.65); }
  60%  { box-shadow: 0 0 0 28px rgba(255,184,0,0);    }
  100% { box-shadow: 0 0 0 28px rgba(255,184,0,0);    }
}
.round-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.round-stepper li.sent .round-label,
.round-stepper li.in-flight .round-label { color: var(--ink); }
.round-meta {
  margin-top: 4px;
  font-size: 11px;
  color: var(--dim);
  font-family: ui-monospace, monospace;
}

/* ---------- Score progression chart ---------- */
.credit-overview .bureau-grid { margin-bottom: var(--space-4); }
.credit-overview .score-chart-wrap { margin-top: 0; }

/* Reveal shimmer — once the chart finishes auto-scrolling, a soft gold sweep
   passes across each bureau card and the chart wrap. One-shot per render.
   Uses background-image (not a pseudo-element) so cards don't need
   overflow:hidden, which would clip the bureau-change badge that escapes the
   card on desktop. */
/* Body sweep — the soft white streak that passes across the card surface */
#credit-overview-section.is-revealed .bureau-card,
#credit-overview-section.is-revealed .score-chart-wrap {
  background:
    linear-gradient(90deg,
      transparent 30%,
      rgba(255, 255, 255, 0.14) 50%,
      transparent 70%
    ) no-repeat,
    var(--surface);
  background-size: 220% 100%, auto;
  background-position: 220% 0, 0 0;
  animation: pcr-overview-shimmer 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  position: relative;  /* anchor the edge-sweep pseudo */
}

/* Edge sweep — a thin gold-white highlight that travels along the card's
   border in sync with the body sweep, like light catching the edge of glass.
   The mask-composite trick paints the gradient ONLY in the 1px ring around
   the perimeter (the gradient inside the padding-box is masked out). */
#credit-overview-section.is-revealed .bureau-card::after,
#credit-overview-section.is-revealed .score-chart-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(90deg,
      transparent 35%,
      rgba(255, 255, 255, 0.85) 50%,
      transparent 65%
    ) no-repeat;
  background-size: 220% 100%;
  background-position: 220% 0;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
          mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  animation: pcr-overview-edge-sweep 1.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes pcr-overview-shimmer {
  from { background-position:  220% 0, 0 0; }  /* streak off-screen LEFT */
  to   { background-position: -120% 0, 0 0; }  /* streak off-screen RIGHT */
}
@keyframes pcr-overview-edge-sweep {
  from { background-position:  220% 0; }
  to   { background-position: -120% 0; }
}
@media (prefers-reduced-motion: reduce) {
  #credit-overview-section.is-revealed .bureau-card,
  #credit-overview-section.is-revealed .score-chart-wrap {
    animation: none;
    background: var(--surface);
  }
}
.score-chart-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  position: relative;
  overflow: hidden;     /* keep the chart's rounded corners clean */
}
.score-chart-legend {
  position: absolute;
  left: var(--space-5);
  bottom: var(--space-4);
  right: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  z-index: 3;
  pointer-events: none;
}
.score-chart-delta {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.score-chart-legend .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: -1px;
}
.score-chart-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.score-chart-scroll::-webkit-scrollbar { height: 6px; }
.score-chart-scroll::-webkit-scrollbar-track { background: transparent; }
.score-chart-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.score-chart-svg {
  width: 100%;
  height: auto;
  max-height: 340px;
  display: block;
}
/* Zoomed-in width is driven by --chart-zoom-width (set per-render in JS so the
   spacing scales with the number of data points). Mobile is always zoomed. */
.score-chart-wrap.is-zoomed .score-chart-scroll { cursor: grab; scroll-behavior: smooth; }
.score-chart-wrap.is-zoomed .score-chart-scroll.dragging { cursor: grabbing; scroll-behavior: auto; }
.score-chart-wrap.is-zoomed .score-chart-svg {
  width: var(--chart-zoom-width, 1400px);
  min-width: var(--chart-zoom-width, 1400px);
  height: 340px;
  max-height: 340px;
}
@media (max-width: 720px) {
  .score-chart-scroll { cursor: grab; scroll-behavior: smooth; }
  .score-chart-scroll.dragging { cursor: grabbing; scroll-behavior: auto; }
  .score-chart-svg {
    width: var(--chart-zoom-width, 1400px);
    min-width: var(--chart-zoom-width, 1400px);
    height: 340px;
    max-height: 340px;
  }
}
.score-chart-svg .series-area {
  stroke: none;
  opacity: 0;
  animation: score-fade 0.6s ease-out forwards;
}
.score-chart-svg .series-line {
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: score-draw 1.4s cubic-bezier(0.65, 0, 0.35, 1) forwards;
}
.score-chart-svg .series-point {
  stroke: var(--bg);
  stroke-width: 2;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: score-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.score-chart-svg .point-label {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: score-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.score-chart-svg .point-label rect {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1;
}
.score-chart-svg .point-label-date {
  fill: var(--muted);
  font-family: var(--font-display, "Archivo Black", system-ui, sans-serif);
  font-size: 9px;
  letter-spacing: 0.08em;
}
.score-chart-svg .point-label-score {
  fill: var(--gold);
  font-family: var(--font-display, "Archivo Black", system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
}
.score-chart-svg .point-label-stem {
  stroke: var(--line);
  stroke-width: 1;
}
.score-chart-svg .trend-tail {
  stroke: var(--gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  animation: score-fade 0.6s ease-out forwards;
}
@keyframes score-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes score-fade {
  to { opacity: 1; }
}
@keyframes score-pop {
  0%   { opacity: 0; transform: translateY(6px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0)   scale(1);    }
}
@media (prefers-reduced-motion: reduce) {
  .score-chart-svg .series-area,
  .score-chart-svg .series-line,
  .score-chart-svg .series-point,
  .score-chart-svg .point-label,
  .score-chart-svg .trend-tail {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
  }
}
.score-chart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: var(--space-8) 0;
}

/* ---------- Filter pills ---------- */
.filter-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.filter-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-5);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.filter-pill:hover { border-color: var(--gold); background: var(--surface-soft); }
.pill-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}
.pill-count {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--ink);
  line-height: 1;
}

/* ---------- Dispute table ---------- */
.dispute-table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dispute-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.dispute-table th, .dispute-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: middle;
}
.dispute-table thead th {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 900;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.dispute-table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.dispute-table .bureau-col { width: 60px; text-align: center; }
.dispute-empty { text-align: center; color: var(--muted); padding: 24px; }
.bureau-status {
  display: inline-block;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  font-weight: 700;
}
.bureau-status.removed   { background: var(--green-soft); color: var(--green); }
.bureau-status.dispute   { background: rgba(255,184,0,0.15); color: var(--gold); }
.bureau-status.negative  { background: var(--red-soft); color: var(--red); }
.bureau-status.positive  { background: #0095ff0f; color: #3FA9F5; }
.bureau-status.unknown   { background: var(--surface-soft); color: var(--dim); }
.bureau-status.empty     { background: transparent; color: var(--dim); width: auto; }

/* ---------- Payment widgets ---------- */
.payment-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}
.payment-card { padding: var(--space-6) var(--space-7); }
.cms-card-value {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
}
.cms-card-logo {
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* ---------- POA modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 460px;
  width: 92%;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  z-index: 1;
}
.modal-box h2 {
  margin: 0 0 var(--space-3) 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-transform: uppercase;
}
.modal-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-4);
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close:hover { color: var(--ink); }
.modal-lede {
  margin: 0 0 var(--space-4) 0 !important;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
#monitoring-modal .modal-box { max-width: 540px; }

/* ScoreFusion-only view: replaces the credit-monitoring form for clients on
   ScoreFusion (id -1), where there's nothing for them to edit. */
.scorefusion-only {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-4);
}
.scorefusion-only img {
  max-width: 220px;
  height: auto;
  display: block;
}
.scorefusion-only p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 420px;
}
.scorefusion-only p strong { color: var(--ink); font-weight: 700; }
.modal-box p {
  margin: 0 0 var(--space-5) 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.55;
}

/* ============================================================
   Phase 2 — Credit Status page
   ============================================================ */

.page-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--space-6);
  display: flex;
  gap: var(--space-6);
}
.page-nav-link {
  display: block;
  padding: var(--space-4) var(--space-1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s ease;
}
.page-nav-link:hover { color: var(--ink-soft); }
.page-nav-link.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}
.page-header .greeting { margin-bottom: 0; }
.page-header .eyebrow + .greeting { margin-top: var(--space-3); }
.page-lede {
  margin: var(--space-3) 0 0 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 620px;
}

/* ---------- Sign-agreement page ---------- */
.agreement-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}
.agreement-doc {
  max-height: 520px;
  overflow-y: auto;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.agreement-doc-loading { color: var(--muted); text-align: center; padding: var(--space-6) 0; }
.agreement-doc h1, .agreement-doc h2, .agreement-doc h3 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: var(--space-5) 0 var(--space-2);
}
.agreement-doc h1 { font-size: 18px; text-transform: uppercase; letter-spacing: 0.06em; }
.agreement-doc h2 { font-size: 15px; }
.agreement-doc h3 { font-size: 13px; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.agreement-doc p  { margin: 0 0 var(--space-3); }
.agreement-doc ol, .agreement-doc ul { margin: 0 0 var(--space-3) 0; padding-left: var(--space-6); }
.agreement-doc li { margin-bottom: var(--space-2); }
.agreement-doc table { width: 100%; border-collapse: collapse; margin: var(--space-3) 0; font-size: 13px; }
.agreement-doc th, .agreement-doc td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.agreement-doc img, .agreement-doc svg { max-width: 100%; height: auto; }
.agreement-doc a { color: var(--gold); }

.sign-form { display: flex; flex-direction: column; gap: var(--space-5); }
.consent-row { display: flex; flex-direction: column; gap: var(--space-3); }
.consent-check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.5;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.consent-check:has(input:checked) {
  border-color: rgba(63,209,122,0.35);
  background: linear-gradient(180deg, rgba(63,209,122,0.05), var(--surface));
}
.consent-check input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.signature-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}
.signature-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-3);
}
.signature-canvas {
  display: block;
  width: 100%;
  height: 180px;
  background: #000;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  touch-action: none;
  cursor: crosshair;
}
.signature-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}
.signature-hint { font-size: 12px; color: var(--muted); }

/* ---------- Required-steps tiles ---------- */
.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.step-tile {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.step-tile.is-done {
  background: linear-gradient(180deg, rgba(63,209,122,0.05), var(--surface));
  border-color: rgba(63,209,122,0.30);
}
.step-tile.is-pending { border-color: rgba(255,184,0,0.30); }
.step-tile-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: transparent;
}
.step-tile.is-done .step-tile-icon {
  background: var(--green);
  border-color: var(--green);
  color: #000;
}
.step-tile.is-done .step-tile-icon::before { content: "\2713"; font-size: 16px; line-height: 1; }
.step-tile.is-pending .step-tile-icon {
  border-color: var(--gold);
  background: rgba(255,184,0,0.10);
}
.step-tile-body { min-width: 0; }
.step-tile-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
}
.step-tile-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.step-tile-action.btn-primary {
  white-space: nowrap;
}
.step-tile-done-text {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  padding: 6px 12px;
  background: var(--green-soft);
  border-radius: var(--radius-pill);
}
.step-tile-done-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.step-tile-done-logo img {
  height: 24px;
  max-width: 140px;
  object-fit: contain;
}
.step-tile-pending-text {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
}
.step-tile.skeleton { color: transparent; }
.step-tile.skeleton .step-tile-title,
.step-tile.skeleton .step-tile-desc { background: var(--surface-soft); border-radius: 4px; }
@media (max-width: 640px) {
  .step-tile {
    grid-template-columns: 32px 1fr;
    grid-template-rows: auto auto;
    row-gap: var(--space-3);
  }
  .step-tile-action { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.status-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.status-tab:hover { border-color: var(--muted); }
.status-tab.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(255,184,0,0.05), var(--surface));
}
.status-tab-label {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-tab-count {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--ink);
  line-height: 1;
}
.status-tab-count.skeleton {
  display: inline-block;
  min-width: 1.6em;
  height: 0.9em;
  vertical-align: middle;
  border-radius: 5px;
}
.status-tab.active .status-tab-label { color: var(--gold); }

.status-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.status-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
/* Row-shaped loading skeletons for the credit-status item list */
.status-item-skeleton .status-item-header { cursor: default; pointer-events: none; }
.status-item-skeleton .status-item-header:hover { background: transparent; }
.skel-line   { display: block;  height: 14px; border-radius: 4px; }
.skel-line.short { width: 60%; }
.skel-line.tiny  { width: 80%; height: 11px; }
.skel-circle { display: inline-block; width: 24px; height: 24px; border-radius: 50%; }

.status-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.status-items-header {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 140px auto 24px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-5);
  margin-bottom: var(--space-2);
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.status-items-header-bureaus {
  display: flex;
  gap: 6px;
}
.status-items-header-bureaus span {
  width: 24px;
  text-align: center;
}
.status-item-header {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) 140px auto 24px;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  transition: background 0.15s ease;
}
.status-item-header:hover { background: var(--surface-soft); }
.status-item-creditor {
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.status-item-type {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.status-item-bureaus {
  display: flex;
  gap: 6px;
}
.status-item-caret {
  color: var(--muted);
  font-size: 14px;
  transition: transform 0.2s ease;
}
.status-item.expanded .status-item-caret { transform: rotate(180deg); }

.status-item-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease;
  padding: 0 var(--space-5);
  border-top: 1px solid transparent;
}
.status-item.expanded .status-item-body {
  max-height: 800px;
  padding: var(--space-5);
  border-top-color: var(--line-soft);
}
.status-item-reason {
  margin: 0 0 var(--space-4) 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.status-item-bureau-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.bureau-detail {
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.bureau-detail-name {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.bureau-detail-status {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.bureau-detail-empty {
  font-size: 13px;
  color: var(--dim);
  font-style: italic;
  padding: 4px 0;
}
.bureau-detail-list {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  font-size: 12px;
}
.bureau-detail-list dt { color: var(--dim); }
.bureau-detail-list dd { color: var(--ink-soft); margin: 0; font-family: ui-monospace, monospace; }

/* ============================================================
   Phase 3 — Documents page
   ============================================================ */

.doc-section { margin-bottom: var(--space-10); }
.doc-section .section-meta { margin-bottom: var(--space-4); }

.doc-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.doc-empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  transition: border-color 0.15s ease;
}
.doc-card:hover { border-color: var(--muted); }
.doc-card-skeleton { pointer-events: none; }
.doc-card-skeleton .skel-pill {
  display: inline-block;
  width: 80px;
  height: 18px;
  border-radius: 999px;
  vertical-align: middle;
}
.doc-card-skeleton .skel-btn {
  display: inline-block;
  width: 64px;
  height: 32px;
  border-radius: var(--radius-md);
}
.doc-card-skeleton .doc-card-name .skel-line { width: 55%; height: 14px; }
.doc-card-skeleton .doc-card-meta .skel-line { height: 11px; }

.doc-card-main { flex: 1; min-width: 0; }
.doc-card-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.doc-card-by, .doc-card-date {
  color: var(--dim);
  font-family: ui-monospace, monospace;
  font-size: 11px;
}

.doc-card-cat {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.doc-cat-1 { background: rgba(63,209,122,0.12); color: var(--green); }
.doc-cat-2 { background: rgba(63,209,122,0.12); color: var(--green); }
.doc-cat-3 { background: rgba(63,209,122,0.12); color: var(--green); }
.doc-cat-4 { background: var(--surface-soft); color: var(--muted); }
.doc-cat-5 { background: rgba(255,184,0,0.12); color: var(--gold); }

.doc-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

.doc-delete-btn:hover { color: var(--red); border-color: var(--red); }

/* Upload modal — select + textarea styling */
.modal-box select,
.modal-box textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
}
/* Selects need extra right padding for the custom caret and the appearance reset
   so the native dropdown arrow doesn't overlap with the option text. */
.modal-box select {
  padding-right: 40px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1L6 6L11 1' stroke='%23FFB800' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}
.modal-box select:focus,
.modal-box textarea:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-focus);
}
.modal-box textarea { resize: vertical; min-height: 60px; }
.modal-box input[type="file"] {
  padding: 8px;
  background: var(--surface-soft);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  width: 100%;
  font-size: 13px;
}
.modal-box input[type="file"]::file-selector-button {
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  margin-right: 12px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ============================================================
   Phase 4 — My Account page
   ============================================================ */

.section-meta-inline { color: var(--dim); font-weight: 400; }

.account-tabs {
  display: flex;
  gap: var(--space-1);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}
.account-tab {
  background: transparent;
  color: var(--muted);
  border: none;
  border-bottom: 2px solid transparent;
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s ease;
}
.account-tab:hover { color: var(--ink-soft); }
.account-tab.active {
  color: var(--ink);
  border-bottom-color: var(--gold);
}

.account-panel[hidden] { display: none; }

.form-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-7);
}
/* Stack between form sections (per §5.2) */
.form-section + .form-section { margin-top: var(--space-6); }
/* Title-to-fields stack (per §5.2: 12px) */
.form-section .section-title { margin-bottom: var(--space-3); }
/* Title-to-helper paragraph stack */
.form-section .section-title + .section-meta { margin: 0 0 var(--space-4) 0; }
/* Sub-heading inside a form section — separates groups (e.g., "Current address" vs "Previous address") */
.form-section .section-title.subhead { margin-top: var(--space-7); }

.form-grid {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}
.form-grid.two   { grid-template-columns: repeat(2, 1fr); }
.form-grid.three { grid-template-columns: 1fr 80px 120px; }
@media (max-width: 640px) {
  .form-grid.two, .form-grid.three { grid-template-columns: 1fr; }
}

/* Reset spacing where a single .field is the immediate child (no surrounding grid) */
.form-section > .field { margin-bottom: var(--space-4); }
.form-section > .field:last-of-type { margin-bottom: 0; }

.field-help {
  display: block;
  margin-top: var(--space-1);
  font-size: 12px;
  color: var(--dim);
}

input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

/* Agency select + logo side-by-side */
.agency-select-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: var(--space-4);
  align-items: center;
}
.agency-logo {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  visibility: hidden;
}
.agency-logo img {
  max-height: 32px;
  max-width: 100%;
  object-fit: contain;
  display: block;
}
@media (max-width: 640px) {
  .agency-select-row { grid-template-columns: 1fr; }
  /* Default `justify-self: stretch` so the flex wrapper takes the full row width
     and the inner <img> (max-width: 100%, max-height: 32px) can size correctly.
     Don't use `justify-self: start` here — that collapses the wrapper to 0px. */
  .agency-logo { justify-content: flex-start; }
}

/* Native <select> — restyled to match the input fields */
.account-panel select,
.form-section select {
  width: 100%;
  padding: 14px 36px 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  /* Custom gold caret on the right side */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1L6 6L11 1' stroke='%23FFB800' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.account-panel select:focus,
.form-section select:focus {
  border-color: var(--gold);
  box-shadow: var(--shadow-focus);
}
.account-panel select option,
.form-section select option {
  background: var(--surface);
  color: var(--ink);
}

.form-actions {
  margin-top: var(--space-6);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.team-card {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
}
.team-card-name {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: -0.01em;
}
.team-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  color: var(--muted);
  font-size: 13px;
}
.team-card-meta a { color: var(--gold); text-decoration: none; }
.team-card-meta a:hover { color: var(--gold-bright); }

/* ---------- Mobile tweaks ---------- */
@media (max-width: 640px) {
  /* Tighten outer chrome so content breathes on narrow screens */
  .topbar    { padding-left: var(--space-4); padding-right: var(--space-4); }
  .container { padding-left: var(--space-4); padding-right: var(--space-4); }

  /* Bureau grid: stack full-width — was forced 2-col which left a lonely 3rd card */
  .bureau-grid { grid-template-columns: 1fr; }
  /* 4-element grids still look good as 2x2 on mobile */
  .filter-pills, .onboarding-bar, .status-tabs { grid-template-columns: repeat(2, 1fr); }

  /* Cards: lighter padding on mobile so the score doesn't feel cramped */
  .bureau-card { padding: var(--space-5) var(--space-6); }
  .form-section { padding: var(--space-5); }
  .modal-box   { padding: var(--space-6) var(--space-5); }

  /* Page nav: let it horizontally scroll if it doesn't fit, hide the bar */
  .page-nav {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
    gap: var(--space-5);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .page-nav::-webkit-scrollbar { display: none; }
  .page-nav-link { white-space: nowrap; flex-shrink: 0; }

  /* Form actions: stretch and stack so primary is easy to thumb-tap */
  .form-actions { flex-direction: column-reverse; align-items: stretch; }
  .form-actions .btn-primary,
  .form-actions .btn-ghost { width: 100%; text-align: center; }

  /* Tighter vertical rhythm between sections */
  .section-block { margin-top: var(--space-8); }

  /* Round stepper — keep existing tuning */
  .round-stepper { grid-template-columns: repeat(var(--visible-rounds, 4), 92px); }
  .round-num { width: 56px; height: 56px; border-width: 4px; font-size: 18px; }
  .round-check { width: 22px; height: 22px; }
  .round-stepper li::after { top: 42px; left: calc(50% + 27px); right: calc(-50% + 27px); height: 4px; }
  .round-meta { font-size: 10px; }
  .dispute-table { font-size: 13px; }
  .dispute-table th:nth-child(2), .dispute-table td:nth-child(2) { display: none; }
  .status-item-header,
  .status-items-header { grid-template-columns: 1fr auto 24px; }
  .status-item-type,
  .status-items-header > span:nth-child(2) { display: none; }
  .doc-card { flex-direction: column; align-items: stretch; }
  .doc-card-actions { justify-content: flex-end; }
}

/* Very small phones (≤380px — iPhone SE, etc.) */
@media (max-width: 380px) {
  .topbar    { padding-left: var(--space-3); padding-right: var(--space-3); }
  .container { padding-left: var(--space-3); padding-right: var(--space-3); }
  .page-nav  { padding-left: var(--space-3); padding-right: var(--space-3); gap: var(--space-4); }
  .greeting  { font-size: 24px; }
  .modal-box { padding: var(--space-5) var(--space-4); }
}

/* Bigger touch targets on coarse pointers (phones/tablets) */
@media (pointer: coarse) {
  .btn-ghost { padding: 10px 16px; min-height: 40px; font-size: 14px; }
  .page-nav-link { padding-top: 14px; padding-bottom: 14px; }
  .modal-close { padding: 8px 12px; font-size: 32px; min-width: 44px; min-height: 44px; }
}

/* ============================================================
   Chat widget (Riley)
   ============================================================ */
.pcr-chat {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: 1100;
  font-family: var(--font-body);
}
.pcr-chat-bubble {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 184, 0, 0.35), 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.pcr-chat-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 184, 0, 0.45), 0 6px 14px rgba(0, 0, 0, 0.5);
}
.pcr-chat-bubble:active { transform: translateY(0); }
.pcr-chat-bubble-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 10px;
  height: 10px;
  background: var(--green);
  border: 2px solid var(--bg);
  border-radius: 50%;
}
.pcr-chat.is-open .pcr-chat-bubble { display: none; }

.pcr-chat-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 360px;
  max-width: calc(100vw - var(--space-5) * 2);
  height: min(560px, calc(100vh - 80px));
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pcr-chat-pop 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
}
@keyframes pcr-chat-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}
.pcr-chat-panel[hidden] { display: none; }

.pcr-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
}
.pcr-chat-head-meta { display: flex; flex-direction: column; gap: 2px; }
.pcr-chat-head-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.pcr-chat-head-sub {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pcr-chat-close {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
}
.pcr-chat-close:hover { color: var(--ink); }

.pcr-chat-log {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--bg);
}
.pcr-chat-row {
  display: flex;
  max-width: 86%;
}
.pcr-chat-row.is-user { align-self: flex-end; }
.pcr-chat-row.is-ai   { align-self: flex-start; }
.pcr-chat-bubble-msg {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.pcr-chat-row.is-user .pcr-chat-bubble-msg {
  background: var(--gold);
  color: var(--bg);
  border-bottom-right-radius: 4px;
}
.pcr-chat-row.is-ai .pcr-chat-bubble-msg {
  background: var(--surface-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
/* Clickable links inside chat bubbles — gold in AI replies, inverted in user replies */
.pcr-chat-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.pcr-chat-link:hover { color: var(--gold-bright); }
.pcr-chat-row.is-user .pcr-chat-link {
  color: var(--bg);
  text-decoration-color: rgba(0,0,0,0.5);
}
.pcr-chat-row.is-user .pcr-chat-link:hover { text-decoration-color: var(--bg); }

.pcr-chat-typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px;
}
.pcr-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: pcr-chat-typing 1.2s infinite ease-in-out;
}
.pcr-chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.pcr-chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pcr-chat-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

.pcr-chat-form {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.pcr-chat-input {
  flex: 1 1 auto;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-family: var(--font-body);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.pcr-chat-input:focus { border-color: var(--gold); box-shadow: var(--shadow-focus); }
.pcr-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--bg);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}
.pcr-chat-send:hover { background: var(--gold-bright); }
.pcr-chat-send:active { transform: translateY(1px); }

@media (max-width: 640px) {
  .pcr-chat { bottom: var(--space-4); right: var(--space-4); }
  .pcr-chat-panel {
    width: calc(100vw - var(--space-4) * 2);
    height: min(70vh, calc(100vh - 80px));
  }
}

/* Portal version footer */
.portal-footer {
  display: block;
  text-align: center;
  padding: var(--space-6) var(--space-4) var(--space-5);
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
}

/* ============================================================
   Error page (404 / 500 etc.)
   ============================================================ */
.error-page {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.error-card {
  max-width: 520px;
  width: 100%;
  text-align: center;
  padding: var(--space-7) var(--space-5);
}
.error-code {
  font-family: var(--font-display);
  font-size: clamp(72px, 16vw, 128px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--gold);
  margin-bottom: var(--space-4);
}
.error-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  letter-spacing: -0.02em;
  margin: 0 0 var(--space-3);
  color: var(--ink);
}
.error-lede {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 var(--space-5);
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-5);
}
.error-help {
  color: var(--dim);
  font-size: 13px;
  margin: 0;
}
.error-phone {
  color: var(--gold);
  text-decoration: none;
  white-space: nowrap;
}
.error-phone:hover { text-decoration: underline; }
