/* ==========================================================================
   Toolsyte - Red Flag or Green Flag Test Stylesheet (V3 Content & Polish)
   ALL rules in this file are strictly scoped beneath .rgf-tool
   ========================================================================== */

/* Shell & Workspace Container */
.rgf-tool {
  display: block;
  width: 100%;
  max-width: 860px;
  margin: 18px auto 56px;
  color: #0f172a;
  box-sizing: border-box;
}

.rgf-tool *,
.rgf-tool *::before,
.rgf-tool *::after {
  box-sizing: inherit;
}

.rgf-tool [hidden] {
  display: none !important;
}

.rgf-tool .rgf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Breadcrumbs (Left-aligned, secondary, comfortable spacing) */
.rgf-tool .rgf-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #64748b;
  margin: 0 0 24px;
  line-height: 1.5;
  text-align: left;
}

.rgf-tool .rgf-top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.rgf-tool .rgf-top-nav .rgf-breadcrumbs {
  margin: 0;
}

.rgf-tool .rgf-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 650;
  color: #2563eb;
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
}

.rgf-tool .rgf-back-link:hover {
  color: #1d4ed8;
  background-color: #eef5ff;
  border-color: rgba(37, 99, 235, 0.25);
  text-decoration: none;
}

.rgf-tool .rgf-breadcrumbs a {
  color: #475569;
  text-decoration: none;
  transition: color 150ms ease;
}

.rgf-tool .rgf-breadcrumbs a:hover {
  color: #2563eb;
  text-decoration: underline;
}

.rgf-tool .rgf-breadcrumbs .rgf-bc-sep {
  color: #cbd5e1;
  font-size: 0.82rem;
  user-select: none;
}

.rgf-tool .rgf-breadcrumbs .rgf-bc-current {
  color: #334155;
  font-weight: 600;
}

/* Header & Intro Section */
.rgf-tool .rgf-card-head {
  margin-bottom: 24px;
  text-align: center;
}

.rgf-tool .rgf-test-head {
  margin-bottom: 20px;
}

.rgf-tool .rgf-card-head .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2563eb;
  background: #eef5ff;
  padding: 4px 12px;
  border-radius: 999px;
  margin: 0 0 10px;
}

.rgf-tool .rgf-card-title {
  margin: 0 0 10px;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  font-weight: 850;
  color: #0f172a;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.rgf-tool .rgf-card-subtitle {
  max-width: 640px;
  margin: 0 auto;
  font-size: 1rem;
  color: #475569;
  line-height: 1.6;
}

/* Subtle Intro Flag Scale */
.rgf-tool .rgf-intro-scale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 750;
  color: #334155;
}

.rgf-tool .rgf-scale-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rgf-tool .rgf-scale-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.rgf-tool .rgf-scale-red .rgf-scale-dot { background: #ef4444; }
.rgf-tool .rgf-scale-gold .rgf-scale-dot { background: #f59e0b; }
.rgf-tool .rgf-scale-green .rgf-scale-dot { background: #10b981; }

.rgf-tool .rgf-scale-divider {
  color: #cbd5e1;
  font-size: 0.75rem;
}

/* Base Card Shell */
.rgf-tool .rgf-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 14px;
  padding: 30px 28px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  margin-bottom: 24px;
}

/* ==========================================================================
   VIEW 1: Context Selector
   ========================================================================== */
.rgf-tool .rgf-context-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 22px;
}

.rgf-tool .rgf-context-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
  width: 100%;
}

.rgf-tool .rgf-context-card:hover {
  transform: translateY(-2px);
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.09);
  background: #fbfdff;
}

.rgf-tool .rgf-context-card.is-selected {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.rgf-tool .rgf-context-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

.rgf-tool .rgf-context-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #eef5ff;
  color: #2563eb;
}

.rgf-tool .rgf-context-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgf-tool .rgf-context-info {
  flex: 1 1 auto;
  min-width: 0;
}

.rgf-tool .rgf-context-info strong {
  display: block;
  font-size: 1.04rem;
  font-weight: 850;
  color: #0f172a;
  margin-bottom: 3px;
  line-height: 1.25;
}

.rgf-tool .rgf-context-info span {
  display: block;
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.4;
}

.rgf-tool .rgf-context-arrow {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  color: #94a3b8;
  transition: transform 160ms ease, color 160ms ease;
}

.rgf-tool .rgf-context-arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgf-tool .rgf-context-card:hover .rgf-context-arrow {
  color: #2563eb;
  transform: translateX(3px);
}

/* Privacy Message */
.rgf-tool .rgf-privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
  padding: 12px 18px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 10px;
  font-size: 0.88rem;
  color: #475569;
  text-align: center;
  line-height: 1.5;
}

.rgf-tool .rgf-privacy-note svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: #2563eb;
  stroke-width: 2;
}

/* ==========================================================================
   VIEW 2: Assessment Questions (Compact & Scan-friendly)
   ========================================================================== */
.rgf-tool #rgf-assessment-view {
  padding: 24px 26px 22px;
}

.rgf-tool .rgf-progress-wrap {
  margin-bottom: 16px;
}

.rgf-tool .rgf-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.rgf-tool .rgf-meta-dim {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1e40af;
  background: #eef5ff;
  padding: 3px 9px;
  border-radius: 999px;
}

.rgf-tool .rgf-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.rgf-tool .rgf-meta-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: #64748b;
}

.rgf-tool .rgf-exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease;
  line-height: 1;
}

.rgf-tool .rgf-exit-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-exit-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
}

.rgf-tool .rgf-progress-track {
  width: 100%;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.rgf-tool .rgf-progress-fill {
  height: 100%;
  background: #2563eb;
  border-radius: 999px;
  width: 0%;
  transition: width 240ms ease;
}

.rgf-tool .rgf-question-shell {
  margin-top: 12px;
}

.rgf-tool .rgf-question-text {
  margin: 0 0 16px;
  font-size: clamp(1.18rem, 2vw, 1.42rem);
  font-weight: 850;
  color: #0f172a;
  line-height: 1.32;
  letter-spacing: -0.01em;
}

/* Answer Option Tiles */
.rgf-tool .rgf-answer-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.rgf-tool .rgf-answer-option {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.rgf-tool .rgf-answer-option:hover {
  border-color: rgba(37, 99, 235, 0.5);
  background: #f8fbff;
}

.rgf-tool .rgf-answer-option.is-selected {
  border-color: #2563eb;
  background: #f0f7ff;
  box-shadow: 0 0 0 1px #2563eb;
}

.rgf-tool .rgf-radio-input {
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
  margin: 0;
  flex-shrink: 0;
}

.rgf-tool .rgf-answer-label {
  font-size: 0.98rem;
  font-weight: 750;
  color: #1e293b;
  line-height: 1.32;
}

.rgf-tool .rgf-answer-option.is-selected .rgf-answer-label {
  font-weight: 850;
  color: #1d4ed8;
}

/* Navigation Actions */
.rgf-tool .rgf-nav-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 22px;
  border-radius: 9px;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  white-space: nowrap;
}

.rgf-tool .rgf-btn-primary {
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #2563eb;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.rgf-tool .rgf-btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.rgf-tool .rgf-btn-secondary {
  background: #ffffff;
  color: #475569;
  border: 1px solid rgba(15, 23, 42, 0.15);
}

.rgf-tool .rgf-btn-secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* Exit Confirmation Dialog Modal */
.rgf-tool .rgf-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  box-sizing: border-box;
}

.rgf-tool .rgf-dialog-card {
  box-sizing: border-box;
  width: 100%;
  max-width: 420px;
  padding: 24px 22px 20px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.22);
  text-align: center;
  animation: rgfDialogPop 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes rgfDialogPop {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.rgf-tool .rgf-dialog-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.25;
}

.rgf-tool .rgf-dialog-text {
  margin: 0 0 20px;
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.55;
}

.rgf-tool .rgf-dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rgf-tool .rgf-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.rgf-tool .rgf-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* ==========================================================================
   VIEW 3: Result Experience
   ========================================================================== */
.rgf-tool .rgf-score-hero {
  text-align: center;
  padding: 28px 24px 24px;
  border-top: 4px solid #2563eb;
}

.rgf-tool .rgf-score-kicker {
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 0 0 8px;
}

.rgf-tool .rgf-score-value {
  font-size: clamp(2.8rem, 6vw, 4.2rem);
  font-weight: 950;
  line-height: 1;
  color: #0f172a;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.rgf-tool .rgf-badge-wrap {
  margin-bottom: 16px;
}

.rgf-tool .rgf-score-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.rgf-tool .rgf-badge-green {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(5, 150, 105, 0.25);
}

.rgf-tool .rgf-badge-gold {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.rgf-tool .rgf-badge-rose {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid rgba(220, 38, 38, 0.25);
}

/* Horizontal Score Spectrum Track */
.rgf-tool .rgf-spectrum-wrap {
  width: 100%;
  max-width: 500px;
  margin: 0 auto 18px;
}

.rgf-tool .rgf-spectrum-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: visible;
  background: #e2e8f0;
}

.rgf-tool .rgf-spectrum-seg {
  height: 100%;
}

/* Five-band segments: 0–24 (25%), 25–44 (20%), 45–64 (20%), 65–79 (15%), 80–100 (20%) */
.rgf-tool .rgf-seg-serious-red {
  width: 25%;
  background: #dc2626;
  border-radius: 999px 0 0 999px;
}

.rgf-tool .rgf-seg-multiple-red {
  width: 20%;
  background: #f87171;
}

.rgf-tool .rgf-seg-mixed {
  width: 20%;
  background: #f59e0b;
}

.rgf-tool .rgf-seg-mostly-green {
  width: 15%;
  background: #34d399;
}

.rgf-tool .rgf-seg-strong-green {
  width: 20%;
  background: #059669;
  border-radius: 0 999px 999px 0;
}

.rgf-tool .rgf-spectrum-pin {
  position: absolute;
  top: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #0f172a;
  border: 3px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transform: translateX(-50%);
  transition: left 400ms ease;
}

/* 5-band spectrum labels */
.rgf-tool .rgf-spectrum-labels {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-top: 8px;
  width: 100%;
}

.rgf-tool .rgf-spec-lbl {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  max-width: 20%;
}

/* Long label: visible on ≥480px, hidden on narrow */
.rgf-tool .rgf-spec-lbl-long { display: block; }
.rgf-tool .rgf-spec-lbl-short { display: none; }

.rgf-tool .rgf-spec-lbl-serious-red { color: #b91c1c; }
.rgf-tool .rgf-spec-lbl-multiple-red { color: #dc2626; }
.rgf-tool .rgf-spec-lbl-mixed { color: #d97706; }
.rgf-tool .rgf-spec-lbl-mostly-green { color: #059669; }
.rgf-tool .rgf-spec-lbl-strong-green { color: #047857; }

.rgf-tool .rgf-score-narrative {
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.02rem;
  color: #334155;
  line-height: 1.65;
}

/* Flag Tallies */
.rgf-tool .rgf-flag-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.rgf-tool .rgf-flag-box {
  padding: 18px 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid transparent;
}

.rgf-tool .rgf-flag-box-green {
  background: #f0fdf4;
  border-color: rgba(5, 150, 105, 0.22);
}

.rgf-tool .rgf-flag-box-gold {
  background: #fffbeb;
  border-color: rgba(217, 119, 6, 0.22);
}

.rgf-tool .rgf-flag-box-rose {
  background: #fef2f2;
  border-color: rgba(220, 38, 38, 0.22);
}

.rgf-tool .rgf-flag-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.rgf-tool .rgf-flag-icon {
  font-size: 1.3rem;
  font-weight: 900;
  line-height: 1;
}

.rgf-tool .rgf-flag-num {
  font-size: 1.95rem;
  font-weight: 950;
  line-height: 1;
}

.rgf-tool .rgf-flag-box-green .rgf-flag-icon,
.rgf-tool .rgf-flag-box-green .rgf-flag-num { color: #047857; }

.rgf-tool .rgf-flag-box-gold .rgf-flag-icon,
.rgf-tool .rgf-flag-box-gold .rgf-flag-num { color: #b45309; }

.rgf-tool .rgf-flag-box-rose .rgf-flag-icon,
.rgf-tool .rgf-flag-box-rose .rgf-flag-num { color: #b91c1c; }

.rgf-tool .rgf-flag-lbl {
  display: block;
  font-size: 0.84rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 6px;
  color: #475569;
}

/* Critical Warning Box */
.rgf-tool .rgf-critical-box {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 10px;
  background: #fff8f8;
  border-left: 4px solid #dc2626;
  border-top: 1px solid rgba(220, 38, 38, 0.16);
  border-right: 1px solid rgba(220, 38, 38, 0.16);
  border-bottom: 1px solid rgba(220, 38, 38, 0.16);
  margin-bottom: 24px;
  color: #991b1b;
}

.rgf-tool .rgf-critical-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  color: #dc2626;
}

.rgf-tool .rgf-critical-content strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 850;
  margin-bottom: 4px;
  color: #991b1b;
}

.rgf-tool .rgf-critical-content p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #7f1d1d;
}

/* Dimension Breakdown Grid */
.rgf-tool .rgf-dimension-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.rgf-tool .rgf-dimension-card {
  padding: 16px 18px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-dim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rgf-tool .rgf-dim-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
}

.rgf-tool .rgf-dim-score {
  font-size: 0.92rem;
  font-weight: 900;
  color: #0f172a;
}

.rgf-tool .rgf-dim-bar-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.rgf-tool .rgf-dim-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 350ms ease;
}

.rgf-tool .rgf-bar-green { background: #059669; }
.rgf-tool .rgf-bar-mostly-green { background: #10b981; }
.rgf-tool .rgf-bar-gold { background: #d97706; }
.rgf-tool .rgf-bar-rose { background: #dc2626; }

/* Insights List */
.rgf-tool .rgf-insights-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.rgf-tool .rgf-insight-card {
  padding: 18px 20px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 4px solid #2563eb;
}

.rgf-tool .rgf-insight-card.rgf-insight-green { border-left-color: #059669; }
.rgf-tool .rgf-insight-card.rgf-insight-gold { border-left-color: #d97706; }
.rgf-tool .rgf-insight-card.rgf-insight-blue { border-left-color: #2563eb; }

.rgf-tool .rgf-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.rgf-tool .rgf-insight-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.96rem;
  font-weight: 850;
  color: #0f172a;
}

.rgf-tool .rgf-insight-bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.rgf-tool .rgf-insight-green .rgf-insight-bullet { background: #059669; }
.rgf-tool .rgf-insight-gold .rgf-insight-bullet { background: #d97706; }
.rgf-tool .rgf-insight-blue .rgf-insight-bullet { background: #2563eb; }

.rgf-tool .rgf-insight-score {
  font-size: 0.88rem;
  font-weight: 850;
  color: #64748b;
}

.rgf-tool .rgf-insight-card p {
  margin: 0;
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.6;
}

/* Result Actions */
.rgf-tool .rgf-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.rgf-tool .rgf-share-feedback {
  width: 100%;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 800;
  color: #059669;
  min-height: 20px;
  margin-top: 6px;
}

/* ==========================================================================
   Below-Tool Educational Content (Editorial Formatting)
   ========================================================================== */
.rgf-tool .rgf-editorial-section {
  max-width: 820px;
  margin: 52px auto 0;
  padding-top: 40px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.rgf-tool .rgf-editorial-section h2 {
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  font-weight: 850;
  color: #0f172a;
  margin: 36px 0 14px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.rgf-tool .rgf-editorial-section h2:first-child {
  margin-top: 0;
}

.rgf-tool .rgf-editorial-section p {
  font-size: 1.02rem;
  color: #475569;
  line-height: 1.72;
  margin: 0 0 18px;
}

.rgf-tool .rgf-note-text {
  font-size: 0.94rem;
  color: #64748b;
  font-style: normal;
  line-height: 1.6;
  margin: 14px 0 24px;
}

/* Red Flags vs Green Flags Visual Comparison */
.rgf-tool .rgf-compare-wrap {
  margin: 22px 0 28px;
}

.rgf-tool .rgf-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.rgf-tool .rgf-compare-col {
  padding: 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-compare-red {
  border-top: 3px solid #ef4444;
  background: #fffbfb;
}

.rgf-tool .rgf-compare-green {
  border-top: 3px solid #10b981;
  background: #fbfdfc;
}

.rgf-tool .rgf-compare-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.rgf-tool .rgf-compare-head h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 850;
  color: #0f172a;
}

.rgf-tool .rgf-compare-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rgf-tool .rgf-compare-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.5;
}

.rgf-tool .rgf-compare-red .rgf-compare-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #dc2626;
  font-weight: 900;
}

.rgf-tool .rgf-compare-green .rgf-compare-list li::before {
  content: "•";
  position: absolute;
  left: 4px;
  color: #059669;
  font-weight: 900;
}

/* Normal Problems vs Red Flags Cards */
.rgf-tool .rgf-problem-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 26px;
}

.rgf-tool .rgf-problem-card {
  padding: 18px 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-problem-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.rgf-tool .rgf-problem-friction .rgf-problem-badge {
  background: #f1f5f9;
  color: #475569;
}

.rgf-tool .rgf-problem-warning .rgf-problem-badge {
  background: #fef2f2;
  color: #991b1b;
}

.rgf-tool .rgf-problem-card p {
  margin: 0;
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.6;
}

/* Six Pillars Visual Grid */
.rgf-tool .rgf-pillars-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}

.rgf-tool .rgf-pillar-card {
  padding: 16px 18px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.rgf-tool .rgf-pillar-card strong {
  display: block;
  font-size: 0.98rem;
  font-weight: 850;
  color: #0f172a;
  margin-bottom: 4px;
}

.rgf-tool .rgf-pillar-card p {
  margin: 0;
  font-size: 0.90rem;
  color: #475569;
  line-height: 1.55;
}

/* Score Info Panel */
.rgf-tool .rgf-score-info-panel {
  padding: 22px 24px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  margin: 18px 0 28px;
}

.rgf-tool .rgf-score-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.rgf-tool .rgf-score-stat {
  padding: 12px 8px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 8px;
}

.rgf-tool .rgf-score-stat strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  color: #0f172a;
}

.rgf-tool .rgf-score-stat span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.rgf-tool .rgf-score-info-panel p {
  margin: 0;
  font-size: 0.94rem;
  color: #475569;
  line-height: 1.6;
}

/* ==========================================================================
   NEW SECTION: How to Read Your Relationship Flag Result
   ========================================================================== */
.rgf-tool .rgf-bands-guide {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 20px;
}

.rgf-tool .rgf-band-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 10px;
  transition: border-color 150ms ease;
}

.rgf-tool .rgf-band-score-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 240px;
}

.rgf-tool .rgf-band-range {
  display: inline-block;
  min-width: 60px;
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
}

.rgf-tool .rgf-band-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.80rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.rgf-tool .rgf-band-row-strong .rgf-band-tag {
  background: #ecfdf5;
  color: #065f46;
}

.rgf-tool .rgf-band-row-mostly .rgf-band-tag {
  background: #f0fdf4;
  color: #166534;
}

.rgf-tool .rgf-band-row-mixed .rgf-band-tag {
  background: #fffbeb;
  color: #92400e;
}

.rgf-tool .rgf-band-row-multi .rgf-band-tag {
  background: #fff1f2;
  color: #9f1239;
}

.rgf-tool .rgf-band-row-serious .rgf-band-tag {
  background: #fef2f2;
  color: #991b1b;
}

.rgf-tool .rgf-band-desc-col {
  flex: 1 1 auto;
}

.rgf-tool .rgf-band-desc-col p {
  margin: 0;
  font-size: 0.93rem;
  color: #475569;
  line-height: 1.55;
}

/* ==========================================================================
   NEW SECTION: Red and Green Flags by Context Grid
   ========================================================================== */
.rgf-tool .rgf-contexts-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 32px;
}

.rgf-tool .rgf-context-card-guide {
  padding: 18px 20px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-context-card-guide h3 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 850;
  color: #0f172a;
}

.rgf-tool .rgf-example-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  column-gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.rgf-tool .rgf-example-row:last-child {
  margin-bottom: 0;
}

.rgf-tool .rgf-example-icon {
  width: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  user-select: none;
}

.rgf-tool .rgf-example-row-green .rgf-example-icon {
  color: #059669;
  font-weight: 900;
}

.rgf-tool .rgf-example-copy {
  min-width: 0;
  font-size: 0.91rem;
  color: #475569;
  line-height: 1.55;
}

.rgf-tool .rgf-example-copy strong {
  color: #1e293b;
}

/* ==========================================================================
   NEW SECTION: What to Do After Taking the Test
   ========================================================================== */
.rgf-tool .rgf-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 32px;
}

.rgf-tool .rgf-step-card {
  padding: 20px 18px;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.rgf-tool .rgf-step-num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef5ff;
  color: #2563eb;
  font-size: 0.90rem;
  font-weight: 900;
  margin-bottom: 12px;
}

.rgf-tool .rgf-step-card h3 {
  margin: 0 0 8px;
  font-size: 0.98rem;
  font-weight: 850;
  color: #0f172a;
  line-height: 1.35;
}

.rgf-tool .rgf-step-card p {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
}

/* ==========================================================================
   Limitations Panel (Neutral Information Panel)
   ========================================================================== */
.rgf-tool .rgf-limitations-panel {
  padding: 24px 26px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  margin: 32px 0 36px;
}

.rgf-tool .rgf-limitations-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.rgf-tool .rgf-limitations-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  color: #64748b;
}

.rgf-tool .rgf-limitations-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.rgf-tool .rgf-limitations-head h2 {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 850;
  color: #0f172a;
}

.rgf-tool .rgf-limitations-panel p {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.65;
}

/* Redesigned FAQ List */
.rgf-tool .rgf-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.rgf-tool .rgf-faq-item {
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.rgf-tool .rgf-faq-item:hover {
  border-color: rgba(37, 99, 235, 0.25);
}

.rgf-tool .rgf-faq-item[open] {
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.05);
}

.rgf-tool .rgf-faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  font-size: 1.02rem;
  font-weight: 850;
  color: #0f172a;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.rgf-tool .rgf-faq-summary::-webkit-details-marker {
  display: none;
}

.rgf-tool .rgf-faq-summary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: -2px;
}

.rgf-tool .rgf-faq-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  color: #64748b;
  transition: transform 200ms ease, color 150ms ease;
}

.rgf-tool .rgf-faq-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rgf-tool .rgf-faq-item[open] .rgf-faq-icon {
  transform: rotate(180deg);
  color: #2563eb;
}

.rgf-tool .rgf-faq-body {
  padding: 0 20px 20px;
}

.rgf-tool .rgf-faq-body p {
  margin: 0;
  font-size: 0.98rem;
  color: #475569;
  line-height: 1.68;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  .rgf-tool .rgf-context-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-dimension-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-compare-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-problem-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-pillars-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-contexts-guide {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-steps-grid {
    grid-template-columns: 1fr;
  }

  .rgf-tool .rgf-band-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .rgf-tool .rgf-band-score-col {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .rgf-tool .rgf-card {
    padding: 20px 16px;
  }

  .rgf-tool #rgf-assessment-view {
    padding: 18px 16px 16px;
  }

  .rgf-tool .rgf-meta-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
  }

  .rgf-tool .rgf-meta-right {
    gap: 8px;
  }

  .rgf-tool .rgf-exit-btn {
    font-size: 0.78rem;
    padding: 2px 6px;
  }

  .rgf-tool .rgf-flag-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rgf-tool .rgf-nav-actions {
    flex-direction: column;
  }

  .rgf-tool .rgf-nav-actions .rgf-btn {
    width: 100%;
  }

  .rgf-tool .rgf-result-actions {
    flex-direction: column;
  }

  .rgf-tool .rgf-result-actions .rgf-btn {
    width: 100%;
  }

  .rgf-tool .rgf-answer-option {
    padding: 10px 14px;
    min-height: 46px;
  }

  .rgf-tool .rgf-score-stats-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rgf-tool .rgf-intro-scale {
    font-size: 0.80rem;
    padding: 6px 12px;
    gap: 8px;
  }

  .rgf-tool .rgf-spec-lbl {
    font-size: 0.64rem;
  }

  .rgf-tool .rgf-dialog-card {
    padding: 20px 16px 18px;
  }

  .rgf-tool .rgf-featured-visual {
    margin: 22px 0;
    border-radius: 8px;
  }
}

/* Featured Visual / Infographic */
.rgf-tool .rgf-featured-visual {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 32px 0 28px;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.035);
}

.rgf-tool .rgf-featured-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: contain;
}

/* Narrow viewports: switch to short numeric labels to prevent overflow */
@media (max-width: 480px) {
  .rgf-tool .rgf-spec-lbl-long { display: none; }
  .rgf-tool .rgf-spec-lbl-short { display: block; }
  .rgf-tool .rgf-spec-lbl {
    font-size: 0.60rem;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .rgf-tool *,
  .rgf-tool *::before,
  .rgf-tool *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
