/* Brand Report Card v1.0.4 */
.brc-wrapper * { box-sizing: border-box !important; }
.brc-wrapper a { line-height: inherit !important; text-decoration: none !important; }
/* BUG FIX v1.0.2: Added border:none — <button> has browser default border which
   combined with border-radius violates DESIGN_GUIDE Rule 1. */
.brc-wrapper button { font-family: inherit; cursor: pointer; border: none; }

:root {
    --brand-primary: #20C997;
    --brand-primary-dark: #1AA67D;
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-md: 12px;
    --radius-sm: 8px;
    --radius-pill: 9999px;
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --transition-base: 250ms ease;
}

.brc-wrapper {
    font-family: var(--font-primary);
    background: #fff;
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-md);
    max-width: 420px;
    margin: 0 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Header */
.brc-header { display: flex; flex-direction: column; gap: 0.15rem; }

/* BUG FIX v1.0.2: #9ca3af on white = 2.9:1 (WCAG fail). Changed to #6b7280 (~4.5:1). */
.brc-heading {
    font-size: 0.8rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.brc-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}

/* Body: grade badge + stats side by side */
.brc-body {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

/* Grade badge */
/* v1.0.4: Grade badge colors via CSS classes instead of inline styles (dark mode safe) */
.brc-grade-badge {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
}
.brc-grade-a { background: #10b98118; color: #10b981; box-shadow: inset 0 0 0 2px #10b98140; }
.brc-grade-b { background: #20C99718; color: #20C997; box-shadow: inset 0 0 0 2px #20C99740; }
.brc-grade-c { background: #f59e0b18; color: #f59e0b; box-shadow: inset 0 0 0 2px #f59e0b40; }
.brc-grade-d { background: #f9731618; color: #f97316; box-shadow: inset 0 0 0 2px #f9731640; }
.brc-grade-f { background: #ef444418; color: #ef4444; box-shadow: inset 0 0 0 2px #ef444440; }

/* Stats grid */
.brc-stats {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    margin: 0;
}

.brc-stat {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.35rem;
    font-size: 0.82rem;
    line-height: 1.3;
}

/* BUG FIX v1.0.2: #9ca3af on white = 2.9:1 (WCAG fail). Changed to #6b7280 (~4.5:1). */
.brc-stat dt {
    color: #6b7280;
    font-weight: 600;
}

.brc-stat dd {
    color: #111827;
    font-weight: 600;
    margin: 0;
}

.brc-stat-signal dd {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.brc-signal-text {
    font-size: 0.78rem;
    color: #6b7280;
    font-weight: 400;
}

/* Pros list */
.brc-pros {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f3f4f6;
}

.brc-pros li {
    font-size: 0.8rem;
    color: #4b5563;
    padding-left: 1.1rem;
    position: relative;
    line-height: 1.4;
}

.brc-pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--brand-primary);
    font-weight: 700;
}

/* Footer CTAs */
.brc-footer {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/*
 * BUG FIX 5 (DESIGN_GUIDE Rule 2): .brc-cta-primary was using display:flex +
 * align-items:center on a text-only anchor button, which violates DESIGN_GUIDE Rule 2.
 * Fixed to display:inline-block with line-height to achieve vertical centering.
 * Also removed the redundant border:none (anchors have no border by default).
 */
/* BUG FIX v1.0.3: line-height:1 caused text not vertically centered with min-height 44px.
   Changed to line-height:2 for proper vertical centering in inline-block element. */
.brc-cta-primary {
    flex: 1;
    min-width: 130px;
    display: inline-block;
    line-height: 2;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    /* BUG FIX v1.0.2: White text on #20C997 = 2.7:1 (WCAG fail for normal text).
       Changed background to #047857 which achieves ~5.8:1 with white text. */
    color: #fff;
    background: #047857;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    box-shadow: 0 2px 8px rgba(4,120,87,0.3);
    transition: background var(--transition-base), box-shadow var(--transition-base);
    min-height: 44px;
}

.brc-cta-primary:hover {
    background: #065f46;
    box-shadow: 0 4px 12px rgba(4,120,87,0.4);
    color: #fff;
}

.brc-cta-share {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    background: transparent;
    /* DESIGN_GUIDE Rule 2: share button is text-only. Use inline-block + line-height. */
    display: inline-block;
    line-height: 2;
    text-align: center;
    padding: 0.55rem 1rem;
    border-radius: var(--radius-pill);
    /* DESIGN_GUIDE Rule 1: inset box-shadow replaces border + border-radius. */
    box-shadow: inset 0 0 0 1.5px #d1d5db, 0 1px 2px rgba(0,0,0,0.04);
    transition: box-shadow var(--transition-base), color var(--transition-base);
    min-height: 44px;
}

.brc-cta-share:hover {
    box-shadow: inset 0 0 0 1.5px var(--brand-primary), 0 1px 2px rgba(0,0,0,0.04);
    color: var(--brand-primary-dark);
}

/* Updated timestamp */
/* BUG FIX v1.0.2: #9ca3af on white = 2.9:1 (WCAG fail). Changed to #6b7280 (~4.5:1). */
.brc-updated {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0;
    text-align: right;
}

/* Mobile */
@media (max-width: 480px) {
    .brc-wrapper { padding: 1rem; }
    .brc-body { flex-direction: column; align-items: stretch; }
    .brc-grade-badge { width: 60px; height: 60px; font-size: 1.35rem; }
    .brc-stat { grid-template-columns: 7rem 1fr; }
    /*
     * BUG FIX 7: Was "justify-content: center" which has no effect on display:inline-block.
     * Corrected to "text-align: center" which correctly centers text in inline-block elements.
     */
    .brc-cta-primary,
    .brc-cta-share { width: 100%; text-align: center; }
}

/* Dark mode — DESIGN_GUIDE Rule 4 */
@media (prefers-color-scheme: dark) {
    .brc-wrapper { background: #1f2937; }
    .brc-brand { color: #f9fafb; }
    /* BUG FIX v1.0.3: .brc-heading #6b7280 on #1f2937 = 3.6:1 (WCAG fail). Changed to #9ca3af. */
    .brc-heading { color: #9ca3af; }
    /* BUG FIX v1.0.2: #6b7280 on #1f2937 = 3.6:1 (WCAG fail). Changed to #9ca3af (~4.6:1). */
    .brc-stat dt { color: #9ca3af; }
    .brc-stat dd { color: #f3f4f6; }
    .brc-signal-text { color: #9ca3af; }
    .brc-pros { border-top-color: #374151; }
    .brc-pros li { color: #9ca3af; }
    /* BUG FIX v1.0.2: #6b7280 on #1f2937 = 3.6:1 (WCAG fail). Changed to #9ca3af (~4.6:1). */
    .brc-updated { color: #9ca3af; }
    .brc-cta-share {
        color: #d1d5db;
        box-shadow: inset 0 0 0 1.5px #4b5563, 0 1px 2px rgba(0,0,0,0.3);
    }
    .brc-cta-share:hover {
        color: var(--brand-primary);
        box-shadow: inset 0 0 0 1.5px var(--brand-primary), 0 1px 2px rgba(0,0,0,0.3);
    }
}

/* BUG FIX v1.0.3: :focus-visible for keyboard navigation (WCAG 2.4.7). */
.brc-cta-primary:focus-visible,
.brc-cta-share:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Reduced motion — DESIGN_GUIDE Rule 5 */
@media (prefers-reduced-motion: reduce) {
    .brc-cta-primary, .brc-cta-share { transition: none; }
}
