/* ===== Nutrition panel + analyzer ===== */
.nutrition-section { margin-top: 2rem; }
.nutrition-section .section-heading-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.nut-toggle { display: inline-flex; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--warm-white); }
.nut-toggle button { border: none; background: none; padding: .35rem .8rem; font: inherit; font-size: .78rem; font-weight: 700; color: var(--text-muted); cursor: pointer; min-height: 34px; }
.nut-toggle button + button { border-left: 1.5px solid var(--border); }
.nut-toggle button.active { background: var(--sage-dark); color: #fff; }
.nut-basis { margin: .2rem 0 1rem; }
.nut-est { font-style: italic; }
.nut-quality { font-weight: 700; }
.nut-quality.q-good { color: var(--sage-dark); }
.nut-quality.q-fair { color: var(--wheat-dark); }
.nut-quality.q-rough { color: var(--barn-red); }
.nut-total-mode .ndv, .nut-total-mode .nbar { visibility: hidden; }

.nut-grid { display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 760px) { .nut-grid { grid-template-columns: 1fr; } }

/* FDA-style label: deliberately black on white, like the real thing */
.nut-label { background: #fff; color: #111; border: 1.5px solid #111; padding: .5rem .65rem .6rem; font-family: 'Helvetica Neue', Arial, sans-serif; }
.nl-title { font-size: 1.85rem; font-weight: 900; letter-spacing: -.02em; line-height: 1; border-bottom: 1px solid #111; padding-bottom: .25rem; }
.nl-cal { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 7px solid #111; padding: .2rem 0 .1rem; }
.nl-cal span { font-weight: 900; font-size: 1.15rem; }
.nl-cal strong { font-size: 2.2rem; font-weight: 900; line-height: 1; }
.nl-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.nl-table thead th { font-size: .7rem; font-weight: 700; padding: .15rem 0; border-bottom: 1px solid #111; text-align: right; }
.nl-table th, .nl-table td { padding: .2rem 0; border-bottom: 1px solid #bbb; text-align: left; font-weight: 400; }
.nl-table tr.b th { font-weight: 800; }
.nl-table tr.ind th { padding-left: 1rem; }
.nl-table tr.thick td, .nl-table tr.thick th { border-bottom: 7px solid #111; }
.nl-table td.nv { white-space: nowrap; padding-left: .4rem; }
.nl-table td.ndv { text-align: right; font-weight: 800; }
.nl-foot { font-size: .66rem; margin: .35rem 0 0; color: #333; line-height: 1.3; }

.nut-split { background: var(--warm-white); border: 1px solid var(--border); border-radius: 12px; padding: .75rem .9rem; }
.nut-split-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--cream); }
.seg-carbs { background: #dcc8b0; } .seg-fat { background: #d9a897; } .seg-protein { background: #72665a; }
.nut-split-legend { display: flex; gap: 1rem; flex-wrap: wrap; list-style: none; margin: .5rem 0 0; padding: 0; font-size: .82rem; }
.nut-split-legend .dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; margin-right: .35rem; vertical-align: -.05rem; }
.nut-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .75rem 0; }
@media (max-width: 420px) { .nut-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.nut-tile { background: var(--warm-white); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .6rem; display: flex; flex-direction: column; }
.nut-tile strong { font-size: 1.15rem; }
.nut-tile > span { font-size: .72rem; color: var(--text-muted); }

.nut-more { border: 1px solid var(--border); border-radius: 12px; background: var(--warm-white); margin-top: .6rem; }
.nut-more > summary { cursor: pointer; padding: .65rem .9rem; font-weight: 700; font-size: .9rem; list-style: none; display: flex; justify-content: space-between; }
.nut-more > summary::-webkit-details-marker { display: none; }
.nut-more > summary::after { content: "▸"; color: var(--text-muted); }
.nut-more[open] > summary::after { content: "▾"; }
.nut-more > :not(summary) { margin: 0 .9rem .8rem; }
.nut-table { width: calc(100% - 1.8rem); border-collapse: collapse; font-size: .84rem; }
.nut-table th { text-align: left; font-weight: 400; padding: .3rem 0; border-bottom: 1px solid var(--border); }
.nut-table td { padding: .3rem 0 .3rem .5rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.nut-table td.nbar { width: 40%; }
.nut-table .bar { display: inline-block; width: calc(100% - 3.2rem); height: 6px; background: var(--cream); border-radius: 999px; vertical-align: middle; overflow: hidden; }
.nut-table .bar > span { display: block; height: 100%; background: var(--sage); border-radius: 999px; }
.nut-table .pct { display: inline-block; width: 3rem; text-align: right; font-size: .76rem; color: var(--text-muted); }

.nut-items { width: calc(100% - 1.8rem); border-collapse: collapse; font-size: .8rem; }
.nut-items th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: .3rem .3rem .3rem 0; border-bottom: 1px solid var(--border); }
.nut-items td { padding: .4rem .4rem .4rem 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.nut-items .num { text-align: right; white-space: nowrap; }
.nut-items tr.st-unmatched td:first-child { color: var(--barn-red); }
.nut-miss { color: var(--barn-red); }
.conf { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .35rem; vertical-align: .05rem; }
.conf-hi { background: var(--sage-dark); } .conf-mid { background: var(--wheat); } .conf-lo { background: var(--dusty-rose); }
.nut-disclaimer { margin-top: .9rem; }

/* Analyzer page */
.az-grid { display: grid; grid-template-columns: minmax(0, 22rem) minmax(0, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
@media (max-width: 900px) { .az-grid { grid-template-columns: 1fr; } }
.az-form { background: var(--warm-white); border: 1px solid var(--border); border-radius: 14px; padding: 1rem; position: sticky; top: 1rem; }
@media (max-width: 900px) { .az-form { position: static; } }
.az-text { min-height: 16rem; font-size: .9rem; }
.az-row { display: flex; gap: .75rem; align-items: flex-end; margin-top: .6rem; }
.az-row .form-label { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; }
.az-servings { width: 6.5rem; }
.az-picker { margin-top: .5rem; padding: .6rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; display: flex; flex-direction: column; gap: .45rem; }
.az-opts { list-style: none; margin: 0; padding: 0; max-height: 12rem; overflow-y: auto; }
.az-opts button { display: block; width: 100%; text-align: left; border: none; background: none; padding: .35rem .4rem; border-radius: 6px; font: inherit; font-size: .8rem; cursor: pointer; }
.az-opts button:hover { background: var(--cream); }
.az-opts button.picked { background: #f7f2ed; font-weight: 700; }
.az-g { display: flex; align-items: center; gap: .4rem; font-size: .8rem; }
.az-g input { width: 6rem; }
.az-pick-actions { display: flex; gap: .75rem; align-items: center; }
