/* Nutrition Log -- only what Core's shared theme doesn't already cover.
   Macro colours are fixed across the whole plugin so a colour always means
   the same macro: carbs = orange, protein = teal, fat = red. */

.ldn-seg-carb    { background: #FF9100; }
.ldn-seg-protein { background: #00B7CD; }
.ldn-seg-fat     { background: #DF301C; }

.ldn-macrobar {
    display: flex;
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    margin: 14px 0 8px;
    background: var(--ldc-cream);
}
.ldn-macrobar .ldn-seg { display: block; height: 100%; }

.ldn-macrolegend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--ldc-text-muted);
    font-weight: 600;
}
.ldn-macrolegend.ldn-legend-center { justify-content: center; padding: 4px 0 2px; }

.ldn-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: baseline;
}

.ldn-macro-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 420px) {
    .ldn-macro-inputs { grid-template-columns: 1fr; }
}

.ldn-live-kcal {
    margin: 4px 0 16px;
    font-size: 13px;
    color: var(--ldc-text-muted);
}
.ldn-live-kcal strong {
    font-family: var(--ldc-font-display);
    font-size: 17px;
    color: var(--ldc-red);
}

.ldn-daynav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--ldc-border);
    font-family: var(--ldc-font-display);
}

.ldn-chart-axis {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #a9793f;
    padding: 2px 2px 4px;
}

.ldn-meal {
    border: 1px solid var(--ldc-border);
    border-radius: var(--ldc-radius-sm);
    padding: 10px 12px;
    margin-bottom: 10px;
    background: #fff;
}
.ldn-meal-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}
.ldn-meal-name {
    font-family: var(--ldc-font-display);
    font-weight: 600;
    font-size: 14px;
}
.ldn-meal-name .ldw-muted { margin-left: 6px; }
.ldn-meal-kcal {
    font-family: var(--ldc-font-display);
    font-weight: 700;
    color: var(--ldc-red);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ldn-meal-food {
    font-size: 13px;
    color: var(--ldc-text);
    margin-top: 2px;
}
.ldn-meal-macros {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ldc-text-muted);
    font-variant-numeric: tabular-nums;
}
.ldn-meal-actions {
    margin-left: auto;
    display: flex;
    gap: 10px;
    align-items: center;
}
.ldn-delete-form { display: inline; margin: 0; }

/* shared with the weight plugin's muted caption style, redefined here so the
   nutrition plugin still looks right if used on its own */
.ldn-page .ldw-muted {
    color: var(--ldc-text-muted);
    font-size: 11px;
    font-weight: 400;
}

/* ---- food calculator ---- */
.ldn-calc {
    background: var(--ldc-cream);
    border: 1px dashed var(--ldc-orange);
    border-radius: var(--ldc-radius-sm);
    padding: 14px;
    margin-bottom: 16px;
}
.ldn-calc-title {
    font-family: var(--ldc-font-display);
    font-weight: 600;
    color: var(--ldc-red);
    font-size: 14px;
    margin-bottom: 4px;
}
.ldn-calc .ldc-hint { margin-bottom: 12px; }

.ldn-calc-row {
    display: grid;
    grid-template-columns: 1fr 90px 130px;
    gap: 10px;
    align-items: end;
}
@media (max-width: 520px) {
    .ldn-calc-row { grid-template-columns: 1fr 1fr; }
    .ldn-calc-row > .ldc-field:first-child { grid-column: 1 / -1; }
}
.ldn-calc-row .ldc-field { margin-bottom: 0; }
.ldn-calc-row select,
.ldn-calc-row input {
    width: 100%;
    padding: 10px 10px;
    border: 1px solid var(--ldc-border);
    border-radius: var(--ldc-radius-sm);
    font-size: 15px;
    background: #fff;
    color: var(--ldc-text);
}
.ldn-calc-row label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #55483a;
    margin-bottom: 4px;
}

.ldn-calc-add { margin-top: 4px; }

.ldn-calc-list { margin-top: 12px; }
.ldn-calc-empty {
    font-size: 12px;
    color: var(--ldc-text-muted);
    padding: 6px 0;
}
.ldn-calc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--ldc-border);
    border-radius: 999px;
    padding: 7px 14px;
    margin-bottom: 6px;
    font-size: 13px;
}
.ldn-calc-item-name { flex: 1; min-width: 0; }
.ldn-calc-item-kcal {
    font-family: var(--ldc-font-display);
    font-weight: 700;
    color: var(--ldc-red);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ldn-calc-note { margin-top: 10px; }
.ldn-macro-intro { margin-bottom: 10px; }
