/* Carbontria Platform — custom styles on top of Tailwind */

:root {
  --c-deep:    #0B3D2E;
  --c-ever:    #145A3A;
  --c-grow:    #4CAF50;
  --c-light:   #8BCF7A;
  --c-ink:     #2B2B2B;
  --c-mist:    #E8ECEA;
}

html, body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Smooth scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Map container */
.map-container { height: 480px; width: 100%; border-radius: 0.5rem; overflow: hidden; }
.map-container.tall { height: 640px; }

/* Leaflet attribution restyle */
.leaflet-container { font-family: inherit; }

/* Table styles */
.cmrv-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.cmrv-table thead th {
  text-align: left;
  font-weight: 600;
  color: #475569;
  background: #F7F8F7;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--c-mist);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cmrv-table tbody td {
  padding: 0.75rem;
  border-bottom: 1px solid #F1F4F2;
  color: var(--c-ink);
}
.cmrv-table tbody tr:hover { background: #F7F8F7; }
.cmrv-table tbody tr:last-child td { border-bottom: none; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1rem; height: 1rem;
  border: 2px solid var(--c-mist);
  border-top-color: var(--c-ever);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Markdown rendered output (for AI doc previews) */
.prose-mrv h1 { font-size: 1.5rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; color: var(--c-deep); }
.prose-mrv h2 { font-size: 1.25rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; color: var(--c-deep); }
.prose-mrv h3 { font-size: 1.1rem;  font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; color: var(--c-ever); }
.prose-mrv p  { margin-bottom: 0.75rem; line-height: 1.65; color: #334155; }
.prose-mrv ul { list-style: disc; margin-left: 1.25rem; margin-bottom: 0.75rem; }
.prose-mrv ol { list-style: decimal; margin-left: 1.25rem; margin-bottom: 0.75rem; }
.prose-mrv li { margin-bottom: 0.25rem; }
.prose-mrv code {
  background: var(--c-mist);
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, monospace;
  font-size: 0.85em;
}
.prose-mrv blockquote {
  border-left: 3px solid var(--c-ever);
  padding-left: 0.875rem;
  color: #475569;
  font-style: italic;
}

/* Toast */
.cmrv-toast {
  position: fixed; bottom: 1.25rem; right: 1.25rem;
  background: var(--c-ink); color: #fff;
  padding: 0.75rem 1rem; border-radius: 0.5rem;
  box-shadow: 0 10px 25px -10px rgba(11, 61, 46, 0.4);
  font-size: 0.875rem;
  z-index: 100;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.cmrv-toast.show { opacity: 1; transform: translateY(0); }
.cmrv-toast.success { background: var(--c-ever); }
.cmrv-toast.error { background: #b91c1c; }

/* Compact stat tile */
.stat-tile { background:#fff; border:1px solid var(--c-mist); padding:1rem; border-radius:0.5rem; }

/* PWA install hint */
@media (display-mode: standalone) {
  .pwa-only { display: block; }
}

/* In-platform help popover */
.cmrv-help { display: inline-block; }
.cmrv-help-popover {
  visibility: hidden;
  opacity: 0;
}
.cmrv-help:hover .cmrv-help-popover,
.cmrv-help:focus-within .cmrv-help-popover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.cmrv-help-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px; height: 10px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  border-left: 1px solid #e2e8f0;
}

/* Checklist styles */
.cmrv-checklist-row { transition: background 0.15s; }
.cmrv-checklist-row:hover { background: #f8fafc; }
.cmrv-checklist-progress {
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.cmrv-checklist-progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #15803d);
  transition: width 0.4s ease;
}
