/* Local Visibility Scorecard, reusable client side widget.
   All logic runs in the browser. No network calls, no backend.
   Every class is namespaced .lvs- so it can be dropped into any BBH page
   (the standalone tool page and the restaurant landing page) without
   touching the shared nav/footer rules. Colours come from the page :root
   tokens (--emerald, --bg-card, etc.), so it inherits the house theme. */

.lvs {
  --lvs-radius: 16px;
  --lvs-line: rgba(255, 255, 255, 0.08);
  --lvs-line-strong: rgba(255, 255, 255, 0.14);
  max-width: 760px;
  margin: 0 auto;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text, #ebebeb);
}

/* ---- shell ---- */
.lvs-card {
  background: var(--bg-card, #0d0d0d);
  border: 1px solid var(--lvs-line);
  border-radius: var(--radius-lg, 24px);
  padding: 30px 30px 26px;
}

.lvs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.lvs-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--emerald, #10b981);
}
.lvs-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: var(--text-dim, rgba(235, 235, 235, 0.6));
}
.lvs-progress-track {
  width: 84px;
  height: 4px;
  border-radius: 999px;
  background: var(--lvs-line);
  overflow: hidden;
}
.lvs-progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: var(--emerald, #10b981);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---- questions ---- */
.lvs-q {
  padding: 20px 0;
  border-top: 1px solid var(--lvs-line);
}
.lvs-qs .lvs-q:first-child { border-top: none; padding-top: 4px; }
.lvs-q-top {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}
.lvs-q-num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald, #10b981);
  min-width: 20px;
}
.lvs-q-text {
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text, #ebebeb);
}
.lvs-q-pillar {
  display: inline-block;
  margin-left: 6px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(235, 235, 235, 0.5);
  vertical-align: middle;
}

.lvs-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding-left: 32px;
}
.lvs-opt {
  appearance: none;
  text-align: left;
  cursor: pointer;
  background: var(--bg-surface, #0a0a0a);
  border: 1px solid var(--lvs-line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text-dim, rgba(235, 235, 235, 0.7));
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lvs-opt:hover { border-color: var(--lvs-line-strong); color: var(--text, #ebebeb); }
.lvs-opt-dot {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1.5px solid var(--text-muted, rgba(235, 235, 235, 0.35));
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.lvs-opt[aria-checked="true"] {
  border-color: var(--emerald, #10b981);
  background: var(--emerald-dim, rgba(16, 185, 129, 0.12));
  color: var(--text, #ebebeb);
}
.lvs-opt[aria-checked="true"] .lvs-opt-dot {
  border-color: var(--emerald, #10b981);
  background: var(--emerald, #10b981);
  box-shadow: inset 0 0 0 3px var(--bg-surface, #0a0a0a);
}
.lvs-opt:focus-visible {
  outline: 2px solid var(--emerald, #10b981);
  outline-offset: 2px;
}

/* ---- run button ---- */
.lvs-run-row {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.lvs-run {
  appearance: none;
  cursor: pointer;
  background: var(--emerald, #10b981);
  color: var(--bg, #050505);
  border: 1px solid var(--emerald, #10b981);
  border-radius: 999px;
  padding: 13px 30px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  transition: transform 0.2s, background 0.2s, opacity 0.2s;
}
.lvs-run:hover:not(:disabled) { background: #34d399; transform: translateY(-2px); }
.lvs-run:focus-visible { outline: 2px solid #34d399; outline-offset: 3px; }
.lvs-run:disabled { opacity: 0.4; cursor: not-allowed; }
.lvs-run-hint {
  font-size: 13px;
  color: rgba(235, 235, 235, 0.62);
}
.lvs-run-hint b { color: rgba(235, 235, 235, 0.85); font-weight: 600; }

/* ---- results ---- */
.lvs-results {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--lvs-line-strong);
  scroll-margin-top: 90px;
}
.lvs-results[hidden] { display: none; }

.lvs-score-row {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
}
.lvs-gauge {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  height: 168px;
}
.lvs-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lvs-gauge-track { fill: none; stroke: var(--lvs-line); stroke-width: 12; }
.lvs-gauge-arc {
  fill: none;
  stroke: var(--emerald, #10b981);
  stroke-width: 12;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.35));
}
.lvs-gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lvs-gauge-num {
  font-family: 'Newsreader', serif;
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: var(--text, #ebebeb);
}
.lvs-gauge-max { font-size: 12px; color: rgba(235, 235, 235, 0.55); margin-top: 3px; }

.lvs-verdict { flex: 1 1 240px; min-width: 220px; }
.lvs-grade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emerald, #10b981);
  padding: 5px 12px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  background: var(--emerald-dim, rgba(16, 185, 129, 0.12));
  margin-bottom: 14px;
}
.lvs-verdict-title {
  font-family: 'Newsreader', serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 8px;
  color: var(--text, #ebebeb);
}
.lvs-verdict-sub {
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim, rgba(235, 235, 235, 0.6));
}

/* ---- pillar bars ---- */
.lvs-pillars {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 26px;
}
.lvs-pillar-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.lvs-pillar-name { font-size: 12.5px; font-weight: 600; color: var(--text, #ebebeb); }
.lvs-pillar-pct {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  color: var(--text-dim, rgba(235, 235, 235, 0.6));
}
.lvs-pillar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--lvs-line);
  overflow: hidden;
}
.lvs-pillar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--emerald, #10b981);
  transition: width 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.lvs-pillar-fill.is-low { background: rgba(235, 235, 235, 0.28); }

/* ---- recommendations ---- */
.lvs-recs { margin-top: 30px; }
.lvs-recs-head {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim, rgba(235, 235, 235, 0.6));
  margin-bottom: 16px;
}
.lvs-rec {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--lvs-line);
}
.lvs-rec-list .lvs-rec:first-child { border-top: none; padding-top: 4px; }
.lvs-rec-impact {
  flex: 0 0 auto;
  align-self: flex-start;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 6px;
  margin-top: 2px;
}
.lvs-rec-impact.high { color: var(--emerald, #10b981); background: var(--emerald-dim, rgba(16, 185, 129, 0.14)); border: 1px solid rgba(16, 185, 129, 0.3); }
.lvs-rec-impact.med { color: rgba(235, 235, 235, 0.78); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--lvs-line-strong); }
.lvs-rec-impact.low { color: rgba(235, 235, 235, 0.62); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--lvs-line-strong); }
.lvs-rec-body { flex: 1 1 auto; }
.lvs-rec-title { font-size: 15px; font-weight: 600; color: var(--text, #ebebeb); margin-bottom: 5px; line-height: 1.4; }
.lvs-rec-why { font-size: 13.5px; line-height: 1.6; color: var(--text-dim, rgba(235, 235, 235, 0.6)); margin-bottom: 5px; }
.lvs-rec-do { font-size: 13.5px; line-height: 1.6; color: var(--text-dim, rgba(235, 235, 235, 0.6)); }
.lvs-rec-do b { color: var(--emerald, #10b981); font-weight: 600; }

.lvs-allclear {
  padding: 18px 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 14px;
  background: var(--emerald-dim, rgba(16, 185, 129, 0.1));
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text, #ebebeb);
}

/* ---- result footer: copy + cta ---- */
.lvs-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.lvs-copy {
  appearance: none;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--lvs-line-strong);
  border-radius: 999px;
  padding: 10px 20px;
  color: var(--text-dim, rgba(235, 235, 235, 0.7));
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  transition: border-color 0.2s, color 0.2s;
}
.lvs-copy:hover { border-color: var(--emerald, #10b981); color: var(--emerald, #10b981); }
.lvs-copy:focus-visible { outline: 2px solid var(--emerald, #10b981); outline-offset: 2px; }
.lvs-reset {
  appearance: none;
  cursor: pointer;
  background: none;
  border: none;
  color: rgba(235, 235, 235, 0.62);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lvs-reset:hover { color: var(--text, #ebebeb); }
.lvs-reset:focus-visible { outline: 2px solid var(--emerald, #10b981); outline-offset: 2px; border-radius: 4px; }

.lvs-cta {
  margin-top: 26px;
  padding: 26px;
  border-radius: var(--radius-lg, 24px);
  border: 1px solid rgba(16, 185, 129, 0.28);
  background: linear-gradient(160deg, var(--emerald-dim, rgba(16, 185, 129, 0.14)), rgba(16, 185, 129, 0.04));
}
.lvs-cta-eyebrow {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--emerald, #10b981);
  margin-bottom: 10px;
}
.lvs-cta h3 {
  font-family: 'Newsreader', serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
  color: var(--text, #ebebeb);
}
.lvs-cta p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dim, rgba(235, 235, 235, 0.65));
  margin-bottom: 20px;
  max-width: 560px;
}
.lvs-cta-btn {
  display: inline-block;
  background: var(--emerald, #10b981);
  color: var(--bg, #050505);
  border-radius: 999px;
  padding: 13px 30px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: transform 0.2s, background 0.2s;
}
.lvs-cta-btn:hover { background: #34d399; transform: translateY(-2px); }
.lvs-cta-btn:focus-visible { outline: 2px solid #34d399; outline-offset: 3px; }

.lvs-toast {
  margin-left: 4px;
  font-size: 12.5px;
  color: var(--emerald, #10b981);
  opacity: 0;
  transition: opacity 0.2s;
}
.lvs-toast.show { opacity: 1; }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .lvs-card { padding: 22px 18px 22px; }
  .lvs-options { padding-left: 0; }
  .lvs-pillars { grid-template-columns: 1fr; }
  .lvs-score-row { gap: 22px; }
  .lvs-gauge { width: 140px; height: 140px; }
  .lvs-gauge-num { font-size: 38px; }
}
/* stack the answer options in a single readable column on phones */
@media (max-width: 480px) {
  .lvs-options { grid-template-columns: 1fr; }
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .lvs-progress-fill,
  .lvs-gauge-arc,
  .lvs-pillar-fill,
  .lvs-run,
  .lvs-cta-btn,
  .lvs-copy,
  .lvs-toast,
  .lvs-opt-dot,
  .lvs-opt { transition: none; }
}
