/* ============================================================
   AD Security Checklist — Design System
   Modern dark cyber-security console aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    /* Surface */
    --bg:              #0a0e1a;
    --bg-elevated:     #131826;
    --bg-elevated-2:   #1a2033;
    --border:          #1f2942;
    --border-hover:    #2d3a5c;

    /* Text */
    --text:            #e5e9f0;
    --text-muted:      #8b95b3;
    --text-dim:        #5a6485;

    /* Accent */
    --accent:          #00d4ff;
    --accent-dim:      #0891b2;
    --accent-glow:     rgba(0, 212, 255, 0.15);
    --accent-soft:     rgba(0, 212, 255, 0.08);

    /* Status */
    --success:         #22c55e;
    --success-bg:      rgba(34, 197, 94, 0.12);
    --warning:         #f59e0b;
    --warning-bg:      rgba(245, 158, 11, 0.12);
    --danger:          #ef4444;
    --danger-bg:       rgba(239, 68, 68, 0.12);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

    /* Spacing scale */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-8: 48px;
    --space-10: 64px;

    --radius-sm: 6px;
    --radius:    10px;
    --radius-lg: 14px;

    /* Theme-specific gradients (overridden in light mode) */
    --hero-gradient-1: rgba(0, 212, 255, 0.06);
    --hero-gradient-2: rgba(0, 212, 255, 0.04);
    --body-gradient-end: #060912;
    --grid-line: rgba(31, 41, 66, 0.25);
    --inset-shadow: rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
    --bg:              #f5f7fa;
    --bg-elevated:     #ffffff;
    --bg-elevated-2:   #f1f5f9;
    --border:          #e2e8f0;
    --border-hover:    #94a3b8;

    --text:            #0f172a;
    --text-muted:      #475569;
    --text-dim:        #94a3b8;

    --accent:          #0891b2;
    --accent-dim:      #0e7490;
    --accent-glow:     rgba(8, 145, 178, 0.18);
    --accent-soft:     rgba(8, 145, 178, 0.08);

    --success:         #16a34a;
    --success-bg:      rgba(22, 163, 74, 0.10);
    --warning:         #d97706;
    --warning-bg:      rgba(217, 119, 6, 0.10);
    --danger:          #dc2626;
    --danger-bg:       rgba(220, 38, 38, 0.10);

    --hero-gradient-1: rgba(8, 145, 178, 0.08);
    --hero-gradient-2: rgba(8, 145, 178, 0.04);
    --body-gradient-end: #eef2f7;
    --grid-line: rgba(15, 23, 42, 0.05);
    --inset-shadow: rgba(15, 23, 42, 0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    background-image:
        radial-gradient(circle at 20% 0%, var(--hero-gradient-1) 0%, transparent 50%),
        radial-gradient(circle at 80% 100%, var(--hero-gradient-2) 0%, transparent 50%),
        linear-gradient(180deg, var(--bg) 0%, var(--body-gradient-end) 100%);
    background-attachment: fixed;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* ===== Brand bar (top-of-page header) ===== */
.brand-bar {
    position: relative;
    z-index: 2;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.brand-bar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 10px var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.brand-bar-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.brand-logo {
    height: 28px;
    width: auto;
    display: block;
    object-fit: contain;
}

.brand-bar-title {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
}

.brand-bar-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ===== Advertising block (top of report) ===== */
.ad-block {
    margin: var(--space-5) 0 var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius-lg);
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-5);
    align-items: center;
}

.ad-block:not(:has(.ad-image-link)) {
    grid-template-columns: 1fr;
}

.ad-image-link {
    flex-shrink: 0;
    display: block;
}

.ad-image {
    width: 180px;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    border-radius: var(--radius);
    display: block;
}

.ad-body { min-width: 0; }

.ad-headline {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 var(--space-2);
    letter-spacing: -0.005em;
    color: var(--text);
}

.ad-headline a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-dim);
    transition: color 0.15s ease;
}

.ad-headline a:hover {
    color: var(--accent);
    border-bottom-style: solid;
}

.ad-text {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
}

.ad-text p { margin: 0 0 6px; }
.ad-text p:last-child { margin-bottom: 0; }
.ad-text strong { color: var(--text); }

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-3);
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: 0 4px 12px var(--accent-glow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ad-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

@media (max-width: 640px) {
    .ad-block {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .ad-image { width: 100%; max-width: 280px; margin: 0 auto; }
}

/* ===== Brand footer (bottom-of-page strip) ===== */
.brand-footer {
    position: relative;
    z-index: 1;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    margin-top: var(--space-8);
}

.brand-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-5);
    text-align: center;
}

.brand-footer-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

@media (max-width: 640px) {
    .brand-bar-inner { padding: 8px var(--space-4); }
    .brand-bar-title { font-size: 13px; }
    .brand-logo { height: 22px; }
    .brand-bar-time { font-size: 11px; }
    .brand-footer-inner { padding: var(--space-3) var(--space-4); }
}

/* Grid texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-5);
}

/* ===== App header / brand ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--border);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    display: grid;
    place-items: center;
    color: var(--bg);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 0 24px var(--accent-glow);
}

.brand-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--success-bg);
    color: var(--success);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.brand-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

/* ===== Hero ===== */
.hero {
    margin-bottom: var(--space-8);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: var(--space-4);
}

.hero-eyebrow::before {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--accent);
}

h1, .h1 {
    font-family: var(--font-sans);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    color: var(--text);
    margin: 0 0 var(--space-3);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

h1 .accent {
    background: linear-gradient(135deg, var(--accent) 0%, #7dd3fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 17px;
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 0 var(--space-6);
}

.hero-stats {
    display: flex;
    gap: var(--space-6);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== Buttons ===== */
button, .btn {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-hover);
    background: var(--bg-elevated);
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

button:hover, .btn:hover {
    border-color: var(--accent-dim);
    background: var(--bg-elevated-2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg);
    border: 1px solid transparent;
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--accent-glow), 0 8px 24px -8px var(--accent-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #22e0ff 0%, var(--accent) 100%);
    box-shadow: 0 0 0 1px var(--accent-glow), 0 12px 32px -8px var(--accent-glow);
    transform: translateY(-1px);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 15px;
}

.btn-icon {
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* ===== Section grid (home) ===== */
.section-list-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-5);
}

h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    letter-spacing: -0.01em;
}

.section-list-header .count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--space-3);
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: section;
}

.section-card {
    counter-increment: section;
    position: relative;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    text-decoration: none;
    color: var(--text);
    transition: all 0.15s ease;
    overflow: hidden;
}

.section-card::before {
    content: counter(section, decimal-leading-zero);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    min-width: 28px;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.section-card::after {
    content: '→';
    margin-left: auto;
    color: var(--text-dim);
    font-size: 18px;
    transition: all 0.15s ease;
}

.section-card:hover {
    border-color: var(--accent-dim);
    background: var(--bg-elevated-2);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px -12px var(--accent-glow);
}

.section-card:hover::before {
    color: var(--accent);
}

.section-card:hover::after {
    color: var(--accent);
    transform: translateX(4px);
}

.section-card-name {
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
}

/* ===== Checklist page ===== */
.page-header {
    margin-bottom: var(--space-6);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: var(--space-4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.15s;
}

.back-link:hover { color: var(--accent); }

.page-actions {
    display: flex;
    gap: var(--space-3);
    margin: var(--space-5) 0;
    flex-wrap: wrap;
}

/* ===== Progress meter ===== */
.progress-panel {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.progress-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.progress-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.progress-name {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.progress-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
}

.progress-value strong {
    color: var(--text);
    font-weight: 600;
}

.progress-pct {
    font-weight: 600;
    color: var(--accent);
    font-size: 13px;
    padding-left: var(--space-2);
    border-left: 1px solid var(--border-hover);
    margin-left: var(--space-1);
}

.progress-pct-green  { color: var(--success); }
.progress-pct-yellow { color: var(--warning); }
.progress-pct-red    { color: var(--danger); }
.progress-pct-dim    { color: var(--text-dim); }

.progress-bar {
    position: relative;
    height: 8px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px var(--inset-shadow);
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 0 12px currentColor;
}

.progress-fill-cyan {
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    color: var(--accent-glow);
}

.progress-fill-green {
    background: linear-gradient(90deg, #16a34a, var(--success));
    color: rgba(34, 197, 94, 0.4);
}

.progress-fill-yellow {
    background: linear-gradient(90deg, #d97706, var(--warning));
    color: rgba(245, 158, 11, 0.4);
}

.progress-fill-red {
    background: linear-gradient(90deg, #b91c1c, var(--danger));
    color: rgba(239, 68, 68, 0.4);
}

.progress-fill-dim {
    background: var(--border-hover);
    box-shadow: none;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-3);
    transition: border-color 0.15s ease;
}

.checklist-item:hover {
    border-color: var(--border-hover);
}

.checklist-item label {
    flex: 1;
    margin: 0;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.checklist-item select {
    flex-shrink: 0;
    width: 170px;
    padding: 8px 12px;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b95b3' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    transition: border-color 0.15s;
}

.checklist-item select:hover,
.checklist-item select:focus {
    border-color: var(--accent-dim);
    outline: none;
}

.checklist-item textarea {
    flex-basis: 100%;
    margin-top: var(--space-3);
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
    font-family: var(--font-sans);
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.checklist-item textarea:focus {
    outline: none;
    border-color: var(--accent-dim);
}

.checklist-item:has(textarea[style*="block"]),
.checklist-item.has-reason {
    flex-wrap: wrap;
}

.explain-btn {
    background: transparent;
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 16px;
}

.explain-btn:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.submit-btn {
    margin-top: var(--space-5);
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    color: var(--bg);
    border: 1px solid transparent;
    font-weight: 600;
    padding: 14px 28px;
    font-size: 15px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #22e0ff 0%, var(--accent) 100%);
    transform: translateY(-1px);
}

/* ===== Report page ===== */
.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.report-id {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.report-id strong {
    color: var(--text-muted);
    font-weight: 500;
}

.overall-card {
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--space-6);
    align-items: center;
}

.overall-card-grid {
    grid-template-columns: auto 1fr;
    align-items: center;
}

/* Circular SVG gauge */
.gauge-wrap {
    position: relative;
    width: 140px;
    height: 140px;
    flex-shrink: 0;
}

.gauge {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.gauge circle {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
}

.gauge-track  { stroke: var(--border); }
.gauge-fill   {
    stroke-dasharray: 326.7256;
    transition: stroke-dashoffset 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 0 6px currentColor);
}
.gauge-fill-green  { stroke: var(--success); color: var(--success); }
.gauge-fill-yellow { stroke: var(--warning); color: var(--warning); }
.gauge-fill-red    { stroke: var(--danger);  color: var(--danger); }

.gauge-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}
.gauge-value span { font-size: 18px; opacity: 0.7; margin-left: 2px; }
.gauge-value-green  { color: var(--success); }
.gauge-value-yellow { color: var(--warning); }
.gauge-value-red    { color: var(--danger); }

.gauge-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 2px;
}

.overall-meta { display: flex; flex-direction: column; gap: var(--space-4); }

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
}

.metric {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
    position: relative;
}

.metric-value {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

.metric-pct {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
}

.metric-success .metric-value { color: var(--success); }
.metric-accent  .metric-value { color: var(--accent); }
.metric-danger  .metric-value { color: var(--danger); }

.highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.highlight {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}

.highlight-icon {
    font-size: 12px;
    line-height: 1;
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.highlight-up   { background: var(--success-bg); color: var(--success); }
.highlight-down { background: var(--danger-bg);  color: var(--danger); }

.highlight-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.highlight-value { font-size: 13px; font-weight: 500; margin-top: 2px; }

/* ===== Hero grid: summary (left) + big radar (right) ===== */
.hero-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    align-items: stretch;
}

.hero-summary {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-elevated-2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.hero-summary .gauge-wrap {
    width: 160px;
    height: 160px;
    margin: 0 auto;
}

.summary-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.summary-stat {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.summary-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    grid-column: 1;
}

.summary-success .summary-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.summary-accent  .summary-dot { background: var(--accent);  box-shadow: 0 0 8px var(--accent); }
.summary-danger  .summary-dot { background: var(--danger);  box-shadow: 0 0 8px var(--danger); }

.summary-text {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    grid-column: 2;
}

.summary-num {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    grid-column: 3;
    text-align: right;
}

.summary-success .summary-num { color: var(--success); }
.summary-accent  .summary-num { color: var(--accent); }
.summary-danger  .summary-num { color: var(--danger); }

.summary-total { grid-template-columns: 1fr auto; }
.summary-total .summary-text { grid-column: 1; }
.summary-total .summary-num  { grid-column: 2; }

.highlights-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px dashed var(--border);
}

/* ===== Hero radar: the centerpiece ===== */
.hero-radar {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.radar-canvas-box {
    position: relative;
    width: 100%;
    height: 540px;
}

.radar-canvas-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Secondary full-width ranking chart */
.chart-wrap-full {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.ranking-canvas-box {
    position: relative;
    width: 100%;
    height: 480px;
}

.ranking-canvas-box canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.chart-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-4);
}

/* Reference Standards card */
.reference-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.reference-header { margin-bottom: var(--space-4); }

.reference-intro {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: var(--space-5);
}

.reference-tiers {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}

.reference-tier {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.tier-badge {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.05em;
}
.tier-badge-sm { background: rgba(34, 197, 94, 0.12);  color: var(--success); }
.tier-badge-md { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.tier-badge-lg { background: var(--accent-soft);       color: var(--accent); }

.tier-name { font-size: 13px; font-weight: 600; color: var(--text); }
.tier-desc { font-size: 13px; color: var(--text-muted); line-height: 1.55; }

.reference-note {
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text);
    margin-bottom: var(--space-5);
}

.reference-sources strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
}

.reference-sources ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.reference-sources li {
    padding: 6px 0;
    font-size: 13px;
    border-top: 1px dashed var(--border);
}

.reference-sources li:first-child { border-top: none; }

.reference-sources a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-dim);
}

.reference-sources a:hover {
    color: #22e0ff;
    border-bottom-style: solid;
}

.section-detail-title {
    font-size: 18px;
    margin: var(--space-6) 0 var(--space-4);
}

/* Inline per-section meter (in detail list) */
.section-meter {
    height: 4px;
    background: var(--bg);
    border-radius: 999px;
    overflow: hidden;
    margin: 0 0 var(--space-4);
}

.section-meter-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== Per-section mitigation list (mirrors PDF report) ===== */
.section-detailed { padding: var(--space-5); }

.mitigation-heading {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: var(--space-4) 0 var(--space-3);
}

.mitigation-list {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-4);
    counter-reset: mitigation;
}

.mitigation-item {
    display: grid;
    grid-template-columns: 22px 24px 1fr;
    align-items: start;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
}

.mitigation-item:first-child { border-top: none; }

.mitigation-num {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    text-align: right;
    line-height: 1.5;
}

.mitigation-icon {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.mitigation-icon-ok     { background: var(--success-bg); color: var(--success); }
.mitigation-icon-accept { background: var(--accent-soft); color: var(--accent); }
.mitigation-icon-miss   { background: var(--danger-bg);  color: var(--danger); }

.mitigation-body { min-width: 0; }

.mitigation-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
}

.mitigation-body .acceptance-reason {
    margin-top: 6px;
    margin-left: 0;
    padding: 6px 10px;
    background: var(--bg);
    border-left: 2px solid var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== Open Remediations callout (mirrors PDF) ===== */
.remediation-callout {
    margin-top: var(--space-4);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    border: 1px solid;
}

.remediation-callout-open {
    background: var(--danger-bg);
    border-color: var(--danger);
}

.remediation-callout-ok {
    background: var(--success-bg);
    border-color: var(--success);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.remediation-callout-ok .remediation-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    background: var(--success);
    color: var(--bg-elevated);
    border-radius: 6px;
    font-weight: 700;
}

.remediation-callout-ok > span:not(.remediation-icon) {
    font-size: 14px;
    font-weight: 500;
    color: var(--success);
}

.remediation-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.remediation-callout-open .remediation-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    background: var(--danger);
    color: var(--bg-elevated);
    border-radius: 6px;
    font-weight: 700;
    font-family: var(--font-mono);
}

.remediation-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--danger);
    letter-spacing: -0.005em;
}

.remediation-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}

.remediation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.remediation-list li {
    position: relative;
    padding: 6px 0 6px 18px;
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.remediation-list li::before {
    content: '›';
    position: absolute;
    left: 4px;
    top: 6px;
    font-weight: 700;
    color: var(--danger);
}

.remediation-list li + li {
    border-top: 1px dashed var(--border);
}

/* Numbered detailed remediation items with action lines */
.remediation-items {
    list-style: none;
    counter-reset: rem;
    padding: 0;
    margin: 0;
}

.remediation-items > li {
    counter-increment: rem;
    position: relative;
    padding: var(--space-3) 0 var(--space-3) 32px;
    border-top: 1px dashed var(--border);
}

.remediation-items > li:first-child { border-top: none; }

.remediation-items > li::before {
    content: counter(rem) ".";
    position: absolute;
    left: 6px;
    top: var(--space-3);
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    color: var(--danger);
}

.remediation-item-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
}

.remediation-item-action {
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    font-style: italic;
}

.remediation-action-label {
    font-style: normal;
    font-weight: 600;
    color: var(--danger);
    margin-right: 4px;
}

/* References list at the bottom of the callout */
.remediation-references {
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}

.remediation-references-label {
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: var(--space-2);
}

.remediation-references ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.remediation-references li {
    padding: 4px 0 4px 14px;
    font-size: 13px;
    position: relative;
}

.remediation-references li::before {
    content: '↗';
    position: absolute;
    left: 0;
    top: 4px;
    color: var(--accent);
    font-size: 12px;
}

.remediation-references a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-dim);
    transition: all 0.15s ease;
}

.remediation-references a:hover {
    color: #22e0ff;
    border-bottom-style: solid;
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; }
    .hero-summary .gauge-wrap { width: 140px; height: 140px; }
    .radar-canvas-box { min-height: 380px; }
    .ranking-canvas-box { height: 560px; }
    .reference-tiers { grid-template-columns: 1fr; }
}

.overall-label {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-2);
}

.overall-value {
    font-family: var(--font-mono);
    font-size: 48px;
    font-weight: 600;
    color: var(--accent);
    line-height: 1;
}

.chart-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
}

.section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
    margin-bottom: var(--space-3);
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.section-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.fulfillment-rate {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.fulfillment-rate.green  { background: var(--success-bg); color: var(--success); }
.fulfillment-rate.yellow { background: var(--warning-bg); color: var(--warning); }
.fulfillment-rate.red    { background: var(--danger-bg);  color: var(--danger); }

.section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.section li {
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 14px;
    color: var(--text-muted);
}

.section li:first-child { border-top: none; }

.item-status { flex-shrink: 0; }

.acceptance-reason {
    width: 100%;
    margin-top: var(--space-2);
    margin-left: 28px;
    padding: var(--space-2) var(--space-3);
    background: var(--bg);
    border-left: 2px solid var(--accent-dim);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
}

.pdf-link a, .button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-hover);
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.pdf-link a:hover, .button:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

.footer {
    margin-top: var(--space-8);
    padding-top: var(--space-5);
    border-top: 1px solid var(--border);
    text-align: center;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== Theme toggle & language switcher ===== */
.app-header-right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.lang-switcher {
    display: inline-flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px;
}

.lang-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.15s ease;
}

.lang-switch-btn:hover {
    color: var(--accent);
    background: var(--accent-soft);
}

.lang-switch-btn.active {
    color: var(--bg);
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
    box-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
    transform: rotate(15deg);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
    transition: opacity 0.2s ease, transform 0.3s ease;
    position: absolute;
}

.theme-toggle .icon-sun  { opacity: 0; transform: rotate(-90deg) scale(0.7); }
.theme-toggle .icon-moon { opacity: 1; transform: rotate(0) scale(1); }

[data-theme="light"] .theme-toggle .icon-sun  { opacity: 1; transform: rotate(0) scale(1); }
[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: rotate(90deg) scale(0.7); }

/* Light-mode small adjustments */
[data-theme="light"] .brand-mark {
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}

[data-theme="light"] .chart-wrap {
    background: #ffffff;
}

[data-theme="light"] .section-card,
[data-theme="light"] .checklist-item,
[data-theme="light"] .progress-panel,
[data-theme="light"] .overall-card,
[data-theme="light"] .section {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .container { padding: var(--space-5) var(--space-4); }
    .checklist-item {
        flex-direction: column;
        align-items: stretch;
    }
    .checklist-item select { width: 100%; }
    .overall-card { grid-template-columns: 1fr; }
    .hero-stats { gap: var(--space-4); }
}
