.afd-app{--afd-border:#dce3eb;--afd-muted:#627083;--afd-ink:#172538;color:var(--afd-ink);font:inherit;max-width:1200px;margin:0 auto}
.afd-app *{box-sizing:border-box}
.afd-panel{border:1px solid var(--afd-border);border-radius:14px;padding:20px;margin:18px 0;background:#fff}
.afd-controls{display:grid;grid-template-columns:repeat(auto-fit,minmax(175px,1fr));gap:14px;align-items:end}
.afd-field label{display:block;font-weight:600;font-size:.92rem;margin-bottom:6px}
.afd-field select,.afd-field input{width:100%;min-height:44px;padding:9px 11px;border:1px solid #bac5d2;border-radius:8px;background:#fff;color:inherit;font:inherit}
.afd-button{display:inline-flex;align-items:center;justify-content:center;min-height:43px;padding:9px 16px;border:0;border-radius:8px;background:#155eef;color:#fff;font:inherit;font-weight:650;cursor:pointer;text-decoration:none}
.afd-button:hover{filter:brightness(.94)}
.afd-button:disabled{opacity:.6;cursor:wait}
.afd-button-secondary{background:#edf2f7;color:#172538}
.afd-status{margin:14px 0;color:var(--afd-muted)}
.afd-status[aria-busy=true]:before{content:"";display:inline-block;width:12px;height:12px;margin-right:8px;border:2px solid #bac5d2;border-top-color:#155eef;border-radius:50%;animation:afd-spin .8s linear infinite}
@keyframes afd-spin{to{transform:rotate(360deg)}}
.afd-results{overflow-x:auto;max-width:100%}
.afd-table{width:100%;border-collapse:collapse;font-size:.95rem}
.afd-table th,.afd-table td{padding:11px 12px;border-bottom:1px solid var(--afd-border);text-align:left;vertical-align:top}
.afd-table th{background:#f4f7fb;font-weight:700}
.afd-table tbody tr:hover{background:#f8fafc}
.afd-table td:last-child,.afd-table th:last-child{text-align:right;font-variant-numeric:tabular-nums}
.afd-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.afd-metric{padding:16px;border:1px solid var(--afd-border);border-radius:10px;background:#f8fafc}
.afd-metric span,.afd-metric small{display:block;color:var(--afd-muted)}
.afd-metric strong{display:block;font-size:1.45rem;overflow-wrap:anywhere;margin:6px 0}
.afd-chart-wrap{position:relative;min-height:260px;margin-top:18px}
.afd-chart{display:block;width:100%;height:auto;min-height:220px}
.afd-legend{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px;color:var(--afd-muted);font-size:.9rem}
.afd-legend span:before{content:"";display:inline-block;width:10px;height:10px;margin-right:6px;border-radius:50%;background:currentColor}
.afd-note{font-size:.9rem;color:var(--afd-muted)}
.afd-error{padding:12px;border-left:4px solid #b42318;background:#fff4f2;color:#7a271a}
.afd-success{color:#067647}
.afd-downloads{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.afd-rank{display:inline-flex;min-width:30px;justify-content:center;padding:3px 7px;border-radius:6px;background:#edf2f7;font-weight:700}
.afd-checks{display:flex;flex-wrap:wrap;gap:12px}
.afd-checks label{display:flex;align-items:center;gap:7px}
.afd-app canvas{max-width:100%}
@media(max-width:600px){.afd-panel{padding:14px}.afd-table{font-size:.85rem}.afd-table th,.afd-table td{padding:8px}.afd-chart-wrap{min-height:220px}}


/* Accessible country checklist and chart layout */
.afd-country-picker{grid-column:1/-1;min-width:0}
.afd-country-search{width:100%;min-height:42px;padding:9px 11px;border:1px solid #bac5d2;border-radius:8px;font:inherit;margin:5px 0 8px}
.afd-country-checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px;max-height:260px;overflow:auto;padding:12px;border:1px solid #dce3eb;border-radius:8px;background:#fbfcfe}
.afd-country-option{display:flex;align-items:center;gap:8px;padding:5px;border-radius:5px;cursor:pointer}
.afd-country-option input{width:17px;height:17px;flex:0 0 auto}
.afd-country-option[hidden]{display:none}
.afd-country-count{margin:4px 0}
.afd-comparison-controls{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
.afd-pie-layout{display:flex;flex-wrap:wrap;align-items:center;gap:20px}
.afd-pie-chart{width:min(100%,520px);flex:1 1 320px}
.afd-pie-legend{display:grid;gap:9px;flex:1 1 220px}
.afd-pie-legend-item{display:flex;align-items:center;gap:8px}
.afd-pie-swatch{display:inline-block;width:13px;height:13px;border-radius:3px;flex:0 0 auto}

/* Comparison results view tabs */
.afd-view-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:18px 0 14px}
.afd-view-tab{min-height:40px}
.afd-view-tab.is-active{background:#175df5;color:#fff;border-color:#175df5}
.afd-view-panel[hidden]{display:none!important}
.afd-view-panel h3{font-size:1.05rem;margin:12px 0}
