.nutrition-hero,
.nutrition-card {
    border: 1px solid rgba(105, 217, 205, 0.18);
    background: linear-gradient(155deg, rgba(21, 47, 48, 0.96), rgba(18, 27, 34, 0.96));
}

.nutrition-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px;
    gap: 14px;
    align-items: center;
    overflow: hidden;
}

.nutrition-hero img {
    width: 100%;
    max-height: 120px;
    object-fit: contain;
}

.nutrition-date-row,
.nutrition-form-grid,
.nutrition-total-grid,
.nutrition-home-grid {
    display: grid;
    gap: 10px;
}

.nutrition-date-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
}

.nutrition-date-row input,
.nutrition-form-grid input,
.nutrition-form-grid select {
    margin-bottom: 0;
}

.nutrition-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nutrition-field-wide {
    grid-column: 1 / -1;
}

.nutrition-label {
    display: grid;
    gap: 6px;
    color: #b8c6c6;
    font-size: 12px;
    font-weight: 700;
}

.nutrition-total-grid,
.nutrition-home-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nutrition-metric,
.nutrition-home-metric {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(151, 232, 222, 0.13);
    border-radius: 14px;
    background: rgba(5, 15, 18, 0.46);
}

.nutrition-metric span,
.nutrition-home-metric span {
    display: block;
    margin-bottom: 6px;
    color: #8fa4a5;
    font-size: 11px;
    text-transform: uppercase;
}

.nutrition-metric strong,
.nutrition-home-metric strong {
    display: block;
    overflow: hidden;
    color: #f5ffff;
    font-size: 19px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nutrition-progress {
    height: 7px;
    margin-top: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.nutrition-progress > span {
    display: block;
    width: 0;
    height: 100%;
    margin: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #27b9a8, #74eecb);
    transition: width 220ms ease;
}

.nutrition-progress > span.is-complete {
    background: linear-gradient(90deg, #78c947, #d5f46d);
}

.nutrition-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nutrition-entry:last-child {
    border-bottom: 0;
}

.nutrition-entry-title {
    overflow-wrap: anywhere;
    font-weight: 800;
}

.nutrition-entry-meta {
    margin-top: 4px;
    color: #91a5a6;
    font-size: 12px;
}

.nutrition-delete-button {
    width: auto;
    min-width: 44px;
    padding: 10px;
    background: rgba(135, 59, 59, 0.72);
}

.nutrition-badge-list {
    display: flex;
    gap: 9px;
    padding-bottom: 4px;
    overflow-x: auto;
}

.nutrition-badge {
    min-width: 145px;
    padding: 12px;
    border: 1px solid rgba(222, 241, 110, 0.24);
    border-radius: 15px;
    background: rgba(44, 58, 23, 0.48);
}

.nutrition-badge strong {
    display: block;
    margin-bottom: 4px;
    color: #ddf36e;
}

.nutrition-status {
    min-height: 20px;
    margin-top: 10px;
    color: #9caeae;
    font-size: 12px;
    line-height: 1.45;
}

.nutrition-status.error {
    color: #ffaaaa;
}

.nutrition-status.success {
    color: #8fe5db;
}

.nutrition-reminder-card {
    display: grid;
    gap: 12px;
}

.nutrition-reminder-toggle {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    color: #efffff;
    font-weight: 800;
}

.nutrition-reminder-toggle input {
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: #38c9b8;
}

.nutrition-home-card {
    cursor: default;
}

.nutrition-home-metric {
    width: 100%;
    text-align: left;
}

.nutrition-home-metric:hover,
.nutrition-home-metric:focus-visible {
    border-color: rgba(105, 217, 205, 0.55);
}

.nutrition-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(1, 7, 9, 0.82);
    backdrop-filter: blur(8px);
}

.nutrition-modal[hidden] {
    display: none;
}

.nutrition-modal-card {
    width: min(100%, 470px);
    max-height: min(760px, 92vh);
    padding: 20px;
    overflow-y: auto;
    border: 1px solid rgba(112, 226, 212, 0.3);
    border-radius: 22px;
    background: linear-gradient(155deg, #13292b, #111921);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.nutrition-equivalent-layout {
    display: grid;
    grid-template-columns: 125px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.nutrition-equivalent-layout img {
    width: 100%;
    max-height: 160px;
    object-fit: contain;
}

.nutrition-speech {
    position: relative;
    padding: 14px;
    border-radius: 16px;
    background: #f4ffff;
    color: #102123;
    line-height: 1.45;
}

.nutrition-speech::before {
    position: absolute;
    top: 50%;
    left: -12px;
    border-width: 9px 12px 9px 0;
    border-style: solid;
    border-color: transparent #f4ffff transparent transparent;
    content: "";
}

@media (max-width: 390px) {
    .nutrition-hero {
        grid-template-columns: minmax(0, 1fr) 76px;
    }

    .nutrition-form-grid {
        grid-template-columns: 1fr;
    }

    .nutrition-field-wide {
        grid-column: auto;
    }

    .nutrition-equivalent-layout {
        grid-template-columns: 92px minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nutrition-progress > span {
        transition: none;
    }
}
