.tae-dc-wrap {
    font-family: inherit;
    text-align: center;
}

/* Header */
.tae-dc-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e67e22;
    margin: 0 0 6px;
    letter-spacing: 0.03em;
}
.tae-dc-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
    line-height: 1.3;
}
.tae-dc-subtitle {
    font-size: 0.8rem;
    color: #888;
    margin: 0 0 24px;
}

/* Body: chart + legend - responsive layout */
.tae-dc-body {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 40px; /* Default, can be overridden by Elementor controls */
    flex-wrap: wrap;
}

/* Canvas wrapper - fully responsive */
.tae-dc-canvas-wrap {
    position: relative;
    width: 320px; /* Default, overridden by Elementor controls */
    height: 320px; /* Default, overridden by Elementor controls */
    flex-shrink: 0;
    max-width: 100%;
}
.tae-dc-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Legend + Summary - flexible */
.tae-dc-legend-wrap {
    text-align: left;
    min-width: 200px;
    flex: 1;
    max-width: 350px;
}

/* Summary */
.tae-dc-summary {
    margin-bottom: 20px;
}
.tae-dc-sum-label {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}
.tae-dc-sum-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4caf50;
    margin: 0;
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.tae-dc-sum-unit {
    font-size: 0.9rem;
    font-weight: 400;
    color: #666;
}

/* Legend list */
.tae-dc-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.tae-dc-legend-item {
    display: block;
    font-size: 0.85rem;
    color: #333;
    line-height: 1.6;
}
.tae-dc-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}
.tae-dc-legend-label {
    display: inline;
    color: #555;
    margin-right: 8px;
}
.tae-dc-legend-value {
    display: inline;
    font-weight: 700;
    color: #1a1a1a;
    margin-right: 4px;
}
.tae-dc-legend-unit {
    display: inline;
    font-size: 0.75rem;
    color: #888;
}

/* Responsive fallbacks - only apply if Elementor controls are not set */
@media (max-width: 767px) {
    .tae-dc-body:not([style*="flex-direction"]) {
        flex-direction: column;
        align-items: center;
    }
    .tae-dc-body:not([style*="gap"]) {
        gap: 20px;
    }
    .tae-dc-canvas-wrap:not([style*="width"]) {
        width: min(280px, 80vw);
        height: min(280px, 80vw);
    }
    .tae-dc-legend-wrap {
        width: 100%;
        max-width: none;
        text-align: center;
    }
    .tae-dc-sum-value {
        font-size: clamp(1.5rem, 6vw, 2rem);
        justify-content: center;
    }
    .tae-dc-legend {
        justify-content: center;
        align-items: center;
    }
    .tae-dc-legend-item {
        text-align: center;
    }
}

/* Tablet responsive fallbacks */
@media (min-width: 768px) and (max-width: 1024px) {
    .tae-dc-canvas-wrap:not([style*="width"]) {
        width: min(300px, 40vw);
        height: min(300px, 40vw);
    }
    .tae-dc-body:not([style*="gap"]) {
        gap: 30px;
    }
}

/* Large screens - ensure chart doesn't get too big */
@media (min-width: 1200px) {
    .tae-dc-canvas-wrap:not([style*="width"]) {
        max-width: 450px;
        max-height: 450px;
    }
}

/* Layout utilities for better responsive control */
.tae-dc-body[style*="flex-direction: column"] .tae-dc-legend-wrap {
    text-align: center;
    width: 100%;
    max-width: none;
}

.tae-dc-body[style*="flex-direction: column"] .tae-dc-sum-value {
    justify-content: center;
}

.tae-dc-body[style*="flex-direction: column"] .tae-dc-legend {
    justify-content: center;
    align-items: center;
}

.tae-dc-body[style*="flex-direction: column"] .tae-dc-legend-item {
    text-align: center;
}

/* Ensure canvas maintains aspect ratio */
.tae-dc-canvas-wrap {
    aspect-ratio: 1 / 1;
}

/* Better text wrapping for long labels */
.tae-dc-legend-label {
    word-wrap: break-word;
    hyphens: auto;
}
