/* recipe-nutrition-calculator - page styles. Loads after /css/tokens.css, /css/components.css and /css/tools.css.
   Moved here from the page's <style> block with values converted to Ledger tokens. */

/* ---- Recipe Nutrition Calculator Custom Styling ---- */

.recipe-workarea {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-bottom: 24px;
}

@media (max-width: 900px) {
    .recipe-workarea {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}

/* ---- Macro Ratio Bar Chart ---- */
.macro-ratio-bar {
    height: 14px;
    border-radius: 7px;
    background: var(--surface-2);
    border: 1px solid var(--line-2);
    overflow: hidden;
    display: flex;
}
.ratio-segment {
    height: 100%;
    transition: width 0.3s var(--ease);
}
.ratio-segment.protein { background: var(--info); }
.ratio-segment.carbs { background: var(--success); }
.ratio-segment.fat { background: var(--warning); }

/* ---- Custom Ingredient List ---- */
.custom-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--r-xs);
    background: var(--accent-soft);
    border: 1px solid var(--line);
    font-size: 13px;
}
.custom-item-row .name {
    font-weight: 600;
    color: var(--ink);
}
.custom-item-row .details {
    font-size: 11.5px;
    color: var(--muted);
    font-family: var(--font-mono);
}
.custom-item-row .remove-btn {
    background: none;
    border: none;
    color: var(--neg);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

/* ---- Warnings & Unmatched review ---- */
.review-warning-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font: 400 var(--text-sm)/1.5 var(--font-sans);
    color: var(--text);
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-left-width: 4px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
}
.review-warning-item b {
    color: var(--warning);
}
.review-warning-item .icon {
    flex: none;
    font-size: 15px;
}
.review-warning-item .action-links {
    margin-top: 4px;
    display: flex;
    gap: 8px;
}
.review-warning-item .action-btn {
    font-size: 11px;
    font-family: var(--font-ui); font-weight:600;
    text-transform: uppercase;
    color: var(--text);
    text-decoration: underline;
    background: none;
    border: none;
    box-shadow: none;
    cursor: pointer;
    padding: 0;
}

/* ---- Estimated Nutrition Facts Label Card ---- */
/* owner: a printed label, light in every theme: the kit's paper and ink
   (the label is also a .glass panel, so this outranks the panel tokens in tool-bridge.css) */
.studio-tool .glass.label-card {
    --text: var(--jjk-ink-700);
    --text-muted: var(--jjk-ink-400);
}
.label-card {
    background: var(--jjk-paper) !important;
    color: var(--text) !important;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    border: 2px solid var(--text) !important;
    box-shadow: var(--shadow-card) !important; /* the tool panels' kit card shadow (owner, option C) */
}

[data-theme="cosmic"] .label-card {
    /* Ensure shadows and outlines look correct in dark modes */
    box-shadow: var(--shadow) !important;
}

.label-wrapper {
    display: flex;
    flex-direction: column;
}

.label-header {
    border-bottom: 10px solid var(--text);
    padding-bottom: 6px;
}
.label-header h2 {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif !important;
    font-weight: 900 !important;
    font-size: 32px !important;
    margin: 0 !important;
    letter-spacing: -0.5px;
    line-height: 1.05;
    color: var(--text) !important;
}
.label-header .sub {
    font-size: 14px;
    margin-top: 2px;
    font-weight: 500;
    color: var(--text) !important;
}

.label-servings {
    border-bottom: 6px solid var(--text);
    padding: 8px 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text) !important;
}

.label-calories {
    border-bottom: 5px solid var(--text);
    padding: 8px 0 6px;
    color: var(--text) !important;
}
.label-calories .title {
    font-size: 12px;
    font-weight: 700;
}
.label-calories .row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.label-calories .name {
    font-size: 28px;
    font-weight: 900;
}
.label-calories .val {
    font-size: 38px;
    font-weight: 900;
}

.label-table {
    display: flex;
    flex-direction: column;
    color: var(--text) !important;
}
.label-table .dv-header {
    text-align: right;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 0 2px;
    border-bottom: 1px solid var(--text);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--text);
    padding: 7px 0;
    font-size: 14px;
}
.label-row.indent {
    padding-left: 16px;
}
.label-row.last {
    border-bottom: 10px solid var(--text);
}
.label-row .dv {
    font-weight: 700;
}
.label-card :is(#lbl-servings, #lbl-serving-size, #lbl-calories, .label-row .name > span, .label-row .dv) {
    font-family: var(--font-numeric);
    font-variant-numeric: var(--numeric-features);
}

.label-footer {
    font-size: 10.5px;
    line-height: 1.4;
    padding-top: 8px;
    color: var(--text-muted) !important;
}

.page.tool-shell { max-width: 1100px; padding-top: 28px; }
.net-band { max-width: 1100px; margin: 56px auto 0; padding: 0 28px; }
.net-band h2 { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); display: flex; align-items: baseline; gap: 12px; }
.net-band h2 .lbl { font-family: var(--font-ui); font-size: 11px; font-weight: 600; letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--accent); }
.net-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.net-grid .gear-img-wrapper { height: 120px; }
@media (max-width: 760px) { .net-grid { grid-template-columns: 1fr; } }

/* kit parts inside a tool panel: the "on" text of the segmented control and the ghost button's
   hover text use the panel ground, not the page ground --bg (they differ in rust) */
.studio-tool .glass .segmented > button.active,
.studio-tool .glass .btn--ghost:hover { color: var(--surface); }

/* the full-width buttons in the input cards may wrap their labels on a 320px screen instead of running past its edges */
.studio-tool .type-card .btn { white-space: normal; text-align: center; line-height: 1.2; }
/* fields side by side: a label that wraps to two lines keeps its input level with the others */
.studio-tool .type-card .field { grid-template-rows: 1fr auto; }
