/* Shared nutrition rings: factual values, never implied progress-to-target.
   The ring is an SVG disc (62x62, r26, 6px stroke) matching the mobile design
   handoff. The colored arc is a faithful decorative container for the factual
   macro number in its center — the app has no user-set macro TARGET, so we do
   NOT imply progress against a fabricated goal (Ramekin explainability rule).
   The arc renders as a full ring; the number is the truth it frames. */
.macro-ring-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.macro-ring {
    --macro-ring-color: #387a98;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.macro-ring--calories { --macro-ring-color: #387a98; }
.macro-ring--protein { --macro-ring-color: #6bc4ed; }
.macro-ring--carbs { --macro-ring-color: #e5a028; }
.macro-ring--fat { --macro-ring-color: #4a9d5b; }

.macro-ring-disc {
    position: relative;
    width: 62px;
    height: 62px;
    flex: none;
}

.macro-ring-svg {
    display: block;
    width: 62px;
    height: 62px;
}

.macro-ring-track {
    fill: none;
    stroke: #edeff0;
    stroke-width: 6;
}

.macro-ring-arc {
    fill: none;
    stroke: var(--macro-ring-color);
    stroke-width: 6;
    stroke-linecap: round;
    /* Full ring (2*pi*26 ~= 164). Honest container, not a target gauge. */
    stroke-dasharray: 164 164;
    transition: stroke-dasharray 0.4s ease;
}

.macro-ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 0 4px;
    overflow: hidden;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.05;
    color: var(--text-primary, #0f232b);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.macro-ring-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    color: var(--text-primary, #0f232b);
}

/* A macro with no data: dashed grey track, no colored arc. */
.macro-ring.is-missing .macro-ring-track {
    stroke: var(--border-subtle, #d5dadd);
    stroke-dasharray: 3 4;
}

.macro-ring.is-missing .macro-ring-arc {
    stroke: transparent;
}

@media (min-width: 700px) {
    .macro-ring-grid { gap: 16px; }
}
