/* Relationship Intelligence — .ri-* only; must NOT touch app/ai-insights/weekly-report styles */

#relIntelSection {
    padding: 0 16px 6px;
    animation: riFadeSlide 0.5s ease both;
}

@keyframes riFadeSlide {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ri-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-secondary, #64748B);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
}

.ri-section-heading i {
    color: #ec4899;
    font-size: 0.8rem;
}

.ri-card {
    background: #ffffff;
    border-radius: 24px;
    border: 1px solid #f1f5f9;
    padding: 22px 20px 18px;
    box-shadow:
        0 4px 16px -4px rgba(0, 0, 0, 0.06),
        0 2px 6px -2px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    animation: riCardIn 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes riCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    60%  { transform: translateY(-3px) scale(1.008); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Rose accent top bar */
.ri-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: #be185d;
    border-radius: 24px 24px 0 0;
}

body.theme-charcoal .ri-card {
    background: #1e1e1e;
    border-color: #2d2d2d;
}

.ri-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ri-header-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--mc-radius-sm, 6px);
    background: rgba(236, 72, 153, 0.1);
    color: #be185d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

body.theme-charcoal .ri-header-icon {
    background: rgba(236,72,153,0.15);
    color: #f9a8d4;
}

.ri-header-text {
    flex: 1;
    min-width: 0;
}

.ri-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #be185d;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-family: 'Outfit', sans-serif;
}

.ri-label i { font-size: 0.72rem; }

body.theme-charcoal .ri-label { color: #f9a8d4; }

.ri-subtext {
    font-size: 0.72rem;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 3px;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-subtext { color: #64748b; }

.ri-score-row {
    margin-bottom: 14px;
}

.ri-score-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.ri-score-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: #475569;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-score-label { color: #94a3b8; }

.ri-score-num {
    font-size: 0.95rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.ri-score-bar-track {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 10px;
}

body.theme-charcoal .ri-score-bar-track { background: #2d2d2d; }

.ri-score-bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ri-score-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.ri-cat-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.ri-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.73rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.ri-cat-pill i { font-size: 0.7rem; }

.ri-section {
    margin-bottom: 14px;
}

.ri-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-family: 'Outfit', sans-serif;
}

.ri-section-title i { font-size: 0.7rem; color: #94a3b8; }

body.theme-charcoal .ri-section-title { color: #94a3b8; }

.ri-section-body {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.65;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-section-body { color: #cbd5e1; }

.ri-highlight {
    display: flex;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    margin-bottom: 10px;
    align-items: flex-start;
}

.ri-highlight--positive {
    background: rgba(34, 197, 94, 0.06);
    border-left: 3px solid #22c55e;
}

.ri-highlight--improve {
    background: rgba(139, 92, 246, 0.06);
    border-left: 3px solid #8b5cf6;
}

body.theme-charcoal .ri-highlight--positive {
    background: rgba(34,197,94,0.08);
    border-left-color: #4ade80;
}

body.theme-charcoal .ri-highlight--improve {
    background: rgba(139,92,246,0.1);
    border-left-color: #a78bfa;
}

.ri-highlight-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.ri-highlight--positive .ri-highlight-icon {
    background: rgba(34,197,94,0.12);
    color: #16a34a;
}

.ri-highlight--improve .ri-highlight-icon {
    background: rgba(139,92,246,0.12);
    color: #7c3aed;
}

body.theme-charcoal .ri-highlight--positive .ri-highlight-icon { color: #4ade80; }
body.theme-charcoal .ri-highlight--improve .ri-highlight-icon  { color: #a78bfa; }

.ri-highlight-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.ri-highlight--positive .ri-highlight-title { color: #16a34a; }
.ri-highlight--improve .ri-highlight-title  { color: #7c3aed; }
body.theme-charcoal .ri-highlight--positive .ri-highlight-title { color: #4ade80; }
body.theme-charcoal .ri-highlight--improve .ri-highlight-title  { color: #a78bfa; }

.ri-highlight-body {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.6;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-highlight-body { color: #cbd5e1; }

.ri-exercise {
    background: #f8fafc;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #f1f5f9;
}

body.theme-charcoal .ri-exercise {
    background: #252525;
    border-color: #333333;
}

.ri-exercise-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ri-exercise-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.ri-exercise-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-exercise-label { color: #64748b; }

.ri-exercise-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
    margin-top: 2px;
}

body.theme-charcoal .ri-exercise-name { color: #f1f5f9; }

.ri-exercise-desc {
    font-size: 0.83rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 12px;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-exercise-desc { color: #94a3b8; }

.ri-exercise-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--mc-radius-sm, 6px);
    background: #be185d;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ri-exercise-cta:hover {
    background: #9d174d;
}

.ri-exercise-cta:active { opacity: 0.9; }

.ri-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}

body.theme-charcoal .ri-footer { border-top-color: #2d2d2d; }

.ri-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #be185d;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    transition: color 0.2s ease;
}

.ri-footer-link:hover { color: #9d174d; }

body.theme-charcoal .ri-footer-link {
    color: #f9a8d4;
}

.ri-footer-sep {
    color: #cbd5e1;
    font-size: 0.85rem;
}

.ri-card--empty {
    text-align: center;
}

.ri-empty-body {
    padding: 20px 0 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ri-empty-icon {
    font-size: 2.2rem;
    color: #fda4af;
    animation: riEmptyPulse 2.5s ease-in-out infinite;
}

@keyframes riEmptyPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50%       { opacity: 0.45; transform: scale(1.06); }
}

body.theme-charcoal .ri-empty-icon { color: #9f1239; }

.ri-empty-text {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.65;
    max-width: 340px;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-empty-text { color: #94a3b8; }

.ri-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--mc-radius-sm, 6px);
    background: #be185d;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.ri-empty-cta:hover {
    background: #9d174d;
}

.ri-empty-cta:active { opacity: 0.9; }

.ri-skeleton {
    background: #ffffff !important;
    pointer-events: none;
    min-height: 200px;
}

body.theme-charcoal .ri-skeleton { background: #1e1e1e !important; }

@keyframes riShimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.ri-skel-circle,
.ri-skel-line,
.ri-skel-bar,
.ri-skel-block {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 800px 100%;
    animation: riShimmer 1.5s infinite linear;
    border-radius: 8px;
}

body.theme-charcoal .ri-skel-circle,
body.theme-charcoal .ri-skel-line,
body.theme-charcoal .ri-skel-bar,
body.theme-charcoal .ri-skel-block {
    background: linear-gradient(90deg, #252525 25%, #2d2d2d 50%, #252525 75%);
    background-size: 800px 100%;
}

.ri-skel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ri-skel-circle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex-shrink: 0;
}

.ri-skel-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ri-skel-line  { height: 12px; border-radius: 6px; }
.ri-skel-bar   { height: 8px; width: 100%; margin-bottom: 14px; }
.ri-skel-block { height: 72px; width: 100%; margin-bottom: 10px; border-radius: 14px; }

@media (min-width: 768px) {
    #relIntelSection { padding: 0 20px 8px; }

    .ri-card { padding: 26px 24px 20px; }

    .ri-cat-row { gap: 10px; }

    .ri-section-body,
    .ri-highlight-body,
    .ri-exercise-desc {
        font-size: 0.9rem;
    }
}

.ri-time-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    margin-bottom: 16px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 16px;
}

.ri-time-tab {
    border: 0;
    background: transparent;
    color: #64748b;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.ri-time-tab:hover {
    background: rgba(236, 72, 153, 0.08);
    color: #9d174d;
}

.ri-time-tab.is-active {
    background: rgba(236, 72, 153, 0.14);
    color: #9d174d;
    box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.2);
}

body.theme-charcoal .ri-time-tabs {
    background: #232323;
    border-color: #2d2d2d;
}

body.theme-charcoal .ri-time-tab {
    color: #94a3b8;
}

body.theme-charcoal .ri-time-tab:hover,
body.theme-charcoal .ri-time-tab.is-active {
    color: #fbcfe8;
    background: rgba(236, 72, 153, 0.14);
}

.ri-score-panel {
    padding: 14px;
    border-radius: var(--mc-radius-md, 10px);
    background: #ffffff;
    border: 1px solid #eef2f7;
    margin-bottom: 14px;
}

body.theme-charcoal .ri-score-panel {
    background: #232323;
    border-color: #2d2d2d;
}

.ri-score-panel .ri-score-num {
    font-size: 1.7rem;
    color: #0f172a;
}

body.theme-charcoal .ri-score-panel .ri-score-num {
    color: #f8fafc;
}

.ri-trend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ri-trend-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.ri-trend-copy {
    font-size: 0.8rem;
    color: #64748b;
    font-family: 'Outfit', sans-serif;
}

.ri-trend--improving .ri-trend-pill {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.ri-trend--stable .ri-trend-pill {
    background: rgba(148, 163, 184, 0.14);
    color: #475569;
}

.ri-trend--attention .ri-trend-pill {
    background: rgba(249, 115, 22, 0.12);
    color: #c2410c;
}

body.theme-charcoal .ri-trend-copy {
    color: #94a3b8;
}

body.theme-charcoal .ri-trend--improving .ri-trend-pill {
    color: #86efac;
}

body.theme-charcoal .ri-trend--stable .ri-trend-pill {
    color: #cbd5e1;
}

body.theme-charcoal .ri-trend--attention .ri-trend-pill {
    color: #fdba74;
}

.ri-sparkline-wrap {
    margin-top: 12px;
}

.ri-sparkline {
    width: 100%;
    height: 64px;
    display: block;
}

.ri-sparkline-area {
    fill: rgba(236, 72, 153, 0.1);
}

.ri-sparkline-line {
    fill: none;
    stroke: #ec4899;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ri-sparkline-dot {
    fill: #be185d;
    stroke: #fff;
    stroke-width: 2;
}

body.theme-charcoal .ri-sparkline-area {
    fill: rgba(236, 72, 153, 0.16);
}

body.theme-charcoal .ri-sparkline-line {
    stroke: #f9a8d4;
}

body.theme-charcoal .ri-sparkline-dot {
    fill: #f9a8d4;
    stroke: #1e1e1e;
}

.ri-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.ri-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-meta-pill {
    background: #232323;
    border-color: #2d2d2d;
    color: #94a3b8;
}

.ri-area-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.ri-area-card {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid #eef2f7;
    background: #f8fafc;
}

.ri-area-card--positive {
    background: rgba(20, 184, 166, 0.06);
}

.ri-area-card--growth {
    background: rgba(249, 115, 22, 0.06);
}

body.theme-charcoal .ri-area-card {
    background: #232323;
    border-color: #2d2d2d;
}

.ri-area-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.76rem;
    font-weight: 800;
    color: #475569;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-area-title {
    color: #cbd5e1;
}

.ri-area-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ri-area-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
}

.ri-section--observations {
    padding: 2px 0 4px;
}

.ri-observation-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.ri-observation-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #475569;
    font-size: 0.84rem;
    line-height: 1.55;
    font-family: 'Outfit', sans-serif;
}

.ri-observation-item i {
    color: #ec4899;
    margin-top: 3px;
}

body.theme-charcoal .ri-observation-item {
    color: #cbd5e1;
}

.ri-low-data {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px;
    border-radius: 16px;
    margin-bottom: 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.16);
}

.ri-low-data-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.12);
    color: #B45309;
    flex-shrink: 0;
}

.ri-low-data-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: #92400e;
    margin-bottom: 4px;
    font-family: 'Outfit', sans-serif;
}

.ri-low-data-copy {
    margin: 0;
    color: #7c5d12;
    font-size: 0.83rem;
    line-height: 1.55;
    font-family: 'Outfit', sans-serif;
}

body.theme-charcoal .ri-low-data {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.18);
}

body.theme-charcoal .ri-low-data-title {
    color: #fcd34d;
}

body.theme-charcoal .ri-low-data-copy {
    color: #fde68a;
}

.ri-skel-tabs {
    height: 42px;
    border-radius: 16px;
    margin-bottom: 14px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 800px 100%;
    animation: riShimmer 1.5s infinite linear;
}

body.theme-charcoal .ri-skel-tabs {
    background: linear-gradient(90deg, #252525 25%, #2d2d2d 50%, #252525 75%);
    background-size: 800px 100%;
}

@media (min-width: 768px) {
    .ri-area-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ri-time-tabs {
        width: 100%;
        justify-content: center;
    }

    .ri-time-tab {
        flex: 1 1 calc(33.333% - 8px);
        text-align: center;
        padding-inline: 8px;
    }

    .ri-score-panel .ri-score-num {
        font-size: 1.45rem;
    }

    .ri-trend-row,
    .ri-meta-row,
    .ri-area-pills {
        justify-content: center;
    }

    .ri-low-data {
        text-align: center;
        flex-direction: column;
        align-items: center;
    }

    .ri-observation-item {
        font-size: 0.83rem;
    }
}
