/* Nutrition: compact meal logging, deliberate reference comparisons, original food art. */
.nt-page {
  --nt-meter-green: #3f7d58; --nt-meter-red: #b4473a; --nt-meter-white: #fff;
  --nt-meter-outline: #aaa49b; --nt-search-offset: 8px;
  gap: 16px; padding-bottom: 20px;
}
.nt-page p { line-height: 1.6; }
.nt-page .btn, .nt-page input:not([type=checkbox]), .nt-page select { min-height: 44px; }
.nt-page button:disabled { opacity: .5; cursor: default; }
.nt-page button, .nt-page input, .nt-page select { -webkit-tap-highlight-color: transparent; }
.nt-page input, .nt-page select { font: inherit; font-size: 16px; max-width: 100%; min-width: 0; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.nt-page input:focus-visible, .nt-page select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nt-heading-line, .nt-meal-head, .nt-log-tools, .nt-date-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.nt-heading .title { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.nt-eyebrow { color: var(--accent); font-size: 10px; font-weight: 600; letter-spacing: .14em; margin: 0; }
.nt-heading > .nt-note { margin: 5px 0 0; font-size: 12px; }
.nt-note { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 8px 0; overflow-wrap: anywhere; }
.nt-date-row { justify-content: flex-start; gap: 6px; margin-top: 6px; }
.nt-date-row .nt-field { flex: 1; max-width: 280px; }
.nt-date-row .nt-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.nt-date-arrow { align-self: flex-end; width: 44px; padding: 0; font-size: 23px; border-color: transparent; background: transparent; }
.nt-section-nav { position: sticky; top: 8px; z-index: 8; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); }
.nt-section-nav .btn { border: 0; background: transparent; padding: 8px 3px; font-size: 12px; white-space: nowrap; border-radius: 8px; }
.nt-section-nav .nt-tab-active, .nt-section-nav [aria-selected=true], .nt-section-nav [aria-current=page] { color: var(--bg); background: var(--fg); font-weight: 600; }
.nt-section { min-width: 0; scroll-margin-top: 78px; }
.nt-section-head { display: flex; align-items: flex-start; gap: 9px; margin: 3px 0 12px; }
.nt-index { color: var(--accent); font-size: 11px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.nt-section-head h2 { color: var(--fg); font-family: var(--serif); font-size: 21px; font-weight: 400; letter-spacing: -.01em; margin: 0; }
.nt-section-head p { margin: 3px 0 0; }
#nutrition-section-01 > .nt-section-head { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.nt-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.nt-field > span { font-weight: 500; }
.nt-field small { color: var(--muted); line-height: 1.6; }
.nt-check { display: flex; align-items: center; gap: 9px; font-size: 13px; line-height: 1.6; min-height: 44px; }
.nt-check input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--accent); }
.nt-page h3 { font-size: 15px; font-weight: 600; line-height: 1.5; margin: 0; }
.nt-feedback:empty { display: none; }
.nt-error, .nt-success { margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; line-height: 1.6; }
.nt-error { color: var(--bad); border-color: var(--bad); }
.nt-success { color: var(--ok); background: var(--ok-soft); }
.nt-alert { padding: 13px 15px; border: 1px solid var(--bad); border-left: 3px solid var(--bad); border-radius: 12px; background: var(--card); }
.nt-alert strong { color: var(--bad); }
.nt-alert p { margin: 6px 0; font-size: 13px; }
.nt-badge { display: inline-block; padding: 4px 7px; border-radius: 6px; background: var(--chip); color: var(--muted); font-size: 11px; line-height: 1.5; }
.nt-badge-ok { color: var(--ok); background: var(--ok-soft); }

/* Daily summary and short, tappable meal records. */
.nt-log { padding: 0; }
.nt-log > .nt-log-tools { margin-bottom: 12px; }
.nt-daily-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.nt-daily-energy { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.nt-daily-energy > small:first-child { grid-column: 1 / -1; }
.nt-daily-energy > div:not(.nt-meter-visual) { line-height: 1.1; white-space: nowrap; }
.nt-daily-energy strong { font-family: var(--serif); font-size: 36px; font-weight: 400; line-height: 1; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.nt-daily-energy span, .nt-daily-energy > small { color: var(--muted); font-size: 11px; }
.nt-daily-energy > .btn { font-size: 11px; padding: 8px 9px; }
.nt-daily-energy .nt-meter-visual, .nt-daily-energy > .nt-note { grid-column: 1 / -1; }
.nt-daily-macros { display: contents; }
.nt-daily-macro { min-width: 0; font-size: 12px; color: var(--muted); }
.nt-daily-macro strong { display: block; color: var(--fg); font-size: 18px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.nt-daily-macro small { font-size: 11px; font-weight: 400; line-height: 1.5; }
.nt-summary-note { display: block; grid-column: 1 / -1; color: var(--muted); font-size: 11px; line-height: 1.45; }
.nt-meal-card { margin-top: 12px; padding: 13px 15px; box-shadow: none; }
.nt-meal-card > .nt-meal-head { margin-bottom: 4px; }
.nt-meal-card h3 { margin: 0 0 2px; font-size: 16px; }
.nt-meal-energy { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.nt-meal-add { color: var(--fg); background: var(--ok-soft); border-color: transparent; white-space: nowrap; padding: 8px 11px; }
.nt-meal-empty { color: var(--muted); font-size: 12px; padding: 6px 0 2px; }
.nt-meal-card > .nt-note { margin-bottom: 0; }
.nt-entry-item { border-top: 1px solid var(--line); }
.nt-entry { min-width: 0; }
.nt-entry-main { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 68px; margin: 0; padding: 10px 0; text-align: left; color: var(--fg); border: 0; background: transparent; cursor: pointer; }
.nt-entry-main:active { background: var(--chip); }
.nt-entry-copy { flex: 1; min-width: 0; }
.nt-entry-copy strong, .nt-entry-copy small { display: block; overflow-wrap: anywhere; }
.nt-entry-copy strong { font-size: 14px; font-weight: 500; line-height: 1.45; }
.nt-entry-copy small { margin-top: 3px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.nt-entry-energy { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-entry-chevron { flex-shrink: 0; font-size: 20px; color: var(--muted); font-weight: 400; }
.nt-entry-main .nt-food-thumb { width: 40px; height: 40px; border-radius: 10px; }
.nt-entry-components { padding-left: 50px; }
.nt-entry-components > summary { font-size: 11px; color: var(--muted); }
.nt-entry-components > small { display: block; color: var(--muted); line-height: 1.6; padding: 0 0 10px; font-size: 11px; }
.nt-draft-resume { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; padding: 9px 11px; margin-top: 7px; border: 1px solid var(--line); border-radius: 9px; background: var(--accent-soft); color: var(--fg); font-size: 12px; text-align: left; }
.nt-completion { margin-top: 16px; padding-top: 4px; }
.nt-completion > .btn { width: 100%; }
.nt-completion .nt-note { text-align: center; font-size: 11px; margin-bottom: 0; }
.nt-recurring, .nt-favourites { border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; margin: 12px 0; background: var(--card); }
.nt-recurring-panel { border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; margin: 10px 0; background: var(--card); }
.nt-recurring-panel > summary { font-size: 12px; color: var(--muted); }
.nt-recurring-panel .nt-recurring { border: 0; margin: 0; padding: 0 0 3px; background: transparent; }
.nt-recurring-panel .nt-recurring > h3 { display: none; }
.nt-recurring-panel .nt-recurring > .nt-note { margin: 3px 0 8px; font-size: 11px; }
.nt-recurring-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.nt-grow { min-width: 0; flex: 1; }
.nt-grow strong, .nt-grow small { display: block; overflow-wrap: anywhere; }
.nt-grow strong { font-size: 13px; font-weight: 500; }
.nt-grow small { color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 3px; }
.nt-favourite { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.nt-quick { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.nt-chip { background: var(--chip); border-color: transparent; }
.nt-chip[aria-pressed=true] { background: var(--fg); color: var(--bg); }
.nt-empty { text-align: center; padding: 24px 8px; }
.nt-empty .nt-note { max-width: 400px; margin: 8px auto 16px; }

/* One original, local sprite sheet; illustrations are cues, never portion evidence. */
.nt-food-thumb { display: inline-block; width: 48px; height: 48px; flex: 0 0 auto; border-radius: 12px; background-color: #faf8f3; background-image: url('nutrition-food-art.png'); background-size: 400% 400%; background-repeat: no-repeat; background-position: 100% 100%; border: 1px solid var(--line); }
.nt-food-thumb[data-food-visual=huel] { background-position: 0 0; }
.nt-food-thumb[data-food-visual=milk] { background-position: 33.333333% 0; }
.nt-food-thumb[data-food-visual=orange-juice] { background-position: 66.666667% 0; }
.nt-food-thumb[data-food-visual=apple-juice] { background-position: 100% 0; }
.nt-food-thumb[data-food-visual=beans] { background-position: 0 33.333333%; }
.nt-food-thumb[data-food-visual=mushrooms] { background-position: 33.333333% 33.333333%; }
.nt-food-thumb[data-food-visual=sausage] { background-position: 66.666667% 33.333333%; }
.nt-food-thumb[data-food-visual=egg] { background-position: 100% 33.333333%; }
.nt-food-thumb[data-food-visual=toast] { background-position: 0 66.666667%; }
.nt-food-thumb[data-food-visual=fish] { background-position: 33.333333% 66.666667%; }
.nt-food-thumb[data-food-visual=banana] { background-position: 66.666667% 66.666667%; }
.nt-food-thumb[data-food-visual=nuts] { background-position: 100% 66.666667%; }
.nt-food-thumb[data-food-visual=coffee] { background-position: 0 100%; }
.nt-food-thumb[data-food-visual=supplement] { background-position: 33.333333% 100%; }
.nt-food-thumb[data-food-visual=noodles] { background-position: 66.666667% 100%; }
.nt-food-thumb[data-food-visual=meal] { background-position: 100% 100%; }

/* Add-food workspace: one search, one plate, one confirmation. */
.nt-composer { min-width: 0; padding-bottom: calc(260px + env(safe-area-inset-bottom)); scroll-margin-top: 16px; }
.nt-composer-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.nt-composer-header > .btn { padding-left: 0; background: transparent; border-color: transparent; }
.nt-composer-header h1 { font-family: var(--serif); font-size: 24px; font-weight: 400; margin: 0; }
.nt-composer-header .nt-note { margin: 2px 0 0; font-size: 11px; }
.nt-composer > .nt-field { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 10px; }
.nt-composer > .nt-field select { flex: 1; }
.nt-composer-switch { padding-bottom: 8px; margin-bottom: 4px; }
.nt-library { min-width: 0; }
.nt-library-search { position: sticky; top: var(--nt-search-offset); z-index: 7; background: var(--bg); padding: 5px 0 7px; }
.nt-library-search > .nt-field, .nt-library > .nt-field { margin: 0 0 8px; }
.nt-library-search > .nt-field > span, .nt-composer .nt-library > .nt-field > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.nt-library-search input[type=search], .nt-library > .nt-field input[type=search] { width: 100%; border-radius: 12px; background: var(--card); }
.nt-filters { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nt-library-search > .nt-filters, .nt-library > .nt-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
.nt-library-search > .nt-filters::-webkit-scrollbar, .nt-library > .nt-filters::-webkit-scrollbar { display: none; }
.nt-library-search > .nt-filters .btn, .nt-library > .nt-filters .btn { flex-shrink: 0; padding: 8px 12px; font-size: 12px; }
.nt-search-results { min-width: 0; }
.nt-food-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nt-food-row:last-child { border-bottom: 0; }
.nt-food-name { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 48px; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.nt-food-name > span:not(.nt-food-thumb) { min-width: 0; flex: 1; }
.nt-food-name strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.nt-food-name small { display: block; color: var(--muted); font-size: 11px; line-height: 1.5; margin-top: 3px; overflow-wrap: anywhere; }
.nt-food-add { min-width: 44px; height: 44px; padding: 8px; flex-shrink: 0; font-size: 19px; border-radius: 12px; background: var(--card); }
.nt-food-selected { background: var(--ok-soft); border-radius: 10px; padding-left: 7px; padding-right: 7px; }
.nt-food-selected .nt-food-thumb { width: 40px; height: 40px; border-radius: 10px; }
.nt-inline-count { display: flex; align-items: center; gap: 2px; width: 148px; flex: 0 0 148px; }
.nt-inline-count .nt-stepper { flex: 1; gap: 2px; min-width: 0; }
.nt-inline-count .nt-stepper input { width: 36px; flex: 0 1 36px; padding: 8px 0; border-color: transparent; background: transparent; }
.nt-inline-count > span { font-size: 11px; color: var(--muted); flex-shrink: 0; }
.nt-library-extras { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; margin: 10px 0; }
.nt-plate-preview { padding: 10px 12px; background: var(--ok-soft); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.nt-plate-preview strong { font-size: 12px; }
.nt-plate-preview .nt-meal-head { margin-bottom: 0; }
.nt-plate-preview .nt-note { margin: 3px 0 0; font-size: 11px; }
.nt-plate-items { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 3px 0; }
.nt-plate-items > .btn { flex-shrink: 0; padding: 6px 10px; font-size: 11px; background: var(--card); border: 1px solid var(--line); }
.nt-basket-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.nt-basket-item > .nt-meal-head { grid-column: 1 / -1; margin: 0; }
.nt-basket-item:last-child { border-bottom: 0; }
.nt-basket-item > .nt-portion-controls { max-width: 280px; }
.nt-basket-item > .btn { align-self: start; }
.nt-composer-footer { position: fixed; z-index: 11; left: 16px; right: 16px; bottom: calc(64px + env(safe-area-inset-bottom)); max-width: 568px; max-height: min(42dvh, 280px); overflow-y: auto; overscroll-behavior: contain; margin: 0 auto; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 4px 18px #00000012; }
.nt-composer-footer .nt-plate-preview { margin: 0 0 8px; padding: 0; border: 0; background: transparent; }
.nt-basket-actions { display: flex; align-items: center; gap: 8px; }
.nt-basket-summary { min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 12px; text-align: left; flex: 1; cursor: pointer; }
.nt-composer-footer > .btn { width: 100%; }
.nt-composer-footer .nt-error { margin-bottom: 8px; padding: 8px; font-size: 12px; }

/* Editors keep labels, physical units and source details available. */
.nt-editor { margin: 10px 0; padding: 14px; border-top: 2px solid var(--accent); scroll-margin-top: 78px; box-shadow: none; }
.nt-editor > .nt-meal-head { margin-bottom: 12px; }
.nt-editor h2 { color: var(--fg); margin: 0; font-size: 16px; }
.nt-food-detail-title { display: flex; align-items: center; gap: 12px; min-width: 0; margin-bottom: 2px; }
.nt-food-detail-title h3 { flex: 1; min-width: 0; font-size: 17px; overflow-wrap: anywhere; }
#nutrition-editor-title { scroll-margin-top: 84px; }
#nutrition-editor-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.nt-form { display: flex; flex-direction: column; gap: 14px; }
.nt-form > .nt-note { margin: 0; }
.nt-form-pair, .nt-nutrient-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.nt-stepper { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nt-stepper input { width: 64px; flex: 1; text-align: center; font-variant-numeric: tabular-nums; }
.nt-adjust { width: 44px; height: 44px; padding: 0; font-size: 20px; flex-shrink: 0; }
.nt-quantity { min-width: 36px; text-align: center; font-variant-numeric: tabular-nums; }
.nt-component { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.nt-component > .nt-portion-controls { width: 204px; flex-shrink: 0; }
.nt-component .nt-stepper input { width: 48px; padding: 8px 2px; }
.nt-portion-controls { min-width: 0; }
.nt-portion-count { display: flex; align-items: center; gap: 7px; }
.nt-portion-unit { color: var(--muted); font-size: 12px; white-space: nowrap; }
.nt-portion-weight { margin-top: 5px; color: var(--muted); font-size: 11px; }
.nt-portion-weight .nt-note { font-size: 11px; }
.nt-preview { display: flex; flex-wrap: wrap; gap: 7px 12px; font-size: 12px; background: var(--chip); border-radius: 10px; padding: 11px; }
.nt-input-group { border-top: 1px solid var(--line); padding-top: 6px; }
.nt-page summary { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; font-size: 13px; }
.nt-page summary::before { content: '+'; width: 12px; color: var(--muted); font-size: 15px; flex-shrink: 0; }
.nt-page details[open] > summary::before { content: '−'; }
.nt-page summary::-webkit-details-marker { display: none; }
.nt-source { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 5px; }
.nt-source a { display: block; font-size: 12px; color: var(--accent); margin: 8px 0; line-height: 1.6; overflow-wrap: anywhere; }
.nt-delete { color: var(--bad); }

/* Real intake progress: the remaining track stays white in both app themes. */
.nt-macros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.nt-macro { min-width: 0; }
.nt-macro > span { display: block; color: var(--muted); font-size: 12px; }
.nt-macro > strong { display: inline-block; margin: 4px 4px 0 0; font-family: var(--serif); font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nt-macro > small { font-size: 11px; color: var(--muted); }
.nt-macro-energy { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.nt-macro-energy > strong { font-size: 36px; }
.nt-profile-prompt { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin: 0 0 14px; background: var(--accent-soft); border-radius: 11px; }
.nt-profile-prompt p { flex: 1; margin: 0; }
.nt-profile-prompt .btn { flex-shrink: 0; }
.nt-overview-group { border-top: 1px solid var(--line); margin-top: 10px; }
.nt-overview-group > summary { font-size: 14px; font-weight: 500; }
.nt-nutrient-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.nt-nutrient-name strong { display: block; font-size: 13px; font-weight: 500; }
.nt-nutrient-name small, .nt-nutrient-value small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.nt-nutrient-value { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }
.nt-nutrient-value .nt-limit { color: var(--warn); }
.nt-nutrient-details { grid-column: 1 / -1; }
.nt-nutrient-details > summary { font-size: 11px; min-height: 44px; color: var(--muted); }
.nt-meter-visual { grid-column: 1 / -1; min-width: 0; margin-top: 5px; }
.nt-meter-track { position: relative; height: 12px; border: 1px solid var(--nt-meter-outline); border-radius: 6px; overflow: hidden; background: var(--nt-meter-white); }
.nt-meter-fill { display: block; height: 100%; background: var(--nt-meter-green); border-radius: 4px; }
.nt-meter-visual[data-tone=neutral] .nt-meter-fill { background: var(--nt-meter-white); }
.nt-meter-visual[data-tone=red] .nt-meter-fill { background: var(--nt-meter-red); }
.nt-meter-caption { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.nt-meter-caption small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.nt-meter-caption .nt-meter-percent { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.nt-meter-visual[data-tone=green] .nt-meter-status { color: var(--ok); }
.nt-meter-visual[data-tone=red] .nt-meter-status { color: var(--bad); font-weight: 600; }
.nt-meter-detail { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.nt-meter-target { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.nt-reference-profile { margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.nt-meter-compact .nt-meter-track { height: 9px; }
.nt-meter-compact .nt-meter-caption { flex-wrap: wrap; gap: 0 8px; }
.nt-meter-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding-top: 11px; margin-top: 13px; border-top: 1px solid var(--line); }
.nt-meter-legend > span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; }
.nt-meter-key { display: inline-block; width: 15px; height: 8px; border-radius: 3px; flex-shrink: 0; }
.nt-meter-key-green { background: var(--nt-meter-green); }
.nt-meter-key-neutral { background: var(--nt-meter-white); border: 1px solid var(--nt-meter-outline); }
.nt-meter-key-red { background: var(--nt-meter-red); }

/* Trends and insights remain readable without expanding the diary. */
.nt-trend-top { display: flex; flex-direction: column; gap: 12px; }
.nt-trend-summary { margin: 18px 0 12px; }
.nt-trend-summary > strong { font-family: var(--serif); font-size: 26px; font-weight: 400; }
.nt-chart { display: flex; align-items: flex-end; gap: 3px; height: 144px; padding-top: 8px; border-bottom: 1px solid var(--line); }
.nt-chart-dense { gap: 1px; }
.nt-catalogue-retry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 10px 12px; margin: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.nt-catalogue-retry .nt-note { margin: 0; flex: 1 1 180px; }
.nt-chart-column { height: 100%; min-width: 0; flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.nt-chart-bar { display: block; width: 100%; max-width: 36px; background: var(--accent); border-radius: 3px 3px 0 0; }
.nt-chart-partial { opacity: .45; }
.nt-chart-gap { display: block; height: 6px; width: 100%; max-width: 36px; border-top: 1px dashed var(--muted); opacity: .5; }
.nt-chart-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 11px; }
.nt-trend-table { margin-top: 14px; }
.nt-trend-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.nt-trend-table th, .nt-trend-table td { text-align: left; border-bottom: 1px solid var(--line); padding: 8px 4px; font-weight: 400; }
.nt-trend-table th { color: var(--muted); }
.nt-insights { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 78px; }
.nt-insight { border-left: 3px solid var(--line); }
.nt-insight h3 { margin: 10px 0 7px; font-size: 15px; }
.nt-insight p { margin: 0; color: var(--muted); font-size: 13px; }
.nt-insight-source { display: inline-block; color: var(--accent); font-size: 12px; margin-top: 8px; overflow-wrap: anywhere; }
.nt-insight-risk { border-left-color: var(--bad); }
.nt-insight-risk .nt-badge { color: var(--bad); }
.nt-insight-attention { border-left-color: var(--warn); }

@media (max-width: 380px) {
  .nt-heading .title { font-size: 25px; }
  .nt-page .nt-heading-line { gap: 7px; }
  .nt-daily-summary { padding: 13px; gap: 8px 10px; }
  .nt-daily-energy strong { font-size: 33px; }
  .nt-meal-card { padding: 12px; }
  .nt-food-name { gap: 7px; }
  .nt-food-thumb { width: 42px; height: 42px; }
  .nt-food-selected .nt-food-thumb { width: 36px; height: 36px; }
  .nt-inline-count { gap: 1px; }
  .nt-inline-count .nt-stepper input { width: 30px; flex-basis: 30px; }
  .nt-recurring-row { flex-wrap: wrap; }
  .nt-recurring-row .nt-grow { flex-basis: 100%; }
  .nt-form-pair, .nt-nutrient-inputs { gap: 8px; }
  .nt-basket-actions > .primary { padding-left: 10px; padding-right: 10px; }
  .nt-profile-prompt { flex-wrap: wrap; }
  .nt-profile-prompt > .btn { width: 100%; }
}
@media (max-width: 600px) {
  .nt-component { flex-wrap: wrap; }
  .nt-component > .nt-grow { flex-basis: 100%; }
  .nt-component > .nt-portion-controls { width: 100%; }
  .nt-component .nt-stepper { width: 100%; }
}
@media (min-width: 480px) { .nt-macros { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .nt-heading { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 24px; }
  .nt-heading-line { grid-column: 1; }
  .nt-heading > .nt-note { grid-column: 1; }
  .nt-date-row { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
  .nt-heading > .btn { grid-column: 2; }
  .nt-section-nav { max-width: 600px; }
  .nt-daily-summary { grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); align-items: center; padding: 18px 22px; }
  .nt-daily-energy { grid-column: auto; margin: 0; padding: 0 22px 0 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .nt-meal-card { padding: 14px 19px; }
  .nt-composer-footer { left: 254px; right: 44px; max-width: 1092px; bottom: 16px; }
  .nt-trend-top { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .nt-trend-top .nt-field { max-width: 260px; }
  .nt-food-row { padding: 10px 8px; }
  .nt-food-name strong { font-size: 15px; }
  .nt-library-search { padding-top: 8px; }
}
@media (prefers-color-scheme: dark) {
  .nt-page { --nt-meter-green: #5c9e72; --nt-meter-red: #c46554; --nt-meter-outline: #817a70; }
  .nt-food-thumb { background-color: #faf8f3; filter: brightness(.88); }
}
@media (prefers-contrast: more) { .nt-meter-track { border-color: var(--fg); } .nt-food-thumb { border-color: var(--muted); } }
@media (prefers-reduced-motion: reduce) { .nt-page * { scroll-behavior: auto; } }
