/* Viplor client-area design system (Home first; reuse on later pages).
 * Tokens follow the public site (--vp-*) plus score-band colors matching
 * scoring_engine_b DISPLAY bands. Classes are prefixed `vds-`.
 * No inline styles: CSP style-src 'self'. SVG presentation attributes are fine.
 */

.vds-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:root {
  --band-red-text: #B42318;
  --band-red-arc: #D92D20;
  --band-red-soft: #FDECEA;
  --band-orange-text: #8F5300;
  --band-orange-arc: #D97706;
  --band-orange-soft: #FFF2D9;
  --band-green-text: #1D6234;
  --band-green-arc: #2E9E57;
  --band-green-soft: #E3F4E6;
}

.vds-icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.vds-btn {
  --_h: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--vp-space-2, 0.5rem);
  min-height: var(--_h);
  padding: 0 1.125rem;
  border: 1px solid transparent;
  border-radius: var(--vp-radius-sm, 10px);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 550;
  letter-spacing: var(--vp-tracking-tight, -0.011em);
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: inherit;
  background: transparent;
  transition: background-color var(--vp-dur-fast, 140ms) ease,
    border-color var(--vp-dur-fast, 140ms) ease,
    transform var(--vp-dur-fast, 140ms) ease;
}
.vds-btn:active { transform: translateY(1px); }
.vds-btn:focus-visible {
  outline: 2px solid var(--vp-focus, #0B0F14);
  outline-offset: 3px;
}
.vds-btn--primary { background: var(--vp-btn, #0B0F14); color: var(--vp-btn-text, #fff); }
.vds-btn--primary:hover { background: var(--vp-btn-hover, #232A34); }
.vds-btn--secondary {
  background: var(--vp-surface, #fff);
  border-color: var(--vp-line-strong, #CBC8BB);
  color: var(--vp-text, #0B0F14);
}
.vds-btn--secondary:hover { border-color: var(--vp-text-3, #5E6571); }
.vds-btn__arrow { width: 16px; height: 16px; flex: none; }
.vds-btn:hover .vds-btn__arrow { transform: translateX(2px); }
.vds-btn__plus {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  margin-left: -0.25rem;
  border-radius: 6px;
  background: var(--vp-accent, #A8FF3E);
  color: var(--vp-accent-ink, #0B0F14);
}
.vds-btn__plus svg { width: 12px; height: 12px; stroke-width: 2.2; }

.vds-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--vp-text-sm, 0.875rem);
  font-weight: 550;
  color: var(--vp-text, #0B0F14);
  text-decoration: underline;
  text-decoration-color: var(--vp-line-strong, #CBC8BB);
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}
.vds-link:hover { text-decoration-color: currentColor; }
.vds-link:focus-visible {
  outline: 2px solid var(--vp-focus, #0B0F14);
  outline-offset: 3px;
  border-radius: 4px;
}
.vds-link .vds-btn__arrow { width: 14px; height: 14px; }

.vds-card {
  min-width: 0;
  border: 1px solid var(--vp-line, #E3E1D7);
  border-radius: var(--vp-radius-lg, 20px);
  background: var(--vp-surface, #fff);
  box-shadow: var(--vp-shadow-2, 0 1px 2px rgba(11, 15, 20, 0.04), 0 6px 20px -4px rgba(11, 15, 20, 0.08));
}
.vds-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 1.125rem 1.25rem 0;
}
.vds-card__title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: var(--vp-tracking-tight, -0.011em);
  line-height: var(--vp-leading-snug, 1.25);
}
.vds-card__sub {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--vp-text-3, #5E6571);
}

.vds-eyebrow {
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: var(--vp-text-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vp-text-3, #5E6571);
}

.vds-home {
  display: grid;
  gap: var(--vp-space-5, 1.5rem);
  min-width: 0;
  overflow-x: clip;
}

.vds-page-head {
  display: grid;
  gap: var(--vp-space-4, 1rem);
  min-width: 0;
}
.vds-page-head__title {
  margin: 0.25rem 0 0;
  font-size: var(--vp-text-2xl, 1.875rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.034em;
  text-wrap: balance;
}
.vds-page-head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.875rem;
  margin: 0.625rem 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--vp-text-sm, 0.875rem);
  color: var(--vp-text-2, #414854);
}
.vds-page-head__meta > * {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  min-width: 0;
}
.vds-page-head__meta .vds-icon { width: 15px; height: 15px; color: var(--vp-text-3, #5E6571); }
.vds-page-head__url {
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
  overflow-wrap: anywhere;
  color: inherit;
}
.vds-page-head__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--vp-space-3, 0.75rem);
}
.vds-page-head__actions .vds-btn { flex: 1 1 auto; }

.vds-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: var(--vp-radius-xs, 6px);
  background: var(--band-green-soft);
  color: var(--band-green-text);
  font-size: var(--vp-text-xs, 0.75rem);
  font-weight: 600;
}
.vds-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--band-green-arc);
}
.vds-status--partial {
  background: var(--band-orange-soft);
  color: var(--band-orange-text);
}
.vds-status--partial::before { background: var(--band-orange-arc); }
.vds-status--failed {
  background: var(--band-red-soft);
  color: var(--band-red-text);
}
.vds-status--failed::before { background: var(--band-red-arc); }

.vds-score {
  display: grid;
  gap: var(--vp-space-5, 1.5rem);
  padding: 1.5rem 1.25rem;
}
.vds-score__main {
  display: grid;
  justify-items: center;
  gap: var(--vp-space-4, 1rem);
  text-align: center;
  /* Neutral arc when a result has a number but no method B band (vip-39). */
  --band-arc: var(--vp-text-3, #5E6571);
  --band-text: var(--vp-text-2, #414854);
}
.vds-score__body {
  display: grid;
  gap: var(--vp-space-5, 1.5rem);
  align-content: center;
  min-width: 0;
}
.vds-score__headline {
  margin: 0;
  font-size: var(--vp-text-xl, 1.25rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: var(--vp-tracking-heading, -0.024em);
  text-wrap: balance;
}
.vds-score__text {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  color: var(--vp-text-2, #414854);
  max-width: 36em;
}
.vds-score__text strong { color: var(--vp-text, #0B0F14); font-weight: 600; }
.vds-score__neutral {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--vp-text-2, #414854);
}

.vds-gauge { position: relative; width: 11rem; height: 11rem; }
.vds-gauge svg { width: 100%; height: 100%; overflow: visible; display: block; }
.vds-gauge__track { fill: none; stroke: var(--vp-surface-2, #F3F2EC); stroke-width: 9; }
.vds-gauge__tick { stroke: var(--vp-surface, #fff); stroke-width: 2; }
.vds-gauge__inner { fill: none; stroke: var(--vp-line, #E3E1D7); stroke-width: 1; stroke-dasharray: 1 5.07; }
.vds-gauge__arc { fill: none; stroke-width: 9; stroke-linecap: round; stroke: var(--band-arc); }
.vds-gauge__value {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  line-height: 1;
  margin: 0;
}
.vds-gauge__num {
  font-size: 3.25rem;
  font-weight: 650;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
.vds-gauge__max {
  margin-top: 0.375rem;
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  color: var(--vp-text-3, #5E6571);
}

.vds-band-red { --band-text: var(--band-red-text); --band-arc: var(--band-red-arc); --band-soft: var(--band-red-soft); }
.vds-band-orange { --band-text: var(--band-orange-text); --band-arc: var(--band-orange-arc); --band-soft: var(--band-orange-soft); }
.vds-band-green { --band-text: var(--band-green-text); --band-arc: var(--band-green-arc); --band-soft: var(--band-green-soft); }

.vds-band-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  height: 1.75rem;
  padding: 0 0.6875rem;
  border-radius: var(--vp-radius-pill, 999px);
  background: var(--band-soft);
  color: var(--band-text);
  font-size: 0.8125rem;
  font-weight: 600;
}
.vds-band-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--band-arc);
}

.vds-bands {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 0.875rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.75rem;
  color: var(--vp-text-3, #5E6571);
}
.vds-bands li { display: inline-flex; align-items: center; gap: 0.375rem; }
.vds-bands li::before {
  content: "";
  width: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--band-arc);
}
.vds-bands li[aria-current="true"] { color: var(--vp-text, #0B0F14); font-weight: 600; }
.vds-bands .vds-bands__num {
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.6875rem;
}

.vds-assist { border-top: 1px solid var(--vp-line, #E3E1D7); padding-top: var(--vp-space-4, 1rem); }
.vds-assist__caption { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.vds-assist__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.vds-mini {
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.875rem 0.5rem 0.75rem;
  border: 1px solid var(--vp-line, #E3E1D7);
  border-radius: var(--vp-radius-md, 14px);
  background: var(--vp-bg, #F7F6F1);
  text-align: center;
}
.vds-mini__gauge { position: relative; width: 3.75rem; height: 3.75rem; }
.vds-mini__gauge svg { width: 100%; height: 100%; display: block; }
.vds-mini__track { fill: none; stroke: var(--vp-surface-2, #F3F2EC); stroke-width: 5; }
.vds-mini__arc { fill: none; stroke-width: 5; stroke-linecap: round; stroke: var(--band-arc); }
.vds-mini__num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.vds-mini__name { margin: 0; font-size: 0.875rem; font-weight: 600; line-height: 1.2; }
.vds-mini__band { margin: 0; font-size: 0.75rem; font-weight: 550; color: var(--band-text); line-height: 1.2; }

.vds-cols { display: grid; gap: var(--vp-space-5, 1.5rem); min-width: 0; }
.vds-stack { display: grid; gap: var(--vp-space-5, 1.5rem); align-content: start; min-width: 0; }

.vds-todo__list {
  counter-reset: vds-todo;
  margin: 0;
  padding: 0.625rem 0.5rem 0;
  list-style: none;
}
.vds-todo__item {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  grid-template-areas: "n title gain" "n meta gain";
  column-gap: 0.75rem;
  row-gap: 0.375rem;
  align-items: center;
  padding: 0.875rem 0.75rem;
  counter-increment: vds-todo;
  min-width: 0;
}
.vds-todo__item + .vds-todo__item { border-top: 1px solid var(--vp-line, #E3E1D7); }
.vds-todo__item::before {
  content: counter(vds-todo, decimal-leading-zero);
  grid-area: n;
  align-self: start;
  padding-top: 2px;
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  color: var(--vp-text-3, #5E6571);
}
.vds-todo__title {
  grid-area: title;
  font-size: 0.9375rem;
  font-weight: 550;
  line-height: 1.35;
  min-width: 0;
  overflow-wrap: anywhere;
}
.vds-todo__meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--vp-text-3, #5E6571);
}
.vds-todo__bar {
  flex: 0 1 5.5rem;
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
  display: block;
}
.vds-todo__bar-track { fill: var(--vp-surface-2, #F3F2EC); }
.vds-todo__bar-fill { fill: var(--vp-text-3, #5E6571); }
.vds-todo__count {
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
  color: var(--vp-text-2, #414854);
  white-space: nowrap;
}
.vds-gain {
  grid-area: gain;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4.25rem;
  height: 1.75rem;
  padding: 0 0.625rem;
  border-radius: var(--vp-radius-pill, 999px);
  background: var(--vp-accent-soft, #EAF8D5);
  color: var(--vp-accent-text, #336100);
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.vds-gain--top { background: var(--vp-accent, #A8FF3E); color: var(--vp-accent-ink, #0B0F14); }
.vds-todo__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0.25rem 1.25rem 0;
  padding: 0.875rem 0 1.125rem;
  border-top: 1px solid var(--vp-line, #E3E1D7);
}
.vds-footnote {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--vp-text-3, #5E6571);
  max-width: 34em;
}

.vds-trend__body {
  display: grid;
  gap: var(--vp-space-4, 1rem);
  padding: 1rem 1.25rem 1.25rem;
}
.vds-trend__chart {
  position: relative;
  margin: 0;
  border-radius: var(--vp-radius-md, 14px);
  background: var(--vp-bg, #F7F6F1);
  border: 1px dashed var(--vp-line-strong, #CBC8BB);
  padding: 0.75rem 0.75rem 0.5rem;
  min-width: 0;
}
.vds-trend__chart svg { width: 100%; height: auto; display: block; }
.vds-trend__grid { stroke: var(--vp-line, #E3E1D7); stroke-width: 1; }
.vds-trend__line { fill: none; stroke: var(--vp-text, #0B0F14); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.vds-trend__ghost { fill: none; stroke: var(--vp-line-strong, #CBC8BB); stroke-width: 1.5; stroke-dasharray: 3 5; stroke-linecap: round; }
.vds-trend__point { fill: var(--band-arc, var(--vp-text-3, #5E6571)); stroke: var(--vp-surface, #fff); stroke-width: 2.5; }
.vds-trend__axis {
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 10px;
  fill: var(--vp-text-3, #5E6571);
}
.vds-trend__label {
  font-family: var(--vp-font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: 11px;
  font-weight: 600;
  fill: var(--band-text, var(--vp-text-2, #414854));
}
.vds-trend__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: var(--vp-tracking-tight, -0.011em);
}
.vds-trend__text {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--vp-text-2, #414854);
}
.vds-trend__body .vds-btn { justify-self: start; }

.vds-usage {
  display: grid;
  gap: 0.75rem;
  padding: 1.125rem 1.25rem 1.25rem;
}
.vds-usage__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.vds-usage__figure {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.vds-usage__ring {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
}
.vds-usage__ring svg { width: 100%; height: 100%; display: block; overflow: visible; }
.vds-usage__track { fill: none; stroke: var(--vp-surface-2, #F3F2EC); stroke-width: 5; }
.vds-usage__arc {
  fill: none;
  stroke: var(--band-arc, var(--vp-text, #0B0F14));
  stroke-width: 5;
  stroke-linecap: round;
}
.vds-usage__value {
  margin: 0;
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 2rem;
  font-weight: 600;
  line-height: 1;
  color: var(--vp-text, #0B0F14);
  font-variant-numeric: tabular-nums;
}
.vds-usage__note {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--vp-text-2, #414854);
  max-width: 36em;
}
.vds-usage .vds-link { justify-self: start; }
.vds-usage__meter {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: repeating-linear-gradient(
    90deg,
    var(--vp-surface-2, #F3F2EC) 0 10px,
    transparent 10px 14px
  );
}
.vds-tag {
  display: inline-flex;
  align-items: center;
  height: 1.375rem;
  padding: 0 0.4375rem;
  border: 1px solid var(--vp-line-strong, #CBC8BB);
  border-radius: var(--vp-radius-xs, 6px);
  font-family: var(--vp-font-mono, ui-monospace, monospace);
  font-size: 0.6875rem;
  color: var(--vp-text-2, #414854);
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .vds-score {
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--vp-space-6, 2rem);
    padding: 1.75rem;
    align-items: center;
  }
  .vds-score__main {
    padding-right: var(--vp-space-6, 2rem);
    border-right: 1px solid var(--vp-line, #E3E1D7);
  }
  .vds-page-head__actions .vds-btn { flex: 0 0 auto; }
  .vds-card__head { padding: 1.25rem 1.5rem 0; }
  .vds-todo__list { padding: 0.75rem 0.75rem 0; }
  .vds-todo__foot { margin: 0.25rem 1.5rem 0; padding-bottom: 1.25rem; }
  .vds-trend__body, .vds-usage { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 64rem) {
  .vds-page-head {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }
  .vds-cols {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: start;
  }
  .vds-gauge { width: 12rem; height: 12rem; }
  .vds-gauge__num { font-size: 3.5rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .vds-gauge__arc { animation: vds-arc-draw 1.4s var(--vp-ease-out, cubic-bezier(0.22, 0.8, 0.24, 1)) 0.2s both; }
  .vds-mini__arc { animation: vds-mini-draw 1.1s var(--vp-ease-out, cubic-bezier(0.22, 0.8, 0.24, 1)) both; }
  .vds-mini:nth-child(1) .vds-mini__arc { animation-delay: 0.45s; }
  .vds-mini:nth-child(2) .vds-mini__arc { animation-delay: 0.55s; }
  .vds-mini:nth-child(3) .vds-mini__arc { animation-delay: 0.65s; }
  .vds-todo__item { animation: vds-rise 0.6s var(--vp-ease-out, cubic-bezier(0.22, 0.8, 0.24, 1)) both; }
  .vds-todo__item:nth-child(1) { animation-delay: 0.3s; }
  .vds-todo__item:nth-child(2) { animation-delay: 0.38s; }
  .vds-todo__item:nth-child(3) { animation-delay: 0.46s; }
  .vds-todo__item:nth-child(4) { animation-delay: 0.54s; }
  .vds-todo__item:nth-child(5) { animation-delay: 0.62s; }
}
@keyframes vds-arc-draw { from { stroke-dashoffset: 326.73; } }
@keyframes vds-mini-draw { from { stroke-dashoffset: 131.95; } }
@keyframes vds-rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  .vds-gauge__arc, .vds-mini__arc, .vds-todo__item { animation: none; }
  .vds-btn:active { transform: none; }
}

/* Dashboard Home is a full-width recap, not the narrow onboarding card. */
body.vi-page-narrow:has(#vi-app-dashboard:not([hidden])) .vi-main {
  max-width: 70rem;
}
#vi-app-card:has(#vi-app-dashboard:not([hidden])) {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
#vi-view-home {
  min-width: 0;
  overflow-x: clip;
}
