/* Page publique « Comparaison prévisions / observations REFMAR ».
   Classes volontairement préfixées (refmar- / rm-) : fichier 100 % additif,
   ne modifie aucune règle de styles.css. */

.refmar-shell {
  margin-top: 20px;
}

.refmar-controls {
  display: grid;
  gap: 14px;
}

.refmar-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 720px) {
  .refmar-grid {
    grid-template-columns: 1fr;
  }
}

.refmar-grid label {
  font-weight: 700;
}

.refmar-distance {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.refmar-distance strong {
  color: var(--accent-strong);
}

.refmar-distance.is-warning {
  margin: 0;
  padding: 12px 14px;
  border: 2px solid rgba(220, 38, 38, 0.45);
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.5;
}

.refmar-distance.is-warning strong {
  color: #7f1d1d;
}

/* Encadré « mode démo », affiché pour les visiteurs non connectés. */
.refmar-demo-note {
  margin: 0;
  padding: 10px 14px;
  border: 2px solid rgba(8, 79, 87, 0.18);
  border-radius: 10px;
  background: rgba(10, 108, 116, 0.06);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.refmar-status {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.refmar-status-idle {
  border: 2px solid rgba(16, 24, 32, 0.14);
  background: rgba(16, 24, 32, 0.05);
  color: var(--muted);
}

.refmar-status-loading {
  border: 2px solid rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.1);
  color: #1e3a8a;
}

.refmar-status-error {
  border: 2px solid rgba(220, 38, 38, 0.4);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.refmar-status-ok {
  border: 2px solid rgba(22, 163, 74, 0.4);
  background: rgba(22, 163, 74, 0.08);
  color: #14532d;
}

/* Panneau du graphique : même ambiance sombre que .chart-panel du site. */
.refmar-chart-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 10px;
  border: 2px solid rgba(17, 17, 17, 0.55);
  border-radius: 8px;
  background: #0f172a;
}

.rm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 2px 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.rm-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.rm-legend-swatch {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.rm-legend-item.is-observation {
  color: #fbbf24;
}

.rm-legend-item.is-prediction {
  color: #60a5fa;
}

.rm-chart {
  min-height: 260px;
}

.rm-chart-empty {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.5;
}

.rm-chart-svg {
  display: block;
  width: 100%;
  height: auto;
}

.rm-chart-svg .rm-bg {
  fill: #0f172a;
}

.rm-chart-svg .rm-grid {
  stroke: rgba(148, 163, 184, 0.22);
  stroke-width: 1;
}

.rm-chart-svg .rm-axis {
  fill: #94a3b8;
  font-size: 11px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.rm-chart-svg .rm-line-observation {
  fill: none;
  stroke: #fbbf24;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rm-chart-svg .rm-line-prediction {
  fill: none;
  stroke: #60a5fa;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rm-chart-svg .rm-area-prediction {
  fill: rgba(96, 165, 250, 0.16);
}

.rm-chart-svg .rm-dot-observation {
  fill: #fde68a;
  stroke: #fbbf24;
  stroke-width: 1;
}

.rm-chart-svg .rm-dot-prediction {
  fill: #bfdbfe;
  stroke: #60a5fa;
  stroke-width: 1;
}

.rm-chart-svg .rm-title {
  fill: #cbd5e1;
  font-size: 11px;
  font-weight: 700;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Indicateurs chiffrés. */
.rm-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rm-metric {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 24, 32, 0.1);
  border-radius: 12px;
  background: rgba(10, 108, 116, 0.05);
}

.rm-metric-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rm-metric-value {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.rm-metric-value.is-positive {
  color: #b45309;
}

.rm-metric-value.is-negative {
  color: #1d4ed8;
}

.rm-metric-sub {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.rm-note {
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 2px solid rgba(8, 79, 87, 0.18);
  border-radius: 10px;
  background: rgba(10, 108, 116, 0.06);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.rm-tech {
  margin: 4px 0 0;
  border: 1px solid rgba(16, 24, 32, 0.14);
  border-radius: 10px;
  background: rgba(16, 24, 32, 0.03);
  padding: 10px 14px;
}

.rm-tech summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent-strong);
}

.rm-tech-body {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.rm-tech-row {
  display: grid;
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  gap: 8px 14px;
}

.rm-tech-row strong {
  color: var(--muted);
}

.rm-tech-row .rm-mono {
  overflow-wrap: anywhere;
  word-break: break-all;
}

.rm-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(10, 108, 116, 0.12);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 800;
}

.rm-link {
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.rm-link:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

@media (max-width: 640px) {
  .rm-tech-row {
    grid-template-columns: 1fr;
  }
}
