:root {
  --brand: #22a9f8;
  --brand-deep: #01017c;
  --ink: #1a1a1a;
  --muted: #5b6b7c;
  --line: #dbe4ee;
  --surface: #ffffff;
  --bg: #fafcfe;
  --soft: #f0f4f8;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 96px;
}

.rx-lead {
  margin: 0 0 20px;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.95rem;
}

.rx-lead strong {
  color: var(--brand-deep);
}

/* ---- Contexto: olho + retina explodida ---- */
.rx-context {
  margin: 0 0 28px;
}

.rx-context img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius);
  background: #101318;
}

.rx-context figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

/* ---- Grade principal ---- */
.rx {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 250px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.rx > * {
  min-width: 0;
}

/* ---- Arte com as zonas ---- */
.rx-art {
  margin: 0;
  position: sticky;
  top: 16px;
}

.rx-art-frame {
  position: relative;
  line-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
}

.rx-art-frame img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 220ms ease;
}

.rx.is-active .rx-art-frame img {
  filter: saturate(0.55) brightness(0.92);
}

.rx-zones {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rx-zone {
  fill: rgba(2, 12, 30, 0);
  stroke: transparent;
  stroke-width: 2;
  cursor: pointer;
  transition: fill 200ms ease;
  vector-effect: non-scaling-stroke;
}

.rx.is-active .rx-zone {
  fill: rgba(2, 12, 30, 0.42);
}

.rx.is-active .rx-zone.is-on {
  fill: rgba(34, 169, 248, 0.1);
  stroke: var(--brand);
  filter: drop-shadow(0 0 6px rgba(34, 169, 248, 0.65));
}

.rx-edge {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: center;
}

.rx-edge-top {
  margin-bottom: 6px;
}

.rx-edge-bottom {
  margin-top: 6px;
}

/* ---- Lista de camadas ---- */
.rx-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.rx-item button {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease;
}

.rx-item button:hover {
  background: var(--soft);
}

.rx-item button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.rx-item button[aria-pressed="true"] {
  background: rgba(34, 169, 248, 0.1);
  border-color: var(--brand);
}

.rx-sigla {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--brand-deep);
  opacity: 0.75;
}

.rx-nome {
  font-size: 0.86rem;
  line-height: 1.3;
}

/* ---- Painel ---- */
.rx-panel-col {
  position: sticky;
  top: 16px;
}

.rx-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 20px;
  min-height: 260px;
}

.rx-hint {
  color: var(--muted);
  font-size: 0.92rem;
}

.rx-hint strong {
  color: var(--brand-deep);
}

.rx-card-sigla {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(34, 169, 248, 0.12);
  color: var(--brand-deep);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rx-card h2 {
  margin: 10px 0 14px;
  font-size: 1.18rem;
  color: var(--brand-deep);
  line-height: 1.25;
}

.rx-card dl {
  margin: 0;
}

.rx-card dt {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.rx-card dd {
  margin: 0 0 14px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.rx-card .rx-problema {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--soft);
  border-left: 3px solid var(--brand);
}

.rx-card .rx-problema dt {
  color: var(--brand-deep);
}

.rx-card .rx-problema dd {
  margin-bottom: 8px;
}

.rx-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brand-deep);
  text-decoration: none;
  border-bottom: 1px solid rgba(1, 1, 124, 0.28);
}

.rx-link:hover,
.rx-link:focus-visible {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---- Referências ---- */
.references {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.references h3 {
  color: var(--brand-deep);
  font-size: 0.86rem;
  margin: 14px 0 6px;
}

.references ol {
  margin: 0;
  padding-left: 18px;
}

.references li {
  margin-bottom: 5px;
}

.disclaimer {
  margin-top: 12px;
  font-style: italic;
}

/* ---- Mobile ---- */
@media (max-width: 860px) {
  .rx {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .rx-art,
  .rx-panel-col {
    position: static;
  }

  .rx-art-frame {
    max-width: 340px;
    margin: 0 auto;
  }

  .rx-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rx-item button {
    grid-template-columns: minmax(0, 1fr);
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--surface);
    padding: 8px 10px;
  }

  .rx-nome {
    font-size: 0.78rem;
  }

  .rx-panel {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
