/* ═══════════════════════════════════════════════════
   DressAI.info — CSS Condiviso
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --blue: #2563eb;
    --blue-light: #dbeafe;
    --green: #16a34a;
    --green-light: #dcfce7;
    --orange: #ea580c;
    --orange-light: #fff7ed;
    --red: #dc2626;
    --indigo: #4f46e5;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--slate-50); color: var(--slate-900); line-height: 1.6; }

/* ── NAV ── */
.nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    padding: 0 2rem; height: 90px;
    display: flex; align-items: center; justify-content: space-between;
    max-width: 100%;
}
.nav-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: inherit; }
.nav-brand img { height: 100px; width: auto; object-fit: contain; margin: -10px 0; }
.nav-brand-text { font-size: 1.6rem; font-weight: 900; letter-spacing: -0.03em; }
.nav-brand-text span { color: var(--indigo); }
.nav-subtitle { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--slate-400); font-weight: 600; }
.nav-links { display: flex; gap: 2rem; align-items: baseline; }
.nav-links a { text-decoration: none; color: var(--slate-500); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; transition: color 0.2s; }
.nav-links a:hover { color: var(--indigo); }
.nav-links a.active { color: var(--indigo); border-bottom: 2px solid var(--indigo); padding-bottom: 2px; }

/* ── HERO ── */
.hero {
    text-align: center; padding: 5rem 2rem 4rem;
    max-width: 800px; margin: 0 auto;
}
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); font-weight: 900; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 1.5rem; }
.hero h1 em { font-style: italic; color: var(--indigo); }
.hero p { font-size: 1.1rem; color: var(--slate-500); max-width: 600px; margin: 0 auto; font-weight: 400; }

/* ── SCORE BANNER ── */
.score-banner {
    max-width: 900px; margin: 0 auto 4rem;
    background: var(--slate-900); color: white;
    border-radius: 1.5rem; padding: 2.5rem 3rem;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2rem;
}
.score-number { font-size: 4rem; font-weight: 900; letter-spacing: -0.03em; line-height: 1; }
.score-number small { font-size: 1.5rem; color: var(--indigo); opacity: 0.8; }
.score-details { display: flex; gap: 2rem; flex-wrap: wrap; }
.score-item { text-align: center; }
.score-item-value { font-size: 1.5rem; font-weight: 800; }
.score-item-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--slate-400); font-weight: 600; }

/* ── SECTION TITLES ── */
.section-title {
    font-size: 1.8rem; font-weight: 900; letter-spacing: -0.03em;
    border-left: 5px solid var(--indigo); padding-left: 1rem;
    margin-bottom: 2rem;
}

/* ── ARENA SECTION ── */
.arena-section {
    max-width: 1200px; margin: 0 auto; padding: 1rem 2rem;
}
.arena-section .section-title { margin-bottom: 0.8rem; }
.arena-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: stretch;
}
.arena-container {
    background: white; border-radius: 1rem; padding: 1rem 1.2rem;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex; flex-direction: column;
}
.arena-label {
    display: inline-block; font-size: 0.65rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.15em;
    padding: 0.2rem 0.6rem; border-radius: 2rem; margin-bottom: 0.5rem;
}
.arena-label-2022 { background: var(--green-light); color: var(--green); }
.arena-label-2026 { background: #fef2f2; color: var(--red); }
.arena-title { font-size: 0.95rem; font-weight: 800; margin-bottom: 0.2rem; }
.arena-desc { font-size: 0.75rem; color: var(--slate-500); margin-bottom: 0.5rem; line-height: 1.3; }

/* ── SVG ARENA ── */
.arena-svg-wrapper {
    background: #fafbfc; border: 2px solid var(--slate-200); border-radius: 0.75rem;
    padding: 0.5rem; position: relative; flex: 1;
    display: flex; align-items: flex-start;
}
.arena-svg-wrapper svg {
    width: 100%; height: auto; max-height: 65vh;
}

/* SVG Path animations */
.path-draw {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.path-trotto { stroke: var(--blue); stroke-width: 2.5; }
.path-trotto-medio { stroke: var(--green); stroke-width: 2.5; }
.path-galoppo { stroke: var(--orange); stroke-width: 2.5; }
.path-passo { stroke: var(--red); stroke-width: 3; }

/* Dash patterns — only for non-animated paths (animated ones use dasharray:2000 trick) */
.path-trotto-medio:not(.path-animated) { stroke-dasharray: 8 4; }
.path-galoppo:not(.path-animated) { stroke-dasharray: 12 4; }
.path-passo:not(.path-animated) { stroke-dasharray: 4 4; }

/* Animated drawing — dasharray/offset set via JS to actual path length, animated via RAF */
.path-animated {
    /* no CSS transition — fully controlled by requestAnimationFrame */
}

/* Arrow markers */
.arena-letter {
    font-size: 11px; font-weight: 800; fill: var(--slate-400);
    font-family: 'Inter', sans-serif;
}
.arena-letter-main {
    font-size: 13px; font-weight: 900; fill: var(--red);
}
.x-marker {
    fill: var(--red);
}
@keyframes pulse { 0%,100% { r: 4; opacity: 1; } 50% { r: 7; opacity: 0.5; } }
.x-pulse { animation: pulse 2s infinite; }

/* Rider marker that moves along the path */
.rider-marker {
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

/* ── LEGEND ── */
.legend {
    display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5rem;
    font-size: 0.65rem; font-weight: 700; color: var(--slate-500);
}
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-line { width: 16px; height: 3px; border-radius: 2px; }
.legend-line-dashed { width: 16px; height: 0; border-top: 3px dashed; }

/* ── CONTROLS ── */
.arena-controls { margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.3rem; align-items: center; }
.arena-controls-row { display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; justify-content: center; }
.timer {
    font-family: 'Inter', monospace; font-size: 0.95rem; font-weight: 700;
    color: var(--slate-700); min-width: 3rem;
}
.timer-total {
    font-family: 'Inter', monospace; font-size: 0.7rem; font-weight: 400;
    color: var(--slate-400); margin-right: 0.3rem;
}
.btn {
    padding: 0.35rem 0.8rem; border-radius: 0.5rem; border: none;
    font-family: 'Inter', sans-serif; font-size: 0.7rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s; text-transform: uppercase; letter-spacing: 0.05em;
}
.btn-primary { background: var(--indigo); color: white; }
.btn-primary:hover { background: var(--slate-900); transform: translateY(-1px); }
.btn-outline { background: white; color: var(--slate-600); border: 2px solid var(--slate-200); }
.btn-outline:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-outline.active { background: var(--indigo); color: white; border-color: var(--indigo); }
.btn-play { font-size: 0.85rem; padding: 0.35rem 1rem; }
.speed-label { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--slate-400); }
.btn-speed { background: white; color: var(--slate-600); border: 2px solid var(--slate-200); }
.btn-speed:hover { border-color: var(--indigo); color: var(--indigo); }
.btn-speed.active { background: var(--indigo); color: white; border-color: var(--indigo); }
.btn-large { padding: 0.8rem 2rem; font-size: 0.9rem; border-radius: 1rem; }

.move-info {
    font-size: 0.75rem; color: var(--slate-600); min-height: 1.2em;
    font-weight: 600; text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.move-info .move-num { color: var(--indigo); font-weight: 800; }
.move-info .move-dur { color: var(--slate-400); font-weight: 400; }

/* ── GAIT SPEEDS ── */
.gait-speeds {
    max-width: 960px; margin: 0 auto 1rem; text-align: center;
}
.gait-speeds h3 {
    font-size: 0.85rem; font-weight: 700; color: var(--slate-600);
    margin-bottom: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.gait-speeds-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem;
}
@media (max-width: 768px) { .gait-speeds-grid { grid-template-columns: repeat(2, 1fr); } }
.gait-card {
    border-radius: 0.5rem; padding: 0.5rem 0.7rem;
    border-left: 4px solid; background: white;
    text-align: left; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.gait-card.gait-passo { border-color: var(--red); }
.gait-card.gait-trotto { border-color: var(--blue); }
.gait-card.gait-trotto-medio { border-color: var(--green); }
.gait-card.gait-galoppo { border-color: var(--orange); }
.gait-type { font-size: 1.1rem; font-weight: 900; color: #111; letter-spacing: 0.08em; }
.gait-name { font-size: 0.75rem; font-weight: 700; color: #333; margin-top: 0.1rem; }
.gait-value { font-size: 0.78rem; font-weight: 600; color: #222; margin-top: 0.15rem; }

/* ── ANALYSIS SECTION ── */
.analysis-section {
    max-width: 1200px; margin: 0 auto; padding: 4rem 2rem;
}
.analysis-grid {
    display: grid; grid-template-columns: 1fr 380px; gap: 3rem; align-items: start;
}
.analysis-card {
    background: white; border-radius: 1.25rem; padding: 1.5rem 2rem;
    border: 1px solid var(--slate-200); margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}
.analysis-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.analysis-timestamp {
    display: inline-block; font-size: 0.75rem; font-weight: 800;
    color: var(--indigo); background: var(--blue-light);
    padding: 0.2rem 0.7rem; border-radius: 1rem; font-family: monospace;
}
.analysis-problem { color: var(--red); font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 0.8rem; }
.analysis-text { font-size: 0.9rem; color: var(--slate-600); margin-top: 0.3rem; line-height: 1.6; }
.analysis-fix {
    margin-top: 0.8rem; padding-left: 1rem;
    border-left: 3px solid var(--blue-light);
    font-size: 0.9rem; font-weight: 600; color: var(--slate-800);
    font-style: italic;
}

/* Sticky sidebar */
.analysis-sidebar { position: sticky; top: 90px; }
.sidebar-card {
    background: var(--slate-900); color: white;
    border-radius: 1.5rem; padding: 2rem; margin-bottom: 1rem;
}
.sidebar-card h3 {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--slate-400); font-weight: 700; margin-bottom: 1rem;
}
.sidebar-score { font-size: 3rem; font-weight: 900; line-height: 1; }
.sidebar-score small { font-size: 1.2rem; color: var(--indigo); }
.sidebar-meta { font-size: 0.8rem; color: var(--slate-400); margin-top: 0.3rem; }
.sidebar-divider { border: none; border-top: 1px solid rgba(255,255,255,0.1); margin: 1.2rem 0; }
.sidebar-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.3rem 0; }
.sidebar-row-label { color: var(--slate-400); }
.sidebar-row-value { font-weight: 700; }

.sidebar-card-light {
    background: white; border: 1px solid var(--slate-200);
    border-radius: 1.5rem; padding: 1.5rem; text-align: center;
}
.sidebar-card-light p { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em; color: var(--slate-400); font-weight: 700; margin-bottom: 0.3rem; }
.sidebar-card-light .domain { color: var(--indigo); font-weight: 800; font-size: 1.1rem; font-family: monospace; }

/* ── COMPARISON IMAGES ── */
.comparison-section {
    max-width: 1200px; margin: 0 auto; padding: 4rem 2rem;
}
.comparison-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
}
.comparison-card {
    background: white; border-radius: 1.5rem; overflow: hidden;
    border: 1px solid var(--slate-200);
}
.comparison-card img {
    width: 100%; height: auto; display: block;
    transition: filter 0.4s;
}
.comparison-card-2026 img { filter: grayscale(0.5); }
.comparison-card-2026 img:hover { filter: grayscale(0); }
.comparison-card-header {
    padding: 1.2rem 1.5rem;
}

/* ── COMPARISON TABLE ── */
.comp-section {
    max-width: 1200px; margin: 0 auto; padding: 4rem 2rem;
}
.comp-header-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.comp-meta {
    display: flex; gap: 2rem; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--slate-500);
}
.comp-meta strong { color: var(--slate-800); }

.comp-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: white; border-radius: 1rem; overflow: hidden;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.comp-table thead th {
    background: var(--slate-900); color: white;
    padding: 0.8rem 1rem; font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em; text-align: left;
}
.comp-table thead th:first-child { border-radius: 0; }
.comp-table thead th.col-num { width: 40px; text-align: center; }
.comp-table thead th.col-letters { width: 90px; }
.comp-table thead th.col-test { width: 28%; }
.comp-table thead th.col-judge { width: 28%; background: #1a3a2a; }
.comp-table thead th.col-ai { width: 28%; background: #1a2a4a; }
.comp-table thead th.col-match { width: 60px; text-align: center; }

.comp-table tbody tr { transition: background 0.15s; }
.comp-table tbody tr:hover { background: var(--slate-50); }
.comp-table tbody tr:nth-child(even) { background: #fafbfc; }
.comp-table tbody tr:nth-child(even):hover { background: #f0f4f8; }

.comp-table td {
    padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100); vertical-align: top;
}
.comp-table td:first-child { text-align: center; font-weight: 800; color: var(--slate-400); font-size: 0.8rem; }

.td-letters {
    font-family: monospace; font-weight: 700; font-size: 0.75rem;
    color: var(--slate-500); letter-spacing: 0.03em;
}
.td-test { color: var(--slate-700); font-size: 0.8rem; line-height: 1.5; }
.td-judge {
    font-style: italic; color: var(--green);
    font-weight: 600; font-size: 0.85rem;
    border-left: 3px solid var(--green-light); padding-left: 1rem;
}
.td-ai {
    color: var(--indigo); font-weight: 600; font-size: 0.85rem;
    border-left: 3px solid var(--blue-light); padding-left: 1rem;
}
.td-match { text-align: center; font-size: 1.1rem; }

/* Match indicators */
.match-yes { color: var(--green); }
.match-partial { color: var(--orange); }
.match-no { color: var(--red); }

/* Summary row */
.comp-table tfoot td {
    background: var(--slate-50); padding: 1rem;
    font-weight: 700; font-size: 0.85rem; color: var(--slate-800);
    border-top: 2px solid var(--slate-200);
}

/* ── DETAIL TABLE (for second-by-second analysis) ── */
.detail-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: white; border-radius: 1rem; overflow: hidden;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    margin-bottom: 2rem;
}
.detail-table thead th {
    background: var(--slate-900); color: white;
    padding: 0.8rem 1rem; font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em; text-align: left;
}
.detail-table tbody tr { transition: background 0.15s; }
.detail-table tbody tr:hover { background: var(--slate-50); }
.detail-table tbody tr:nth-child(even) { background: #fafbfc; }
.detail-table td {
    padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100); vertical-align: top;
}
.detail-table .td-time { font-family: monospace; font-weight: 800; color: var(--indigo); white-space: nowrap; }
.detail-table .td-severity-alta { color: var(--red); font-weight: 700; }
.detail-table .td-severity-media { color: var(--orange); font-weight: 700; }
.detail-table .td-severity-bassa { color: var(--green); font-weight: 700; }
.detail-table .td-penalty { font-weight: 800; color: var(--red); text-align: center; }

/* ── METHODOLOGY CARDS ── */
.method-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}
.method-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.method-card {
    background: white; border-radius: 1.5rem; padding: 2.5rem 2rem;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center;
}
.method-card .method-icon {
    width: 64px; height: 64px; background: var(--blue-light); border-radius: 1rem;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.5rem; font-size: 1.8rem;
}
.method-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.8rem; }
.method-card p { font-size: 0.85rem; color: var(--slate-500); line-height: 1.7; }
.method-card ul { text-align: left; font-size: 0.8rem; color: var(--slate-600); line-height: 1.8; margin-top: 0.8rem; padding-left: 1.2rem; }

/* ── HISTORY CARDS ── */
.history-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;
    max-width: 1000px; margin: 0 auto;
}
.history-card {
    background: white; border-radius: 1.5rem; padding: 2.5rem 2rem;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-decoration: none; color: inherit;
    transition: all 0.3s; display: block;
}
.history-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-4px); border-color: var(--indigo); }
.history-card .card-date { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.15em; color: var(--indigo); margin-bottom: 0.5rem; }
.history-card .card-title { font-size: 1.3rem; font-weight: 900; margin-bottom: 0.5rem; }
.history-card .card-meta { font-size: 0.8rem; color: var(--slate-500); line-height: 1.6; }
.history-card .card-score { font-size: 2.5rem; font-weight: 900; margin-top: 1rem; letter-spacing: -0.03em; }
.history-card .card-score small { font-size: 1rem; color: var(--indigo); }
.history-card .card-arrow { font-size: 0.8rem; font-weight: 700; color: var(--indigo); margin-top: 1.2rem; }

/* ── EVOLUTION BARS ── */
.evo-bar-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.8rem; }
.evo-bar-label { width: 140px; font-size: 0.8rem; font-weight: 700; color: var(--slate-600); text-align: right; }
.evo-bar-track { flex: 1; height: 24px; background: var(--slate-100); border-radius: 0.5rem; position: relative; overflow: hidden; }
.evo-bar-fill { height: 100%; border-radius: 0.5rem; display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem; font-size: 0.7rem; font-weight: 800; color: white; transition: width 1s ease-out; }

/* ── MYO-FASCIAL ANALYSIS ── */
.myo-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.myo-card {
    background: white; border-radius: 1.25rem; padding: 2rem;
    border: 1px solid var(--slate-200); position: relative;
    transition: box-shadow 0.2s;
}
.myo-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.myo-card-header {
    display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem;
}
.myo-icon {
    width: 48px; height: 48px; border-radius: 0.75rem;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.myo-card h4 { font-size: 0.95rem; font-weight: 800; }
.myo-label {
    display: inline-block; font-size: 0.6rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.2rem 0.6rem; border-radius: 1rem; margin-bottom: 0.8rem;
}
.myo-label-warn { background: #fef3c7; color: #92400e; }
.myo-label-ok { background: var(--green-light); color: var(--green); }
.myo-detail { font-size: 0.85rem; color: var(--slate-500); line-height: 1.7; margin-bottom: 0.5rem; }
.myo-detail strong { color: var(--slate-700); }
.myo-effect {
    margin-top: 0.8rem; padding: 0.8rem 1rem;
    background: var(--slate-50); border-radius: 0.75rem;
    font-size: 0.8rem; color: var(--slate-600); line-height: 1.6;
}

/* ── PROTOCOL PHASES ── */
.protocol-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
}
.protocol-card {
    background: white; border-radius: 1.25rem; padding: 2rem;
    border: 1px solid var(--slate-200);
    border-top: 4px solid var(--indigo);
    transition: box-shadow 0.2s;
}
.protocol-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.protocol-phase {
    font-size: 0.6rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--indigo); margin-bottom: 0.5rem;
}
.protocol-card h4 { font-size: 1rem; font-weight: 800; margin-bottom: 0.8rem; }
.protocol-card p { font-size: 0.85rem; color: var(--slate-500); line-height: 1.7; }
.protocol-why {
    margin-top: 0.8rem; padding: 0.8rem 1rem;
    background: var(--blue-light); border-radius: 0.75rem;
    font-size: 0.8rem; color: var(--slate-700); line-height: 1.6;
    font-style: italic;
}

/* ── PROJECTION TABLE ── */
.projection-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    background: white; border-radius: 1rem; overflow: hidden;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.projection-table thead th {
    background: var(--slate-900); color: white;
    padding: 0.8rem 1rem; font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em; text-align: left;
}
.projection-table tbody tr { transition: background 0.15s; }
.projection-table tbody tr:hover { background: var(--slate-50); }
.projection-table tbody tr:nth-child(even) { background: #fafbfc; }
.projection-table td {
    padding: 0.7rem 1rem; font-size: 0.85rem; color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100); vertical-align: middle;
}
.projection-table .td-gain {
    color: var(--green); font-weight: 800;
}
.projection-table tfoot td {
    background: var(--slate-50); padding: 1rem;
    font-weight: 700; font-size: 0.95rem; color: var(--slate-800);
    border-top: 2px solid var(--slate-200);
}

/* ── CORRELATION BARS ── */
.corr-bar-row { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 0.6rem; }
.corr-bar-label { width: 90px; font-size: 0.7rem; font-weight: 700; color: var(--slate-500); text-align: right; flex-shrink: 0; }
.corr-bar-track { flex: 1; height: 22px; background: var(--slate-100); border-radius: 0.4rem; overflow: hidden; }
.corr-bar-fill {
    height: 100%; border-radius: 0.4rem;
    display: flex; align-items: center; justify-content: flex-end; padding-right: 0.5rem;
    font-size: 0.65rem; font-weight: 800; color: white;
    transition: width 1.2s ease-out;
}

/* ── NAV DROPDOWN ── */
.nav-dropdown { position: relative; }
.nav-dropdown::after {
    content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 1rem;
}
.nav-dropdown-toggle {
    text-decoration: none; color: var(--slate-500); font-size: 0.75rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em; transition: color 0.2s; cursor: pointer;
}
.nav-dropdown-toggle::after { content: ' \25BE'; font-size: 0.6rem; }
.nav-dropdown-toggle:hover { color: var(--indigo); }
.nav-dropdown-toggle.active { color: var(--indigo); border-bottom: 2px solid var(--indigo); padding-bottom: 2px; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: white; border: 1px solid var(--slate-200); border-radius: 0.75rem;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); min-width: 160px; z-index: 200;
    padding: 0.5rem 0; padding-top: 1rem;
}
.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown-menu a {
    display: block; padding: 0.6rem 1.2rem; text-decoration: none;
    color: var(--slate-600); font-size: 0.75rem; font-weight: 600;
    transition: background 0.15s;
}
.nav-dropdown-menu a:hover { background: var(--slate-50); color: var(--indigo); }

/* ── RIPRESE SECTION ── */
.ripresa-section {
    max-width: 1200px; margin: 0 auto; padding: 2rem 2rem 4rem;
}
.ripresa-section-title {
    font-size: 1.2rem; font-weight: 900; letter-spacing: -0.02em;
    color: var(--slate-700); margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 0.8rem;
}
.ripresa-section-badge {
    font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.25rem 0.7rem; border-radius: 1rem;
}
.ripresa-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 1rem;
}
.ripresa-card {
    background: white; border-radius: 1rem; padding: 1.5rem;
    border: 2px solid var(--slate-200); cursor: pointer;
    transition: all 0.25s; position: relative;
}
.ripresa-card:hover { border-color: var(--indigo); box-shadow: 0 4px 16px rgba(79,70,229,0.12); transform: translateY(-2px); }
.ripresa-card.expanded { border-color: var(--indigo); background: var(--slate-50); }
.ripresa-card-name { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em; margin-bottom: 0.3rem; }
.ripresa-card-meta { font-size: 0.75rem; color: var(--slate-500); line-height: 1.6; }
.ripresa-card-meta strong { color: var(--slate-700); }
.ripresa-badge {
    display: inline-block; font-size: 0.55rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.12em;
    padding: 0.2rem 0.6rem; border-radius: 1rem; margin-top: 0.5rem;
}
.ripresa-badge-qual { background: var(--green-light); color: var(--green); }
.ripresa-badge-non-qual { background: var(--slate-100); color: var(--slate-400); }
.ripresa-badge-fei { background: #ede9fe; color: #7c3aed; }
.ripresa-card-arrow {
    position: absolute; top: 1.5rem; right: 1.5rem;
    font-size: 0.8rem; color: var(--slate-300); transition: all 0.25s;
}
.ripresa-card.expanded .ripresa-card-arrow { transform: rotate(180deg); color: var(--indigo); }

/* Expanded panel */
.ripresa-panel {
    display: none; grid-column: 1 / -1;
    background: white; border-radius: 1.25rem; padding: 2rem;
    border: 1px solid var(--slate-200); box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 1rem;
}
.ripresa-panel.open { display: block; }
.ripresa-panel-grid {
    display: grid; grid-template-columns: 1fr; gap: 2rem;
}
.ripresa-panel-svg {
    max-width: 600px; margin: 0 auto;
}

/* Movements table */
.mov-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border-radius: 0.75rem; overflow: hidden;
    border: 1px solid var(--slate-200);
}
.mov-table thead th {
    background: var(--slate-800); color: white;
    padding: 0.6rem 0.8rem; font-size: 0.65rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.1em; text-align: left;
}
.mov-table tbody tr { transition: background 0.15s; }
.mov-table tbody tr:hover { background: var(--slate-50); }
.mov-table tbody tr:nth-child(even) { background: #fafbfc; }
.mov-table td {
    padding: 0.5rem 0.8rem; font-size: 0.8rem; color: var(--slate-600);
    border-bottom: 1px solid var(--slate-100); vertical-align: top;
}
.mov-table .td-num { text-align: center; font-weight: 800; color: var(--slate-400); width: 35px; }
.mov-table .td-letters { font-family: monospace; font-weight: 700; font-size: 0.7rem; color: var(--slate-500); width: 80px; }
.mov-table .td-gait { width: 30px; text-align: center; }
.gait-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
}
.gait-trotto { background: var(--blue); }
.gait-trotto-medio { background: var(--green); }
.gait-galoppo { background: var(--orange); }
.gait-passo { background: var(--red); }
.gait-galoppo-medio { background: #7c3aed; }
.gait-galoppo-rovescio { background: #db2777; }
.gait-halt { background: var(--slate-800); }

/* Additional path styles — colors and widths only; dasharray is handled by .path-animated */
.path-galoppo-medio { stroke: #7c3aed; stroke-width: 2.5; }
.path-galoppo-rovescio { stroke: #db2777; stroke-width: 2.5; }
.path-trotto-allungato { stroke: #059669; stroke-width: 2.5; }
.path-passo-allungato { stroke: #b91c1c; stroke-width: 3; }
.path-galoppo-medio:not(.path-animated) { stroke-dasharray: 16 4; }
.path-galoppo-rovescio:not(.path-animated) { stroke-dasharray: 6 3 2 3; }
.path-trotto-allungato:not(.path-animated) { stroke-dasharray: 10 3; }
.path-passo-allungato:not(.path-animated) { stroke-dasharray: 6 2; }

/* ── SERVICE PAGE ── */
.service-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
    max-width: 1200px; margin: 0 auto; padding: 0 2rem;
}
.service-card {
    background: white; border-radius: 1.5rem; padding: 2.5rem 2rem;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    text-align: center; position: relative;
    transition: box-shadow 0.3s, transform 0.3s;
    display: flex; flex-direction: column;
}
.service-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-4px);
}
.service-card-featured {
    border: 2px solid var(--indigo);
    box-shadow: 0 4px 16px rgba(79,70,229,0.15);
}
.service-card-featured::before {
    content: 'CONSIGLIATO'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--indigo); color: white;
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.15em;
    padding: 0.3rem 1rem; border-radius: 1rem;
}
.service-tier {
    font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 0.15em; color: var(--slate-400); margin-bottom: 0.5rem;
}
.service-price {
    font-size: 3rem; font-weight: 900; letter-spacing: -0.03em;
    margin-bottom: 1.5rem; line-height: 1;
}
.service-price small { font-size: 1.2rem; color: var(--slate-400); }
.service-features {
    list-style: none; text-align: left; font-size: 0.85rem;
    color: var(--slate-600); line-height: 2.4; margin-bottom: 2rem;
    padding-left: 0; flex: 1;
}
.service-features li::before {
    content: '\2713'; color: var(--green); font-weight: 800;
    margin-right: 0.5rem;
}
.service-features li.disabled {
    color: var(--slate-300);
}
.service-features li.disabled::before { content: '\2717'; color: var(--slate-300); }

/* ── SERVICE FORM ── */
.service-form {
    max-width: 700px; margin: 0 auto;
    background: white; border-radius: 1.5rem; padding: 3rem;
    border: 1px solid var(--slate-200); box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-label {
    display: block; font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--slate-500); margin-bottom: 0.5rem;
}
.form-input, .form-select {
    width: 100%; padding: 0.75rem 1rem; border: 2px solid var(--slate-200);
    border-radius: 0.75rem; font-family: 'Inter', sans-serif;
    font-size: 0.9rem; color: var(--slate-800); background: white;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus { outline: none; border-color: var(--indigo); }
.form-hint {
    display: block; font-size: 0.75rem; color: var(--slate-400);
    margin-top: 0.3rem;
}

/* ── STEPS / HOW IT WORKS ── */
.steps-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
    max-width: 900px; margin: 0 auto 4rem; padding: 0 2rem;
}
.step-card { text-align: center; padding: 2rem; }
.step-number {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--indigo); color: white;
    font-size: 1.2rem; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
}
.step-card h3 { font-size: 1rem; font-weight: 800; margin-bottom: 0.5rem; }
.step-card p { font-size: 0.85rem; color: var(--slate-500); line-height: 1.6; }

/* ── VIDEO REQUIREMENTS BOX ── */
.video-req {
    max-width: 700px; margin: 0 auto 4rem; padding: 2rem 2.5rem;
    background: #fef7ed; border: 2px solid #fed7aa; border-radius: 1.25rem;
}
.video-req h3 {
    font-size: 0.9rem; font-weight: 800; margin-bottom: 0.8rem;
    color: var(--orange);
}
.video-req ul {
    list-style: none; padding: 0; font-size: 0.85rem;
    color: var(--slate-600); line-height: 2.2;
}
.video-req ul li::before {
    content: '\26A0\FE0F'; margin-right: 0.5rem;
}

/* ── FAQ ACCORDION ── */
.faq-section {
    max-width: 700px; margin: 0 auto; padding: 0 2rem 4rem;
}
.faq-item {
    border-bottom: 1px solid var(--slate-200);
}
.faq-question {
    width: 100%; text-align: left; background: none; border: none;
    padding: 1.2rem 0; font-family: 'Inter', sans-serif;
    font-size: 0.95rem; font-weight: 700; color: var(--slate-800);
    cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; transition: color 0.2s;
}
.faq-question:hover { color: var(--indigo); }
.faq-question::after {
    content: '+'; font-size: 1.3rem; font-weight: 300; color: var(--slate-400);
    transition: transform 0.3s;
}
.faq-item.open .faq-question::after { content: '\2212'; color: var(--indigo); }
.faq-answer {
    max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out;
}
.faq-answer-inner {
    padding: 0 0 1.2rem;
    font-size: 0.85rem; color: var(--slate-500); line-height: 1.8;
}
.faq-item.open .faq-answer { max-height: 300px; }

/* ── THANK YOU PAGE ── */
.grazie-section {
    text-align: center; max-width: 600px; margin: 0 auto; padding: 6rem 2rem;
}
.grazie-icon {
    width: 80px; height: 80px; border-radius: 50%;
    background: var(--green-light); color: var(--green);
    font-size: 2.5rem; display: flex; align-items: center; justify-content: center;
    margin: 0 auto 2rem;
}
.grazie-section h1 {
    font-size: 2rem; font-weight: 900; margin-bottom: 1rem;
}
.grazie-section p {
    font-size: 1rem; color: var(--slate-500); line-height: 1.8; margin-bottom: 1rem;
}
.grazie-email {
    font-family: monospace; font-weight: 700; color: var(--indigo);
    font-size: 1.1rem;
}

/* ── TIER SELECTED STATE ── */
.service-card.selected {
    border-color: var(--indigo); background: var(--slate-50);
}

/* ── FOOTER ── */
.footer {
    text-align: center; padding: 4rem 2rem;
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.3em;
    color: var(--slate-300); font-weight: 700;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .arena-grid { grid-template-columns: 1fr; }
    .analysis-grid { grid-template-columns: 1fr; }
    .comparison-grid { grid-template-columns: 1fr; }
    .score-banner { flex-direction: column; text-align: center; }
    .nav-links { display: none; }
    .method-grid, .method-grid-4 { grid-template-columns: 1fr; }
    .history-grid { grid-template-columns: 1fr; }
    .comp-table { font-size: 0.75rem; display: block; overflow-x: auto; }
    .comp-table td, .comp-table thead th { padding: 0.5rem 0.6rem; font-size: 0.7rem; }
    .myo-grid { grid-template-columns: 1fr; }
    .protocol-grid { grid-template-columns: 1fr; }
    .projection-table { display: block; overflow-x: auto; }
    .ripresa-grid { grid-template-columns: 1fr; }
    .ripresa-panel-svg { max-width: 100%; }
    .nav-dropdown-menu { left: 0; transform: none; }
    .service-grid { grid-template-columns: 1fr; max-width: 400px; }
    .steps-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .hero h1 { font-size: 2rem; }
    .score-number { font-size: 3rem; }
    .arena-svg-wrapper { padding: 0.8rem; }
}

/* ═══════════ AI TRANSPARENCY ═══════════ */
.ai-transparency-banner {
    margin: 0 0 2rem;
    padding: 1.2rem 1.5rem;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-left: 4px solid #f59e0b;
    border-radius: 0.75rem;
    max-width: 900px;
}
.ai-transparency-banner p {
    font-size: 0.82rem;
    line-height: 1.7;
    color: #92400e;
    margin: 0;
}
.ai-transparency-banner strong {
    color: #78350f;
}
.ai-transparency-banner .ai-banner-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #b45309;
    margin-bottom: 0.6rem;
}
.ai-methodology-note {
    margin: 2rem 0 0;
    padding: 2rem 2.5rem;
    background: linear-gradient(135deg, #eff6ff, #f0fdf4);
    border: 1px solid #bfdbfe;
    border-radius: 1rem;
    max-width: 900px;
}
.ai-methodology-note h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--slate-800);
    margin-bottom: 1rem;
}
.ai-methodology-note p {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--slate-600);
    margin-bottom: 0.8rem;
}
.ai-methodology-note p:last-child { margin-bottom: 0; }
