/* =========================================================================
   GEO VISIBILITY SCORE — Studio Nine
   Extends brand-budget.css (same instrument-panel language). Adds the
   single-URL-input row, the five tier bars, the prioritised fix list,
   the loading screen, and the big score readout.
   ========================================================================= */

.s9-geo .s9-bbc__title { max-width: 18ch; }

.s9-geo__device-inner {
  position: relative;
  z-index: 1;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 2vw, 2rem);
}

/* ---------- INPUT ROW ---------- */
.s9-geo__field { gap: .65rem; }
.s9-geo__url-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
}
.s9-geo__url-row .s9-bbc__prefix { padding: 0 1.1rem; font-weight: 600; }
.s9-geo__url-row input {
  flex: 1; min-width: 0;
  padding: 1rem 1.1rem;
  border: 0;
  background: transparent;
  font-family: var(--bbc-mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--bbc-ink);
  outline: none;
}
.s9-geo__scan-btn {
  border-radius: 0;
  border-left: 1px solid var(--bbc-rule);
  padding-inline: 1.4rem;
  font-size: 13px;
  white-space: nowrap;
}
.s9-geo__scan-btn[disabled] {
  opacity: .55;
  cursor: progress;
}
@media (max-width: 640px) {
  .s9-geo__url-row { grid-template-columns: auto 1fr; }
  .s9-geo__scan-btn { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--bbc-rule); }
}

/* Error inline */
.s9-bbc__field-hint--small[hidden] { display: none; }
#geo-error {
  color: #a82a1f;
  margin-top: .35rem;
}

/* ---------- IDLE ---------- */
.s9-geo__idle {
  text-align: center;
  padding: clamp(2.25rem, 4vw, 3.25rem) 1rem;
  background: #0a0a0a;
  color: var(--bbc-screen-ink);
  border: 1px solid #000;
  border-radius: var(--bbc-radius);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 0 0 1px rgba(212,255,63,0.06);
  position: relative;
  overflow: hidden;
}
.s9-geo__idle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,0.02) 3px 4px);
  pointer-events: none;
}
.s9-geo__idle-eyebrow {
  margin: 0 0 .5rem;
  font-family: var(--bbc-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  opacity: .55;
}
.s9-geo__idle-msg {
  margin: 0;
  font-family: var(--bbc-mono);
  font-size: 14px;
  letter-spacing: 0.02em;
  opacity: .85;
}

/* ---------- LOADING ---------- */
.s9-geo__loading {
  padding: clamp(1.5rem, 3vw, 2.25rem);
  background: #0a0a0a;
  color: var(--bbc-screen-ink);
  border: 1px solid #000;
  border-radius: var(--bbc-radius);
  position: relative;
  overflow: hidden;
}
.s9-geo__loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,0.02) 3px 4px);
  pointer-events: none;
}
.s9-geo__loading-lcd {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  font-family: var(--bbc-mono);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  text-shadow: 0 0 14px rgba(212,255,63,0.4);
  margin-bottom: 1rem;
}
.s9-geo__loading-spin {
  display: inline-block;
  font-size: 1.2em;
  animation: geo-spin 900ms linear infinite;
}
@keyframes geo-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.s9-geo__loading-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  font-family: var(--bbc-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.s9-geo__loading-steps li::before {
  content: "[ ]  ";
  font-weight: 600;
  opacity: .5;
}
.s9-geo__loading-steps li.is-done::before { content: "[✓]  "; color: var(--bbc-screen-ink); opacity: 1; }
.s9-geo__loading-steps li.is-active::before { content: "[ ⋯ ]  "; color: var(--bbc-accent); opacity: 1; }
.s9-geo__loading-steps li.is-done, .s9-geo__loading-steps li.is-active { opacity: 1; }

/* ---------- RESULT ---------- */
.s9-geo__result { display: flex; flex-direction: column; gap: 1.25rem; }

.s9-geo__score-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.25rem 1.25rem 1rem;
  background: #0a0a0a;
  color: var(--bbc-screen-ink);
  border: 1px solid #000;
  border-radius: var(--bbc-radius);
  position: relative;
  overflow: hidden;
}
.s9-geo__score-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,0.02) 3px 4px);
  pointer-events: none;
}
.s9-geo__url {
  font-family: var(--bbc-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  word-break: break-all;
  opacity: .85;
  text-shadow: 0 0 8px rgba(212,255,63,0.3);
  position: relative; z-index: 1;
}
.s9-geo__total-wrap { text-align: right; position: relative; z-index: 1; }
.s9-geo__total-label {
  display: block;
  font-family: var(--bbc-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  opacity: .55;
  margin-bottom: .25rem;
}
.s9-geo__total {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  font-family: var(--bbc-mono);
  font-weight: 600;
  text-shadow: 0 0 22px rgba(212,255,63,0.5);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.s9-geo__total-num { font-size: clamp(3rem, 8vw, 5rem); }
.s9-geo__total-out { font-size: 1.1rem; opacity: .55; letter-spacing: 0.06em; }
.s9-geo__total-verdict {
  display: block;
  margin-top: .5rem;
  font-family: var(--bbc-mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: rgba(212,255,63,0.12);
  border: 1px solid rgba(212,255,63,0.35);
  padding: 4px 10px;
  border-radius: 3px;
}
.s9-geo__total-verdict.is-low    { background: rgba(255, 90, 31, 0.15); border-color: rgba(255, 90, 31, 0.5); color: #ffb89a; }
.s9-geo__total-verdict.is-mid    { background: rgba(244, 200, 80, 0.12); border-color: rgba(244, 200, 80, 0.4); color: #f4c850; }
.s9-geo__total-verdict.is-high   { background: rgba(212, 255, 63, 0.16); border-color: rgba(212, 255, 63, 0.55); color: var(--bbc-screen-ink); }
@media (max-width: 540px) {
  .s9-geo__score-head { grid-template-columns: 1fr; }
  .s9-geo__total-wrap { text-align: left; }
}

/* ---------- TIER BARS ---------- */
.s9-geo__tiers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.s9-geo__tier {
  padding: .85rem 1rem;
  background: #fff;
  border: 1px solid var(--bbc-rule-strong);
  border-radius: var(--bbc-radius);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}
.s9-geo__tier-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .65rem;
  margin-bottom: .5rem;
}
.s9-geo__tier-name {
  font-family: var(--s9-font-display);
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}
.s9-geo__tier-num {
  font-family: var(--bbc-mono);
  font-size: 12px;
  color: var(--bbc-mute);
  font-variant-numeric: tabular-nums;
}
.s9-geo__tier-num span { color: var(--bbc-ink); font-weight: 600; }
.s9-geo__tier-bar {
  position: relative;
  height: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: .5rem;
}
.s9-geo__tier-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--bbc-accent-2);
  transition: width 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
  border-radius: 999px;
}
.s9-geo__tier-fill.is-low  { background: var(--bbc-accent); }
.s9-geo__tier-fill.is-mid  { background: #f4c850; }
.s9-geo__tier-fill.is-high { background: var(--bbc-accent-2); }
.s9-geo__tier-sub {
  margin: 0;
  font-family: var(--bbc-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--bbc-mute);
  line-height: 1.45;
}

/* ---------- FIXES ---------- */
.s9-geo__fixes {
  background: rgba(0,0,0,0.025);
  border: 1px dashed var(--bbc-rule-strong);
  border-radius: var(--bbc-radius);
  padding: 1rem 1.1rem;
}
.s9-geo__fixes-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: .85rem;
}
.s9-geo__fixes-eyebrow {
  margin: 0;
  font-family: var(--bbc-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bbc-mute);
}
.s9-geo__fixes-meta {
  margin: 0;
  font-family: var(--bbc-mono);
  font-size: 11px;
  color: var(--bbc-ink);
}
.s9-geo__fixes-meta span { font-weight: 600; }

.s9-geo__fix-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  counter-reset: fix;
}
.s9-geo__fix-list li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: start;
  padding: .7rem .85rem;
  background: #fff;
  border: 1px solid var(--bbc-rule);
  border-radius: 3px;
  border-left: 3px solid var(--bbc-mute);
}
.s9-geo__fix-list li.is-high { border-left-color: var(--bbc-accent); }
.s9-geo__fix-list li.is-med  { border-left-color: #f4c850; }
.s9-geo__fix-list li.is-low  { border-left-color: var(--bbc-rule-strong); }
.s9-geo__fix-list li::before {
  content: counter(fix, decimal-leading-zero);
  counter-increment: fix;
  font-family: var(--bbc-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--bbc-mute);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}
.s9-geo__fix-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--bbc-ink);
}
.s9-geo__fix-tier {
  font-family: var(--bbc-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bbc-mute);
  background: rgba(0,0,0,0.04);
  padding: 3px 7px;
  border-radius: 3px;
  white-space: nowrap;
}
.s9-geo__fixes-empty {
  font-family: var(--bbc-mono);
  font-size: 13px;
  color: var(--bbc-mute);
  margin: 0;
  text-align: center;
  padding: 1rem;
}

/* ---------- SIGNALS PANEL ---------- */
.s9-geo__signals { font-family: var(--bbc-mono); margin-top: .25rem; }
.s9-geo__signals[open] summary::before { content: "[−] "; }
.s9-geo__signals dl {
  display: grid;
  grid-template-columns: minmax(160px, max-content) 1fr;
  gap: .35rem .85rem;
  margin: .75rem 0 0;
  font-family: var(--bbc-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--bbc-ink);
}
.s9-geo__signals dt { color: var(--bbc-mute); letter-spacing: 0.02em; }
.s9-geo__signals dd { margin: 0; word-break: break-word; }
.s9-geo__signals .is-ok::before  { content: "✓ "; color: #1f6b3a; }
.s9-geo__signals .is-bad::before { content: "✗ "; color: #a82a1f; }
