/* Grafici del Foglio — ogni regola CSS resta nel namespace del widget. */
.miuf-chart { background: transparent !important; --miuf-widget-accent: #F37262; }
.miuf-chart__accent { display:block; width:50px; height:5px; border-radius:4px; background:var(--miuf-widget-accent); margin-bottom:12px; }
.miuf-chart__title { margin:0 0 .55rem !important; color:inherit; font:inherit; font-weight:800; font-size:clamp(1.1rem,2.4vw,1.5rem); line-height:1.3; }
.miuf-chart__description { margin:0 0 .8rem !important; font-size:1rem; line-height:1.5; }
.miuf-chart__svg { display:block; width:100%; height:auto; max-width:100%; overflow:visible; color:inherit; background:transparent; }
.miuf-chart__svg--donut, .miuf-chart__preview-svg--donut { max-width:420px; margin-inline:auto; }
.miuf-chart__svg-label { fill:currentColor; font-size:12px; font-family:inherit; }
.miuf-chart__svg-small { fill:currentColor; font-size:11px; font-weight:650; font-family:inherit; }
.miuf-chart__svg-total { fill:currentColor; font-size:20px; font-weight:800; font-family:inherit; }
.miuf-chart__axis { stroke:currentColor; stroke-opacity:.26; stroke-width:1.2; }
.miuf-chart__data { border-top:1px solid currentColor; border-bottom:1px solid currentColor; border-color:rgba(120,120,120,.22); margin-top:12px; }
.miuf-chart__data summary { cursor:pointer; padding:10px 2px; font-size:.88rem; font-weight:700; }
.miuf-chart__data summary:focus-visible { outline:3px solid var(--miuf-widget-accent); outline-offset:2px; }
.miuf-chart__table-scroll { overflow-x:auto; }
.miuf-chart__data table { width:100%; border-collapse:collapse; margin:0 0 12px; font-size:.87rem; color:inherit; }
.miuf-chart__data caption { text-align:left; font-weight:700; margin:5px 0; }
.miuf-chart__data th, .miuf-chart__data td { background:transparent; color:inherit; border-bottom:1px solid rgba(120,120,120,.17); padding:7px 10px; text-align:left; }
.miuf-chart__data td { text-align:right; font-variant-numeric:tabular-nums; }
.miuf-chart__source { margin:.7rem 0 0 !important; font-size:.79rem; opacity:.8; line-height:1.5; }
.miuf-chart__source a { color:inherit; text-decoration:underline; text-underline-offset:2px; }
.miuf-chart__source a:focus-visible { outline:3px solid var(--miuf-widget-accent); outline-offset:2px; }
.miuf-chart__editor-row { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:8px; padding:10px 0; border-bottom:1px solid rgba(120,120,120,.22); align-items:start; }
.miuf-chart__editor-row .components-base-control { margin-bottom:0; }
.miuf-chart__editor-actions { display:flex; align-items:center; justify-content:flex-end; gap:7px; flex-wrap:wrap; }
.miuf-chart__editor-note { font-size:.82rem; opacity:.8; margin:8px 0 !important; }
.miuf-chart__color-row { display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
.miuf-chart__color-swatch { width:21px; height:21px; border-radius:50%; border:1px solid rgba(120,120,120,.35); }
.miuf-chart__preview { padding:0; background:transparent; width:100%; max-width:100%; }
.miuf-chart__preview-svg { width:100%; height:auto; max-width:100%; }
@media (max-width:540px) {
  .miuf-chart__editor-row { grid-template-columns:1fr; }
  .miuf-chart__data th, .miuf-chart__data td { padding:6px; }
}
@media (prefers-reduced-motion:reduce) {
  .miuf-chart * { animation:none !important; transition:none !important; }
}

/* Legenda leggibile senza aprire la tabella; stessa disposizione su editor e frontend. */
.miuf-chart__legend {
    list-style: none;
    padding: 0 !important;
    margin: 4px 0 12px !important;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr));
    gap: 8px 18px;
    max-width: 100%;
}
.miuf-chart__legend-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 8px;
    margin: 0 !important;
    padding: 4px 0;
    color: inherit;
    font-size: .87rem;
    line-height: 1.35;
    min-width: 0;
}
.miuf-chart__legend-swatch {
    display: inline-block;
    flex: 0 0 13px;
    height: 13px;
    width: 13px;
    border: 1px solid rgba(120,120,120,.25);
    border-radius: 3px;
}
.miuf-chart__legend-label { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.miuf-chart__legend-value { color: inherit; opacity: .75; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
