/**
 * content-report.css — Modal styling for the platform-wide "Report" /
 * "Block" surfaces (L1-7). Palette borrows from the existing Emtrace
 * surfaces:
 *   - Bond:   warm parchment + teal seal
 *   - Spark:  charcoal + amber
 *   - Pulse:  cream + ink
 * The neutral palette below sits comfortably on every Trace's
 * background.
 *
 * a11y notes:
 *   - Focus ring visible on every interactive element.
 *   - Honors prefers-reduced-motion.
 *   - High-contrast borders + radio targets ≥ 44px.
 */

.cr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  animation: cr-fade-in 160ms ease-out;
}

@keyframes cr-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cr-modal-overlay { animation: none; }
}

.cr-modal-card {
  background: #f7f2e8;
  color: #1f1c17;
  border-radius: 18px;
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.cr-modal-card-small {
  max-width: 460px;
}

.cr-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  background: transparent;
  border: 1px solid transparent;
  color: #6b5e4d;
  font-size: 1.6rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.cr-close:hover,
.cr-close:focus-visible {
  background: rgba(31, 28, 23, 0.06);
  color: #1f1c17;
  border-color: rgba(31, 28, 23, 0.18);
  outline: none;
}

.cr-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-style: italic;
  font-weight: 600;
  margin: 0 0 0.6rem;
  color: #1f1c17;
  padding-right: 2.5rem; /* leave room for close button */
}

.cr-lead {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #44403c;
}
.cr-lead-muted {
  color: #7a7163;
  font-size: 0.85rem;
}

.cr-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 1rem;
}
.cr-legend {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7a7163;
  font-weight: 600;
  margin: 0 0 0.6rem;
  padding: 0;
}

.cr-categories {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 12px;
  padding: 0.35rem;
}

.cr-cat {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease;
  font-size: 0.92rem;
  color: #1f1c17;
}
.cr-cat:hover,
.cr-cat:focus-within {
  background: #f5f0e8;
}
.cr-cat input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: #0e6e7e; /* Bond teal */
  flex: 0 0 auto;
  cursor: pointer;
}
.cr-cat-label {
  flex: 1;
}

.cr-note-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7a7163;
  font-weight: 600;
  margin: 0 0 0.45rem;
}
.cr-note-hint {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #a8a29e;
  margin-left: 0.35rem;
  font-size: 0.78rem;
}

.cr-modal-card textarea {
  width: 100%;
  min-height: 96px;
  border-radius: 10px;
  border: 1px solid #d8d0bd;
  background: #fff;
  padding: 0.7rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: #1f1c17;
  resize: vertical;
  box-sizing: border-box;
}
.cr-modal-card textarea:focus {
  outline: 2px solid #0e6e7e;
  outline-offset: 1px;
  border-color: #0e6e7e;
}

.cr-note-counter {
  text-align: right;
  font-size: 0.78rem;
  color: #a8a29e;
  margin-top: 0.3rem;
}

.cr-actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.cr-actions-success { justify-content: center; }

.cr-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.cr-btn:focus-visible {
  outline: 2px solid #0e6e7e;
  outline-offset: 2px;
}
.cr-btn:active { transform: translateY(1px); }
.cr-btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.cr-btn-primary {
  background: linear-gradient(135deg, #0e6e7e, #053a44);
  color: #f7f2e8;
}
.cr-btn-primary:hover:not([disabled]) {
  background: linear-gradient(135deg, #0a5a68, #042b32);
}

.cr-btn-secondary {
  background: #fff;
  color: #1f1c17;
  border-color: #d8d0bd;
}
.cr-btn-secondary:hover:not([disabled]) {
  background: #f5f0e8;
  border-color: #b8ad95;
}

.cr-btn-tertiary {
  background: transparent;
  color: #0e6e7e;
  border-color: rgba(14, 110, 126, 0.35);
  padding: 0.45rem 0.85rem;
  min-height: 36px;
  font-size: 0.82rem;
}
.cr-btn-tertiary:hover:not([disabled]) {
  background: rgba(14, 110, 126, 0.08);
}

.cr-btn-danger {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  color: #fef2f2;
}
.cr-btn-danger:hover:not([disabled]) {
  background: linear-gradient(135deg, #991414, #651414);
}

.cr-legal {
  font-size: 0.75rem;
  color: #7a7163;
  margin: 0.8rem 0 0;
  line-height: 1.45;
}

/* ── Success panel ─────────────────────────────────────────── */
.cr-success {
  text-align: center;
  padding: 0.5rem 0.25rem;
}
.cr-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(14, 110, 126, 0.12);
  color: #0e6e7e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}
.cr-success h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: #1f1c17;
  margin: 0 0 0.45rem;
}
.cr-success-lead {
  color: #44403c;
  font-size: 0.95rem;
  margin: 0 0 1.1rem;
}
.cr-refbox {
  background: #fff;
  border: 1px solid #e0d8c8;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.cr-refbox-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7a7163;
  font-weight: 600;
}
.cr-refbox-num {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1f1c17;
  letter-spacing: 0.02em;
  word-break: break-all;
  text-align: center;
}

/* ── Settings page: Reports & Blocks list ──────────────────── */
.cr-reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cr-report-row {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(216, 208, 189, 0.65);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.cr-report-row-main {
  flex: 1 1 auto;
  min-width: 0;
}
.cr-report-row-ref {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1f1c17;
}
.cr-report-row-meta {
  font-size: 0.78rem;
  color: #7a7163;
  margin-top: 0.15rem;
}
.cr-status-pill {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}
.cr-status-pill[data-status="submitted"]    { background: #fef3c7; color: #92400e; }
.cr-status-pill[data-status="acknowledged"] { background: #dbeafe; color: #1e3a8a; }
.cr-status-pill[data-status="reviewing"]    { background: #ede9fe; color: #4c1d95; }
.cr-status-pill[data-status="resolved"]     { background: #d1fae5; color: #064e3b; }
.cr-status-pill[data-status="dismissed"]    { background: #f3f4f6; color: #374151; }
.cr-status-pill[data-status="escalated"]    { background: #fee2e2; color: #991b1b; }

.cr-reports-empty {
  font-size: 0.88rem;
  color: #7a7163;
  font-style: italic;
  padding: 0.3rem 0;
}

/* ── Compact "Report" affordance button used inside Trace cards ─ */
.cr-report-trigger {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(31, 28, 23, 0.12);
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
}
.cr-report-trigger:hover,
.cr-report-trigger:focus-visible {
  background: rgba(31, 28, 23, 0.06);
  outline: none;
  border-color: rgba(31, 28, 23, 0.32);
}

/* ── Dark-surface variant (Spark / Thread / Vault use dark UIs) ─ */
.cr-report-trigger.is-dark {
  border-color: rgba(232, 221, 208, 0.18);
  color: rgba(232, 221, 208, 0.85);
  background: rgba(232, 221, 208, 0.04);
}
.cr-report-trigger.is-dark:hover,
.cr-report-trigger.is-dark:focus-visible {
  background: rgba(232, 221, 208, 0.1);
  border-color: rgba(232, 221, 208, 0.32);
}

/* ── Small screens ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .cr-modal-card { padding: 1.1rem 1rem; border-radius: 16px; }
  .cr-actions { justify-content: stretch; }
  .cr-actions .cr-btn { flex: 1 1 100%; }
  .cr-title { font-size: 1.3rem; }
}
