/* ═══════════════════════════════════════════════════════════════════════════
 *  DRI Calculator — styles
 *  @since 2.4.0
 * ═══════════════════════════════════════════════════════════════════════════ */

.mipb-dri-wrap {
    max-width: 900px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Profile bar ───────────────────────────────────────────────────────── */
.mipb-dri-profile-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #e8f5e3 0%, #f0f8ed 100%);
    border: 1.5px solid #cde0c5;
    border-radius: 12px;
    margin-bottom: 20px;
    color: #2d5a27;
    font-size: 14px;
    flex-wrap: wrap;
}
.mipb-dri-profile-bar svg { opacity: .7; flex-shrink: 0; }
.mipb-dri-link {
    color: #1565c0;
    font-size: 13px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}
.mipb-dri-link:hover { text-decoration: underline; }

/* ── Form ──────────────────────────────────────────────────────────────── */
.mipb-dri-form {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    padding: 28px 24px;
    margin-bottom: 24px;
}
.mipb-dri-form-title {
    margin: 0 0 20px;
    font-size: 18px;
    color: #2d5a27;
    font-weight: 700;
}
.mipb-dri-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
}
.mipb-dri-field { margin-bottom: 18px; }
.mipb-dri-field-full { grid-column: 1 / -1; }
.mipb-dri-form-footer { grid-column: 1 / -1; text-align: center; }

/* ── Collapse / expand transition ─────────────────────────────────────── */
.mipb-dri-form.collapsed {
    display: none;
}
.mipb-dri-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}
.mipb-dri-optional { font-weight: 400; color: #888; font-size: 12px; }
.mipb-dri-input {
    width: 100%;
    max-width: 200px;
    padding: 9px 12px;
    border: 1.5px solid #cde0c5;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color .15s;
}
.mipb-dri-input:focus { outline: none; border-color: #4a8c3f; box-shadow: 0 0 0 3px rgba(74,140,63,.12); }

.mipb-dri-unit-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Button groups */
.mipb-dri-btn-group { display: flex; gap: 6px; flex-wrap: wrap; }
.mipb-dri-btn {
    padding: 9px 18px;
    border: 1.5px solid #cde0c5;
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: all .15s;
}
.mipb-dri-btn:hover { border-color: #4a8c3f; color: #2d5a27; }
.mipb-dri-btn.active { background: #2d5a27; color: #fff; border-color: #2d5a27; }
.mipb-dri-btn-sm { padding: 6px 12px; font-size: 12px; }

.mipb-dri-activity-group { gap: 4px; }

/* Calculate button */
.mipb-dri-calculate-btn {
    display: block;
    width: 100%;
    max-width: 360px;
    margin: 24px auto 0;
    padding: 14px 24px;
    background: linear-gradient(135deg, #2d5a27, #4a8c3f);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
}
.mipb-dri-calculate-btn:hover { opacity: .9; }

.mipb-dri-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    font-size: 12px;
    color: #888;
}
.mipb-dri-privacy-note svg { opacity: .5; }

/* ── Stage label ───────────────────────────────────────────────────────── */
.mipb-dri-stage-label {
    font-size: 15px;
    color: #333;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2d5a27;
}
.mipb-dri-age-note { color: #888; font-weight: 400; }

/* ── Calorie card ──────────────────────────────────────────────────────── */
.mipb-dri-calorie-card {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.mipb-dri-calorie-inner {
    flex: 1;
    min-width: 180px;
    background: linear-gradient(135deg, #2d5a27, #4a8c3f);
    color: #fff;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}
.mipb-dri-calorie-val { font-size: 32px; font-weight: 800; line-height: 1.1; }
.mipb-dri-calorie-unit { font-size: 14px; opacity: .85; margin-top: 4px; font-weight: 600; }
.mipb-dri-calorie-note { font-size: 11px; opacity: .65; margin-top: 8px; }

/* ── Nutrient tables ───────────────────────────────────────────────────── */
.mipb-dri-group { margin-bottom: 28px; }
.mipb-dri-group-title {
    font-size: 16px;
    font-weight: 700;
    color: #2d5a27;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #e8f5e3;
}
.mipb-dri-table-wrap { overflow-x: auto; }
.mipb-dri-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.mipb-dri-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #666;
    padding: 8px 10px;
    border-bottom: 2px solid #e0e0e0;
    white-space: nowrap;
}
.mipb-dri-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}
.mipb-dri-table tbody tr:hover { background: #f8fdf6; }

.mipb-dri-td-name { min-width: 140px; }
.mipb-dri-nutrient-name { font-weight: 600; color: #333; }
.mipb-dri-td-value { white-space: nowrap; }
.mipb-dri-td-type { width: 50px; text-align: center; }
.mipb-dri-td-ul { white-space: nowrap; color: #888; }
.mipb-dri-td-fda { white-space: nowrap; color: #888; }
.mipb-dri-td-bar { width: 80px; }
.mipb-dri-th-bar { width: 80px; }

.mipb-dri-unit { font-size: 11px; color: #888; font-weight: 400; }
.mipb-dri-nd { color: #bbb; font-style: italic; font-size: 11px; }

/* Type badges */
.mipb-dri-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.mipb-dri-type-rda { background: #e8f5e3; color: #2d5a27; }
.mipb-dri-type-ai  { background: #e3f2fd; color: #1565c0; }

/* Personal tag */
.mipb-dri-personal-tag {
    font-size: 10px;
    color: #1565c0;
    font-weight: 600;
    background: #e3f2fd;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

/* UL bar */
.mipb-dri-bar-wrap {
    width: 60px;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}
.mipb-dri-bar {
    height: 100%;
    border-radius: 4px;
    transition: width .3s;
}

/* ── Footnotes ─────────────────────────────────────────────────────────── */
.mipb-dri-footnotes {
    margin-top: 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 12px;
    color: #666;
    line-height: 1.7;
}
.mipb-dri-footnotes ul {
    margin: 0;
    padding: 0 0 0 18px;
}
.mipb-dri-footnotes li { margin-bottom: 4px; }

/* ── Actions ───────────────────────────────────────────────────────────── */
.mipb-dri-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.mipb-dri-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #2d5a27;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.mipb-dri-save-btn:hover { background: #4a8c3f; }
.mipb-dri-save-btn:disabled { opacity: .6; cursor: not-allowed; }

/* ── Mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .mipb-dri-form-grid { grid-template-columns: 1fr; }
    .mipb-dri-form { padding: 18px 14px; }
    .mipb-dri-calorie-card { flex-direction: column; }
    .mipb-dri-table { font-size: 12px; }
    .mipb-dri-table th, .mipb-dri-table td { padding: 7px 6px; }
    .mipb-dri-td-bar, .mipb-dri-th-bar { display: none; }
    .mipb-dri-td-fda { display: none; }
    .mipb-dri-td-ul { display: none; }
}

/* ── Print ─────────────────────────────────────────────────────────────── */
@media print {
    .mipb-dri-form, .mipb-dri-profile-bar, .mipb-dri-actions, .mipb-tshare { display: none !important; }
    .mipb-dri-bar { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
