.library-layout { display:grid; grid-template-columns:235px minmax(0,1fr); gap:20px; align-items:start; }
.library-tree { padding:18px 12px; }
.library-tree h2 { font-size:15px; padding:0 9px 10px; }
.library-tree-item { display:block; width:100%; text-align:left; border:0; background:transparent; padding:13px 12px; border-radius:7px; cursor:pointer; color:var(--ink); }
.library-tree-item strong,.library-tree-item small { display:block; }
.library-tree-item small { margin-top:6px; color:var(--muted); }
.library-tree-item.selected { background:#e8f0e9; color:var(--green); }
.library-toolbar { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:24px; }
.library-toolbar .btn { padding:8px 13px; }
.library-detail { min-width:0; }
.library-summary { display:flex; gap:45px; padding:18px 0; }
.library-summary strong,.library-summary small { display:block; }
.library-summary strong { font-size:30px; color:var(--green); }
.library-food-scroll { max-height:440px; overflow:auto; margin-top:10px; }
.library-pagination { display:flex; align-items:center; gap:14px; justify-content:flex-end; margin:15px 0; font-size:12px; color:var(--muted); }
dialog.library-modal { width:min(1120px,94vw); max-width:1120px; }
.library-check { display:flex; align-items:center; gap:8px; margin:10px 0; }
.library-check input,.library-member input { width:auto; margin:0; flex-shrink:0; }
.library-targets { max-height:250px; overflow:auto; padding:8px; border:1px solid var(--line); border-radius:8px; }
.library-targets fieldset { border:0; border-bottom:1px solid var(--line); padding:0 10px 10px; }
.library-targets legend { font-weight:600; }
.library-member-list { max-height:330px; overflow:auto; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 12px; border:1px solid var(--line); border-radius:8px; padding:10px; }
.library-member { display:flex; align-items:center; gap:9px; padding:9px; margin:0; border-bottom:1px solid #edf0ea; cursor:pointer; }
.library-member[hidden] { display:none; }
.library-member small { display:block; color:var(--muted); margin-top:4px; }
@media(max-width:1000px) { .library-layout { grid-template-columns:190px minmax(0,1fr); gap:12px; } .library-member-list { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:760px) { .library-layout { grid-template-columns:minmax(0,1fr); } .library-tree { max-height:210px; overflow:auto; } .library-member-list { grid-template-columns:minmax(0,1fr); } .library-toolbar { gap:6px; } dialog.library-modal { padding:18px; } }

/* Match the legacy food list's information density and numeric reading order. */
.table-wrap th.numeric,.table-wrap td.numeric { text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; }
.table-wrap th.actions { text-align:right; }
.content:has(.food-library-card) { max-width:none; padding-inline:20px; }
.food-library-card { padding:14px; }
.food-library-card .filter { margin-bottom:12px; gap:12px; }
.food-library-card .table-wrap { min-height:0; overflow:auto; }
.food-nutrition-table { font-size:12px; border-collapse:separate; border-spacing:0; }
.food-nutrition-table th,.food-nutrition-table td { padding:9px 5px; }
.food-nutrition-table td { padding-block:7px; line-height:24px; }
.food-nutrition-table th { position:sticky; top:0; z-index:2; padding-block:11px; font-size:12px; font-weight:650; line-height:1.4; color:#294638; background:#e8eee7; border-bottom:1px solid #c4d1c1; vertical-align:bottom; }
.food-nutrition-table th .food-column-name { display:block; white-space:normal; }
.food-nutrition-table th .food-column-unit { display:block; margin-top:4px; font-size:11px; font-weight:400; line-height:1.2; color:#526454; }
.food-nutrition-table th:not(.numeric) { vertical-align:middle; }
.food-sort-button { display:flex; flex-direction:column; align-items:flex-end; width:100%; padding:0; border-radius:3px; background:transparent; color:inherit; font:inherit; text-align:right; white-space:normal; }
:is(.food-nutrition-table,.recipe-table) .food-sort-button .food-column-unit { display:flex; align-items:center; justify-content:flex-end; gap:3px; }
.food-sort-icon { display:inline-block; min-width:1em; text-align:center; }
.food-sort-button:hover { color:#163e31; text-decoration:underline; text-underline-offset:3px; }
.food-sort-button:focus-visible { outline:2px solid #6c8f77; outline-offset:3px; }
:is(.food-nutrition-table,.recipe-table) th[aria-sort] { background:#d8e6d5; color:#163e31; }
:is(.food-nutrition-table,.recipe-table) th[aria-sort] .food-sort-icon { color:#163e31; font-weight:700; }
.food-nutrition-table th:first-child,.food-nutrition-table td:first-child { position:sticky; left:0; min-width:120px; max-width:160px; padding-inline:8px 12px; z-index:1; background:#fff; }
.food-nutrition-table th:first-child { z-index:3; background:#e8eee7; }
.food-nutrition-table tbody tr { cursor:default; }
.food-nutrition-table tbody tr:hover td { background:#f6f8f3; }
:is(.food-nutrition-table,.recipe-table) tbody tr[data-selected="true"]>td { background:#eaf2e6; }
:is(.food-nutrition-table,.recipe-table) tbody tr[data-selected="true"]>td.numeric { color:#234c40; font-weight:700; }
:is(.food-nutrition-table,.recipe-table) tbody tr:focus-visible { outline:2px solid #b79a56; outline-offset:-2px; }
.food-nutrition-table .text-btn { padding:3px 5px; }
.food-name-link { display:block; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--green); text-decoration:underline; text-decoration-color:#b5c6b7; text-underline-offset:3px; font-weight:550; }
.food-name-link:hover { text-decoration-color:currentColor; }
.food-category[hidden] { display:none; }
.food-source { display:block; max-width:5em; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.food-missing { color:var(--muted); }
/* Reserve the larger, bold value so selection never resizes rows or columns. */
.food-nutrient-value { display:inline-grid; grid-template-areas:"value"; padding:0; border-radius:3px; background:transparent; color:inherit; font:inherit; font-size:14px; line-height:24px; text-align:right; vertical-align:middle; cursor:default; }
.food-nutrient-value::after { content:attr(data-reading-value); grid-area:value; visibility:hidden; font-weight:700; pointer-events:none; }
.food-nutrient-text { grid-area:value; font-weight:400; transform:scale(.8571428571); transform-origin:right center; }
:is(.food-nutrition-table,.recipe-table) tbody tr[data-selected="true"] .food-nutrient-text { font-weight:700; transform:scale(1); }
.food-nutrient-value:hover .food-nutrient-text,.food-nutrient-value[data-nutrient-open] .food-nutrient-text { text-decoration:underline dotted; text-underline-offset:3px; }
.food-nutrient-value:focus-visible { outline:2px solid #6c8f77; outline-offset:3px; }
dialog.food-detail-modal { width:min(1000px,94vw); max-width:1000px; }
.food-detail-meta { display:flex; flex-wrap:wrap; gap:6px 20px; font-size:12px; color:var(--muted); margin-bottom:20px; }
.food-nutrition-caption { font-size:12px; color:var(--muted); margin:0 0 14px; }
.food-nutrient-groups { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px 30px; }
.food-nutrient-groups section { min-width:0; }
.food-nutrient-groups h3 { margin:0 0 10px; font-size:13px; }
.food-nutrient-groups dl { margin:0; }
.food-nutrient-groups dl>div { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:12px; min-height:30px; padding-block:4px; font-size:12px; }
.food-nutrient-groups dt { color:#617469; }
.food-nutrient-groups dt small { font-size:11px; white-space:nowrap; }
.food-nutrient-groups dd { margin:0; text-align:right; font-variant-numeric:tabular-nums; }
.food-source-record { font-size:12px; color:var(--muted); margin:18px 0 0; overflow-wrap:anywhere; }
:is(.food-editor,.recipe-editor) input[type=number] { text-align:right; font-variant-numeric:tabular-nums; line-height:20px; -moz-appearance:textfield; appearance:textfield; }
:is(.food-editor,.recipe-editor) input[type=number]:focus { font-size:16px; font-weight:600; color:#163e31; background:#f3f8ef; border-color:#6c8f77; outline:2px solid #a8c1ad; outline-offset:1px; }
:is(.food-editor,.recipe-editor) input[type=number]::-webkit-inner-spin-button,
:is(.food-editor,.recipe-editor) input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; margin:0; }
@media(max-width:1000px) { .food-nutrition-table { min-width:1060px; } }
@media(max-width:760px) {
  .content:has(.food-library-card) { padding-inline:12px; }
  .food-nutrient-groups { grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
}
@media(max-width:520px) {
  .food-nutrient-groups { grid-template-columns:minmax(0,1fr); }
  .food-nutrient-groups dl>div { min-height:32px; }
}
@media print { .food-library-card .table-wrap { max-height:none; overflow:visible; } .food-nutrition-table th,.food-nutrition-table td:first-child { position:static; } }

/* The legacy editor groups identity, classification and all nutrient inputs. */
dialog.food-editor { width:min(1120px,96vw); max-width:1120px; padding:22px; }
.food-editor .dialog-title { margin-bottom:12px; }
.food-editor .helper { margin:0 0 14px; }
.food-editor-basics { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px 30px; margin-bottom:16px; }
.food-editor-basics>label,.food-category-field { display:grid; grid-template-columns:76px minmax(0,1fr); align-items:center; gap:10px; margin:0; font-size:12px; }
.food-editor input,.food-editor select { margin:0; min-height:32px; padding:5px 8px; border-radius:6px; }
.food-editor-basics [name=edible_percent] { max-width:90px; }
.food-category-selects { display:flex; gap:6px; min-width:0; }
.food-category-selects select { flex:1; width:0; }
.food-editor-section { padding:0; border:0; margin:0 0 14px; min-width:0; }
.food-editor-section legend { padding:0; margin-bottom:10px; font-size:13px; font-weight:600; }
.food-editor-nutrients { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px 30px; }
.food-editor-nutrients label { display:grid; grid-template-columns:minmax(0,1fr) 88px; gap:8px; align-items:center; margin:0; font-weight:400; }
.food-editor-nutrients label>span { color:#617469; }
.food-editor-nutrients small { display:inline; margin:0; font-size:11px; white-space:nowrap; }
.food-editor .dialog-actions { margin-top:8px; padding-top:12px; }
@media(max-width:900px) { .food-editor-nutrients { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px 20px; } .food-editor-basics { grid-template-columns:minmax(0,1fr); gap:10px; } }
@media(max-width:540px) { .food-editor-nutrients { grid-template-columns:minmax(0,1fr); } .food-category-field { grid-template-columns:minmax(0,1fr); gap:6px; } .food-editor input { font-size:16px; min-height:36px; } }

/* Keep the creation form readable; field groups adapt to the available width. */
.content:has(.food-create-page) { max-width:1040px; margin-inline:0; padding-inline:24px; }
.food-create-page .page-heading { margin-bottom:18px; }
.food-page-link { color:var(--green); text-decoration:underline; text-underline-offset:3px; white-space:nowrap; }
.food-page-primary { text-decoration:none; }
.food-create-form { background:#fff; border:1px solid var(--line); border-radius:12px; padding:24px 28px; }
.food-create-fields { border:0; padding:0; margin:0; min-width:0; }
.food-create-fields>h2 { font-size:15px; margin-bottom:16px; }
.food-create-form .food-editor-basics { grid-template-columns:repeat(auto-fit,minmax(min(100%,360px),1fr)); margin-bottom:24px; gap:12px 24px; }
.food-create-form input,.food-create-form select { min-height:36px; }
.food-create-form .food-editor-section { margin-bottom:22px; }
.food-create-form .food-editor-section legend { font-size:14px; margin-bottom:12px; }
.food-create-form .food-editor-nutrients { grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:10px 24px; }
.food-create-form .food-editor-nutrients label { grid-template-columns:minmax(0,148px) 104px; gap:8px; justify-content:start; }
.food-create-form .food-editor-nutrients label>span { text-align:right; }
.food-create-actions { display:flex; align-items:center; gap:20px; margin-top:8px; }
.food-create-actions .food-page-link { padding-block:10px; }
@media(max-width:900px) { .food-create-form { padding:22px; } }
@media(max-width:760px) { .content:has(.food-create-page) { padding-inline:16px; } .food-create-page .page-heading { flex-wrap:wrap; gap:12px; } }
@media(max-width:540px) { .food-create-form { padding:20px 16px; } .food-create-form .food-editor-basics { gap:12px; } }

/* shadcn Skeleton uses the same table geometry as the food lists. */
.content[data-food-loading]>:not(.food-skeleton-root) { display:none; }
.food-library-results[data-food-table-loading] { position:relative; }
.food-library-results[data-food-table-loading]>:not(.food-skeleton-root) { visibility:hidden; }
.food-library-results[data-food-table-loading]>.food-skeleton-root { position:absolute; inset:0; overflow:hidden; }
.food-library-skeleton { pointer-events:none; user-select:none; }
.food-library-skeleton .food-library-card { border:1px solid var(--line); }
.content[aria-busy=true] .food-library-skeleton .table-wrap { opacity:1; }
.food-library-skeleton .food-loading-block { height:12px; max-width:100%; background:#e5ebe2; }
.food-library-skeleton .food-loading-title { width:140px; height:34px; margin-bottom:10px; }
.food-library-skeleton .food-loading-subtitle { width:270px; height:14px; }
.food-library-skeleton .food-loading-button { width:108px; height:40px; }
.food-library-skeleton .food-loading-search { width:230px; height:38px; }
.food-library-skeleton .food-loading-filter { width:150px; height:38px; }
.food-library-skeleton .food-loading-count { width:148px; }
.food-library-skeleton .food-loading-scope { display:flex; align-items:center; flex-wrap:wrap; gap:16px; margin-bottom:20px; padding:14px; background:#fff; border-radius:8px; }
.food-library-skeleton .food-loading-note { padding:15px; margin-bottom:21px; border-radius:9px; background:#faf6e9; }
.food-library-skeleton .food-loading-note .food-loading-block { width:75%; }
.food-library-skeleton .food-loading-pagination { display:flex; gap:16px; }
.food-loading-table { table-layout:fixed; }
.food-loading-table th:first-child { width:140px; }
.food-loading-table th:nth-child(2) { width:48px; }
.food-loading-table th.actions { width:70px; }
.food-library-skeleton .food-loading-name { width:104px; }
.food-library-skeleton .food-loading-name-short { width:78px; }
.food-library-skeleton .food-loading-source { width:24px; }
.food-library-skeleton .food-loading-column { width:38px; margin-left:auto; }
.food-library-skeleton .food-loading-unit { width:18px; height:8px; margin:5px 0 0 auto; }
.food-library-skeleton .food-loading-number { width:36px; margin-left:auto; }
.food-library-skeleton .food-loading-number-short { width:24px; margin-left:auto; }
.food-library-skeleton .food-loading-action { width:56px; margin-left:auto; }
@media(max-width:760px) { .food-library-skeleton .page-heading { flex-wrap:wrap; } .food-library-skeleton .food-loading-subtitle { width:220px; } }

.food-name-line { display:flex; align-items:center; gap:6px; max-width:200px; min-height:24px; line-height:24px; white-space:nowrap; }
.food-alias-host { display:inline-flex; flex-shrink:0; white-space:nowrap; }
.food-has-alias th:first-child,.food-has-alias td:first-child { min-width:180px; max-width:220px; }
.food-loading-table.food-has-alias th:first-child { width:200px; }
.food-library-skeleton .food-name-line>.food-loading-block { min-width:0; }
.food-library-skeleton .food-loading-alias { width:60px; }


/* One vertical scroll area: table on desktop, document on smaller viewports. */
@media screen and (min-width:1024px) and (min-height:640px) {
  .workspace-with-sidebar:has(.food-library-card) { display:flex; flex-direction:column; height:100dvh; min-height:0; overflow:hidden; }
  .workspace-with-sidebar:has(.food-library-card)>.workspace-topbar { flex-shrink:0; }
  .content:has(.food-library-card) { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; width:100%; margin:0; padding-block:20px; overflow:hidden; }
  .content:has(.food-library-card) :is(.page-heading,.campus-filter,.note,.food-loading-scope,.food-loading-note) { flex-shrink:0; margin-bottom:16px; }
  .content:has(.food-library-card) .page-heading { flex-wrap:wrap; gap:12px; }
  .content:has(.food-library-card) .heading-actions { flex-wrap:wrap; }
  .food-library-card { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; margin-bottom:0; }
  .food-library-card .filter,.food-library-card .library-pagination { flex-shrink:0; }
  .food-library-results { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
  .food-library-card .table-wrap { flex:1; min-height:0; overscroll-behavior:contain; scrollbar-gutter:stable; }
  .food-skeleton-root,.food-library-skeleton,.food-loading-content { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
}

/* Recipe library list, editor and loading states. */
.content:has(.recipe-library-card) { max-width:none; padding:14px 20px; }
.content:has(.recipe-library-card) .page-heading { margin-bottom:12px; }
.content:has(.recipe-library-card) .page-heading h1 { font-size:24px; margin-bottom:2px; }
.content:has(.recipe-library-card) .page-heading p { line-height:1.5; }
.recipe-library-card { padding:12px; }
.recipe-library-card .filter { margin-bottom:10px; gap:10px; }
.recipe-library-card .filter input { max-width:280px; padding:8px 10px; }
.recipe-table-scroll { max-height:max(180px,60dvh); overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.recipe-table-scroll:focus-visible { outline:2px solid #6c8f77; outline-offset:2px; }
.recipe-table { min-width:1456px; table-layout:auto; border-collapse:separate; border-spacing:0; }
.recipe-table th { position:sticky; top:0; z-index:2; font-size:12px; font-weight:600; color:#405c49; background:#eef2ea; box-shadow:0 1px 0 var(--line); }
.recipe-col-name { width:136px; }
.recipe-col-formula { width:248px; }
.recipe-col-nutrient { width:68px; }
.recipe-col-actions { width:52px; }
.recipe-table td,.recipe-table th { padding:6px 8px; line-height:20px; }
.recipe-table th small { display:block; color:var(--muted); font-size:10px; font-weight:400; line-height:14px; margin-top:1px; }
.recipe-table th:nth-child(2) small { display:inline; }
.recipe-table tbody tr { cursor:default; }
.recipe-table tbody tr:hover:not([data-selected="true"]) td { background:#f6f8f3; }
.recipe-table th:first-child,.recipe-table td.recipe-name { position:sticky; left:0; z-index:1; background:#fff; }
.recipe-table th:first-child { z-index:3; background:#eef2ea; }
.recipe-table .recipe-name .text-btn,.recipe-table .recipe-name strong { display:inline-block; max-width:144px; padding:0; text-align:left; font-weight:600; white-space:normal; overflow-wrap:anywhere; }
.recipe-formula-cell { max-width:280px; }
.recipe-table .actions .text-btn { padding:0; }
.recipe-formula { display:flex; flex-wrap:wrap; gap:0 10px; font-size:12px; line-height:18px; }
.recipe-formula>span { color:#60715a; overflow-wrap:anywhere; }
.recipe-formula b { color:#334e3d; font-weight:500; font-variant-numeric:tabular-nums; white-space:nowrap; }
.recipe-formula small { font-size:10px; color:var(--muted); }
.recipe-pagination { display:flex; flex-wrap:wrap; justify-content:flex-start; align-items:center; gap:8px; margin-top:10px; font-size:12px; color:var(--muted); }
.recipe-pagination .btn { padding:6px 10px; font-size:12px; }
.recipe-fields { border:0; padding:0; margin:0; min-width:0; }
.recipe-editor .card { margin-bottom:18px; }
.recipe-editor h2 { font-size:15px; margin:0 0 16px; }
.recipe-editor .card-title h2 { margin:0; }
.recipe-basic-fields { display:grid; grid-template-columns:2fr 1fr; gap:24px; }
.recipe-basic-fields label { margin:0; }
.recipe-ingredient-table { width:auto; max-width:100%; min-width:0; table-layout:auto; margin-bottom:14px; }
.recipe-ingredient-table th,.recipe-ingredient-table td { padding:10px 8px; vertical-align:middle; }
.recipe-ingredient-table th:nth-child(2) { width:128px; }
.recipe-ingredient-table th.numeric,.recipe-ingredient-table td.numeric,.recipe-ingredient-table .actions { text-align:left; }
.recipe-ingredient-table .ingredient-grams { width:112px; max-width:100%; margin:0; }
.recipe-food-selection { display:flex; align-items:center; gap:8px; }
.recipe-food-details { min-width:0; }
.recipe-ingredient-table .recipe-substitute { display:inline-flex; align-items:center; gap:4px; flex-shrink:0; padding:4px; font-size:12px; }
.recipe-substitute svg { flex-shrink:0; }
.recipe-ingredient-table .recipe-food-name { max-width:260px; padding:0; font-size:13px; line-height:20px; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.recipe-food-category { display:block; max-width:260px; color:var(--muted); font-size:11px; line-height:16px; margin:3px 0 0; overflow-wrap:anywhere; }
.recipe-food-category:empty { display:none; }
.recipe-ingredient-table .actions .text-btn { padding:4px; }
.recipe-help { font-size:12px; color:var(--muted); line-height:1.8; margin:12px 0 0; }
.recipe-editor-footer { display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; }
.recipe-editor-footer p { font-size:12px; color:var(--muted); }
.recipe-editor-footer>div { display:flex; align-items:center; gap:12px; }
.recipe-error { color:#a04432; font-size:13px; }
.recipe-food-picker { width:min(600px,94vw); }
.recipe-food-picker .filter { margin:16px 0; flex-wrap:nowrap; }
.recipe-food-picker .filter input { flex:1; min-width:0; }
.recipe-food-picker .filter select { max-width:150px; margin:0; }
.recipe-food-picker [hidden] { display:none; }
#recipe-picker-results { min-height:180px; max-height:45vh; overflow:auto; }
.recipe-candidates { display:flex; flex-direction:column; }
.recipe-candidates button { display:flex; justify-content:space-between; align-items:center; gap:16px; width:100%; padding:12px; background:white; border-bottom:1px solid var(--line); text-align:left; color:var(--green); }
.recipe-candidates button:hover,.recipe-candidates button:focus-visible { background:#eef4e9; }
.recipe-candidates strong { font-size:13px; font-weight:500; }
.recipe-candidates small { display:block; color:var(--muted); font-size:11px; margin-top:4px; }
.recipe-candidates button>span:last-child { font-size:12px; flex-shrink:0; }
.recipe-picker-footer { display:flex; justify-content:flex-end; margin-top:16px; }
.recipe-skeleton-block { display:block; height:12px; max-width:100%; background:#e5eadf; border-radius:4px; animation:recipe-pulse 1.8s ease-in-out infinite; }
.recipe-skeleton-block+.recipe-skeleton-block { margin-top:8px; }
.recipe-placeholder-65p { width:65%; }
.recipe-placeholder-70p { width:70%; }
.recipe-placeholder-75p { width:75%; }
.recipe-placeholder-90p { width:90%; }
.recipe-placeholder-100p { width:100%; }
.recipe-placeholder-90px { width:90px; }
.recipe-placeholder-100px { width:100px; }
.recipe-placeholder-150px { width:150px; }
.recipe-placeholder-220px { width:220px; }
.recipe-placeholder-230px { width:230px; }
.recipe-skeleton .page-heading { min-height:56px; }
.recipe-skeleton .page-heading>div { flex:1; min-width:0; }
.recipe-skeleton .page-heading>div>.recipe-skeleton-block:first-child { height:25px; }
.recipe-skeleton .filter>.recipe-skeleton-block,.recipe-skeleton .recipe-basic-fields>.recipe-skeleton-block { height:34px; }
.recipe-skeleton .recipe-basic-fields { margin-top:18px; }
.recipe-skeleton .card { margin-bottom:18px; }
.content[data-recipe-loading]>:not(.recipe-skeleton) { display:none; }
.recipe-library-results[data-recipe-loading] { position:relative; }
.recipe-library-results[data-recipe-loading]>:not(.recipe-skeleton) { visibility:hidden; }
.recipe-library-results[data-recipe-loading]>.recipe-skeleton { position:absolute; inset:0; overflow:hidden; }
.content[aria-busy=true] .recipe-skeleton .table-wrap { opacity:1; }
@keyframes recipe-pulse { 50% { opacity:.45; } }
@media(prefers-reduced-motion:reduce) { .recipe-skeleton-block { animation:none; } }
@media(max-width:760px) {
  .content:has(.recipe-library-card) { padding:12px; }
  .recipe-basic-fields { grid-template-columns:1fr; gap:12px; }
  .recipe-ingredient-table { display:block; width:100%; }
  .recipe-ingredient-table thead { display:none; }
  .recipe-ingredient-table tbody { display:block; }
  .recipe-ingredient-table tr { display:grid; grid-template-columns:minmax(0,1fr) 112px; align-items:center; gap:8px 12px; padding:12px 0; border-bottom:1px solid var(--line); }
  .recipe-ingredient-table td { min-width:0; padding:0; border:0; }
  .recipe-ingredient-table .recipe-food-name,.recipe-food-category { max-width:100%; }
  .recipe-ingredient-table .recipe-substitute { flex-direction:column; gap:2px; }
  .recipe-ingredient-table td.numeric::before { content:'用量（g / 人）'; display:block; margin-bottom:5px; text-align:left; font-size:11px; color:var(--muted); }
  .recipe-ingredient-table td.actions { grid-column:1 / -1; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; }
  .recipe-editor-footer { flex-direction:column; align-items:stretch; }
  .recipe-editor-footer>div { justify-content:flex-end; }
}

/* Keep the list's header, filters and pagination visible while its rows scroll. */
@media screen and (min-height:560px) {
  .workspace-with-sidebar:has(.recipe-library-card) { display:flex; flex-direction:column; height:100dvh; min-height:0; overflow:hidden; }
  .workspace-with-sidebar:has(.recipe-library-card)>.workspace-topbar { flex-shrink:0; }
  .content:has(.recipe-library-card) { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; width:100%; margin:0 auto; overflow:hidden; }
  .content:has(.recipe-library-card) :is(.page-heading,.campus-filter) { flex-shrink:0; margin-bottom:12px; }
  .content:has(.recipe-library-card) .page-heading { flex-wrap:wrap; gap:12px; }
  .recipe-library-card { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; margin-bottom:0; }
  .recipe-library-card .filter,.recipe-pagination { flex-shrink:0; }
  .recipe-library-results { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
  .recipe-table-scroll { flex:1; min-height:0; max-height:none; }
  .content:has(.recipe-library-card) .recipe-skeleton,.content:has(.recipe-library-card) .recipe-skeleton>div { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
  .recipe-skeleton .recipe-library-card .table-wrap { flex:1; min-height:0; overflow:hidden; }
  .recipe-library-results>.recipe-skeleton .table-wrap { overflow:hidden; }
}
@media print {
  .recipe-table-scroll { max-height:none; overflow:visible; }
  .recipe-table th,.recipe-table td:first-child { position:static; box-shadow:none; }
}

/* AI 营养助手: a launcher at the lower right of the recipe form and the chat window it opens (recipe-assistant.js). */
.content:has(#recipe-editor) { padding-bottom:112px; }
.recipe-assistant-launcher { position:fixed; right:24px; bottom:24px; z-index:40; display:grid; place-items:center; width:52px; height:52px; padding:0; border:1px solid #f1d99538; border-radius:50%; background:radial-gradient(circle at 30% 26%,#3a7a65,#234c40 56%,#18392f); color:#f3dc9b; box-shadow:0 14px 28px -12px #0c3126c2,0 4px 10px #0c312633,inset 0 1px 0 #ffffff2b; transition:box-shadow .16s ease,filter .16s ease; touch-action:none; user-select:none; }
.recipe-assistant-launcher:hover { filter:brightness(1.1); box-shadow:0 18px 32px -12px #0c3126d1,0 5px 12px #0c31263d,inset 0 1px 0 #ffffff33; }
.recipe-assistant-launcher:active { filter:brightness(.96); }
.recipe-assistant-launcher.dragging { cursor:grabbing; box-shadow:0 22px 40px -12px #0c3126d9,0 6px 14px #0c312640,inset 0 1px 0 #ffffff33; }
.recipe-assistant-launcher .cg-icon { width:24px; height:24px; stroke-width:1.8; }
.recipe-assistant-launcher[hidden] { display:none; }
/* While the AI thinks a gold arc turns around the launcher; a dot on it means an answer waits. */
.recipe-assistant-launcher.busy::before { content:''; position:absolute; inset:-5px; border:2px solid #e3b85a2e; border-top-color:#d9a845; border-radius:50%; animation:recipe-assistant-turn .9s linear infinite; }
@keyframes recipe-assistant-turn { to { rotate:1turn; } }
.recipe-assistant-badge { position:absolute; top:1px; right:1px; width:12px; height:12px; border-radius:50%; background:#e3a73c; box-shadow:0 0 0 2px #fff; }
.recipe-assistant { position:fixed; right:16px; bottom:16px; z-index:40; display:flex; flex-direction:column; width:min(420px,calc(100vw - 32px)); height:min(760px,calc(100dvh - 84px)); background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 70px #0c312638,0 4px 14px #0c31261a; overflow:hidden; }
.recipe-assistant[hidden] { display:none; }
.recipe-assistant-head { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 12px 12px 18px; border-bottom:1px solid var(--line); background:#f8faf6; }
.recipe-assistant-head h2 { display:flex; align-items:center; gap:7px; margin:0; font-size:15px; white-space:nowrap; }
.recipe-assistant-head h2 .cg-icon { color:#a8873e; }
.recipe-assistant-head .text-btn { display:inline-flex; align-items:center; gap:4px; }
.recipe-assistant-head-actions { display:flex; align-items:center; gap:2px; }
.recipe-assistant-head .text-btn[hidden] { display:none; }
.recipe-assistant-body { flex:1; min-height:0; overflow:auto; overscroll-behavior:contain; padding:14px 18px 12px; }
.recipe-assistant-foot { flex:none; padding:8px 18px 14px; border-top:1px solid var(--line); background:#fff; }
.recipe-assistant-foot .form-error { margin:0 0 8px; }
.recipe-assistant-note { font-size:13px; line-height:1.8; color:#526458; margin-bottom:12px; }
.recipe-assistant-muted { font-size:12px; line-height:1.7; color:var(--muted); margin:6px 0 10px; }
.recipe-assistant-target { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:10px; margin-bottom:12px; }
.recipe-assistant-target label { margin:0; font-size:12px; }
.recipe-assistant-target select { margin-top:4px; padding:7px 8px; font-size:12px; }
.recipe-assistant-status { margin-bottom:12px; }
.recipe-assistant-status[aria-busy=true] dl { opacity:.6; }
.recipe-assistant-subhead { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; margin:0 0 8px; font-size:12px; font-weight:600; color:#3d5a4b; }
.recipe-assistant-subhead small { font-weight:400; }
.recipe-assistant-nutrients { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:0; }
.recipe-assistant-nutrient { min-width:0; padding:6px 8px; border-radius:8px; background:#f4f7f1; }
.recipe-assistant-nutrient dt { font-size:11px; line-height:1.5; color:#6d7f73; }
.recipe-assistant-nutrient dd { display:flex; flex-wrap:wrap; align-items:baseline; gap:0 3px; margin:0; line-height:1.5; font-variant-numeric:tabular-nums; }
.recipe-assistant-nutrient dd b { font-size:14px; font-weight:600; color:#243d31; }
.recipe-assistant-nutrient dd small { font-size:11px; }
.recipe-assistant-share { margin-left:auto; font-size:11px; font-weight:600; color:#3f6b52; }
.recipe-assistant-share.over { color:#a0662c; }
.recipe-assistant-missing { font-size:11px; color:#a0662c; }
.recipe-assistant-ratio,.recipe-assistant-groups { font-size:12px; line-height:1.7; color:#526a5c; margin:8px 0 0; }
.recipe-assistant-undo { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:6px 6px 6px 12px; margin-bottom:12px; border-radius:9px; background:#eef4ea; font-size:12px; color:#2f5241; }
.recipe-assistant-undo .text-btn { display:inline-flex; align-items:center; gap:4px; font-weight:600; }
.recipe-assistant-thread { list-style:none; padding:12px 0 0; margin:0; display:flex; flex-direction:column; gap:10px; border-top:1px solid var(--line); }
.recipe-assistant-empty { font-size:14px; line-height:1.8; color:#526458; }
.recipe-assistant-msg { font-size:15px; line-height:1.8; overflow-wrap:anywhere; }
.recipe-assistant-msg p { margin:0 0 10px; line-height:1.8; }
.recipe-assistant-msg p:last-child { margin-bottom:0; }
.recipe-assistant-msg ul,.recipe-assistant-msg ol { margin:0 0 10px; padding-left:22px; }
.recipe-assistant-msg [data-answer-text] li { margin:5px 0; padding-left:2px; }
.recipe-assistant-msg [data-answer-text] strong { color:#183a2c; font-weight:650; }
.recipe-assistant-prose-heading { margin:16px 0 8px; font-size:16px; line-height:1.6; color:#183a2c; }
.recipe-assistant-prose-heading:first-child { margin-top:0; }
.recipe-assistant-msg.user { align-self:flex-end; max-width:88%; padding:8px 12px; border-radius:12px 12px 3px 12px; background:#234c40; color:#fff; white-space:pre-wrap; }
.recipe-assistant-msg.assistant { padding:10px 12px; border-radius:12px 12px 12px 3px; background:#f5f7f2; color:#243d31; }
.recipe-assistant-msg.pending { display:flex; align-items:flex-start; justify-content:space-between; gap:8px; color:var(--muted); font-size:12px; }
.recipe-assistant-msg.pending [data-assistant-stage]::before { content:''; display:inline-block; width:7px; height:7px; margin-right:7px; border-radius:50%; background:#a8873e; animation:recipe-pulse 1.2s ease-in-out infinite; }
.recipe-assistant-msg.pending [data-assistant-detail] { margin:4px 0 8px; font-size:12px; line-height:1.65; color:var(--muted); }
.recipe-assistant-tools { display:block; margin-top:10px; font-size:12px; color:#526458; }
.recipe-assistant-tools:empty { display:none; }
.recipe-assistant-msg.pending small { display:block; font-variant-numeric:tabular-nums; color:var(--muted); }
.recipe-assistant-incomplete { display:block; margin-top:8px; color:#8a5e25; }
.recipe-assistant-activity { padding-top:0; margin:0 0 12px; border-top:0; font-size:13px; color:#4f6558; }
.recipe-assistant-activity>summary { cursor:pointer; font-weight:600; padding:5px 0; margin-bottom:0; }
.recipe-assistant-activity ol { list-style:none; padding:0 0 0 10px; margin:8px 0 0 3px; border-left:2px solid #dce5d8; }
.recipe-assistant-activity li { position:relative; padding:0 0 10px 4px; }
.recipe-assistant-activity li:last-child { padding-bottom:0; }
.recipe-assistant-activity li::before { content:''; position:absolute; left:-15px; top:6px; width:6px; height:6px; border-radius:50%; background:#789380; }
.recipe-assistant-activity .activity-running::before { background:#a8873e; animation:recipe-pulse 1.2s ease-in-out infinite; }
.recipe-assistant-activity .activity-warning::before,.recipe-assistant-activity .activity-error::before { background:#aa6f29; }
.recipe-assistant-activity-head { display:flex; align-items:baseline; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.recipe-assistant-activity-head b { font-weight:600; color:#314b3e; }
.recipe-assistant-activity-head small { color:var(--muted); font-variant-numeric:tabular-nums; white-space:nowrap; }
.recipe-assistant-activity li p { margin:3px 0 0; }
@media (prefers-reduced-motion:reduce) { .recipe-assistant-activity .activity-running::before { animation:none; } }
@media (prefers-reduced-motion:reduce) { .recipe-assistant-msg.pending [data-assistant-stage]::before { animation:none; } .recipe-assistant-launcher { transition:none; } .recipe-assistant-launcher.busy::before { animation:none; border-color:#d9a845; } }
.recipe-proposal { margin-top:10px; padding:12px; border:1px solid #dfe6da; border-radius:10px; background:#fff; }
.recipe-proposal.applied { border-color:#9dbba6; box-shadow:inset 3px 0 0 #5f8a73; }
.plan-proposal-quality { margin:8px 0; padding:10px; background:#f7f4ed; border-radius:6px; font-size:13px; }
.plan-proposal-quality p,.plan-proposal-quality ul { margin:5px 0 0; }
.plan-proposal-quality summary { cursor:pointer; margin-top:5px; }
.recipe-proposal-effect caption { text-align:left; font-weight:600; margin-bottom:5px; }
.recipe-proposal h3 { font-size:16px; line-height:1.6; margin:0 0 8px; color:#183a2c; }
.recipe-proposal>p { font-size:14px; color:#4f6558; }
.recipe-proposal-changes { width:100%; margin:8px 0; font-size:13px; }
.recipe-proposal-changes th,.recipe-proposal-changes td { padding:5px 6px; line-height:1.5; }
.recipe-proposal-changes tbody th { background:none; color:#2f4a3c; font-size:13px; font-weight:550; white-space:normal; border-bottom:1px solid #edf0e9; }
.recipe-proposal-changes tbody tr:last-child th { border-bottom:0; }
.recipe-proposal-changes tbody th small { display:block; font-weight:400; }
.recipe-proposal-changes .numeric { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.recipe-proposal-changes tr.add td:last-child { color:#2f6b4c; font-weight:600; }
.recipe-proposal-changes tr.remove td:last-child { color:#a0513f; }
.recipe-proposal-changes tr.grams td:last-child { font-weight:600; }
.recipe-proposal-effect { font-size:11px; line-height:1.7; color:#5c7266; margin:4px 0 8px; }
.recipe-proposal-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; }
.recipe-proposal-actions .btn { padding:8px 14px; font-size:14px; gap:5px; }
.recipe-proposal-actions small { flex-basis:100%; font-size:12px; line-height:1.7; }
.recipe-proposal-state { display:inline-flex; align-items:center; gap:4px; font-size:14px; font-weight:600; color:#3f6b52; }
.plan-proposal .recipe-proposal-actions { margin:12px 0; }
.plan-proposal-verdict { padding:10px; border-radius:7px; background:#f7f4ed; color:#644b22; }
.plan-proposal-verdict.qualified { background:#edf5ed; color:#28523c; }
.plan-proposal-verdict strong,.plan-proposal-verdict span { display:block; }
.plan-proposal-verdict span { margin-top:4px; font-size:13px; font-weight:400; }
.plan-proposal-highlights { display:grid; gap:6px; margin:12px 0; font-size:14px; font-variant-numeric:tabular-nums; }
.plan-proposal-highlights>div { display:flex; flex-wrap:wrap; justify-content:space-between; gap:2px 8px; }
.plan-proposal-highlights dt { color:#465e50; }
.plan-proposal-highlights dd { margin:0; }
.plan-proposal-highlights small { margin-left:6px; color:#526458; font-size:12px; }
.recipe-assistant-msg .plan-proposal-swaps { padding:10px 10px 10px 26px; margin:10px 0; border-radius:7px; background:#edf4ee; font-size:14px; }
.plan-proposal-details { border-top:1px solid #e1e8df; padding:0; margin:4px 0 0; font-size:14px; }
.plan-proposal-details>summary { padding:11px 0; margin:0; cursor:pointer; color:#355846; font-size:14px; font-weight:550; line-height:1.6; }
.plan-proposal-details>summary:focus-visible,.recipe-assistant-activity>summary:focus-visible { outline:2px solid #52745d; outline-offset:2px; border-radius:3px; }
.plan-proposal-details[open]>summary { margin-bottom:4px; }
.plan-proposal-explanation { color:#465e50; }
.plan-proposal .recipe-proposal-changes { table-layout:fixed; }
.plan-proposal .recipe-proposal-changes th,.plan-proposal .recipe-proposal-changes td { padding:7px 4px; overflow-wrap:anywhere; }
.plan-proposal .recipe-proposal-changes thead th { font-size:12px; color:#526458; }
.plan-proposal .recipe-proposal-changes th:first-child { width:38%; }
.plan-proposal .recipe-proposal-effect th:first-child { width:32%; }
/* 评价 keeps clear of the right-aligned percentages before it. */
.plan-proposal .recipe-proposal-effect :is(th,td):last-child { padding-left:14px; }
.recipe-assistant-quick { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.recipe-assistant-chip { padding:4px 10px; border-radius:999px; border:1px solid #dfe6da; background:#f7f9f4; color:#355845; font-size:12px; }
.recipe-assistant-chip:hover:not(:disabled) { background:#ebf2e7; }
.recipe-assistant-ask textarea { min-height:62px; margin:0; font-size:15px; line-height:1.7; }
.recipe-assistant-send { display:flex; align-items:center; gap:8px; margin-top:8px; }
.recipe-assistant-send small { margin:0 auto 0 0; font-size:11px; }
.recipe-assistant-send .btn { padding:7px 14px; gap:6px; }
.recipe-assistant-announce,.recipe-assistant-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.recipe-assistant-off { margin:0; }
/* Phones: the window takes the screen until it is put away. */
@media (max-width:640px) {
  .recipe-assistant { inset:0; width:auto; height:auto; border:0; border-radius:0; }
  .recipe-assistant-launcher { right:16px; bottom:16px; }
  .recipe-assistant-target { grid-template-columns:minmax(0,1fr); gap:8px; }
}
/* 修改计划食谱 (plan-assistant.js): the launcher waits above the sticky save bar. */
.recipe-assistant-root[data-assistant=plan-assistant] .recipe-assistant-launcher { bottom:104px; }
/* Docked, the edit takes one column beside the window (the analysis under the menu, its energy in the save bar), so the
   menu and 保存修改 stay in view while proposals are applied. */
:root.plan-assistant-docked .plan-menu-layout { grid-template-columns:minmax(0,1fr); }
:root.plan-assistant-docked .plan-menu-analysis { position:static; max-height:none; }
:root.plan-assistant-docked .plan-menu-live { display:block; }
.recipe-assistant-msg .plan-proposal-changes { list-style:none; margin:6px 0; padding:0; display:flex; flex-direction:column; gap:8px; font-size:14px; }
.plan-proposal-changes>li { padding:6px 8px; border-radius:8px; background:#f7f9f4; line-height:1.6; }
.plan-proposal-changes>li .recipe-proposal-changes { margin:4px 0 0; }
.plan-proposal-where { display:block; font-size:13px; color:#526458; margin-bottom:4px; }
.plan-proposal-what b { font-weight:600; color:#2f4a3c; }
.plan-proposal-changes>li.remove .plan-proposal-what b { color:#a0513f; }
.plan-proposal-changes>li.add .plan-proposal-what b { color:#2f6b4c; }
@media (max-width:760px) { .recipe-assistant-root[data-assistant=plan-assistant] .recipe-assistant-launcher { bottom:136px; } }
/* Dragged elsewhere (assistant-window.js), the launcher and the floating window replace the positions above: --x and
   --y are their share of the room the viewport leaves around them, at least 16px from each edge, so they stay in view
   whatever the viewport. The title moves the window, except on phones, where it fills the screen. */
.recipe-assistant-root .recipe-assistant-launcher[data-placed] { inset:calc(16px + var(--y) * (100% - 32px)) auto auto calc(16px + var(--x) * (100% - 32px)); translate:calc(var(--x) * -100%) calc(var(--y) * -100%); }
@media (min-width:641px) {
  .recipe-assistant-root .recipe-assistant[data-placed] { inset:calc(16px + var(--y) * (100% - 32px)) auto auto calc(16px + var(--x) * (100% - 32px)); translate:calc(var(--x) * -100%) calc(var(--y) * -100%); }
  .recipe-assistant-head { cursor:move; touch-action:none; user-select:none; }
  .recipe-assistant-root .recipe-assistant[data-sized] { width:min(var(--w),calc(100% - 32px)); height:min(var(--h),calc(100% - 32px)); }
}
.recipe-assistant.dragging { box-shadow:0 32px 80px #0c312647,0 6px 18px #0c312626; }
/* Docked (assistant-window.js), the window takes the right of the screen from top to bottom and the workspace, its
   header included, narrows beside it, as DevTools docked to the right; its title row lines up with that header. */
.recipe-assistant-root .recipe-assistant[data-docked] { inset:0 0 0 auto; width:var(--assistant-dock-width,420px); height:auto; border-width:0 0 0 1px; border-radius:0; box-shadow:-18px 0 40px -34px #0c312666; translate:none; }
.recipe-assistant[data-docked] .recipe-assistant-head { height:52px; padding-block:0; background:#fff; }
:root:is(.recipe-assistant-docked,.plan-assistant-docked) .workspace-with-sidebar { margin-right:var(--assistant-dock-width,420px); }
/* Resizing (assistant-window.js): any edge or corner of the floating window, the left edge of the docked one, which
   shows a line while it is hovered or dragged, as a splitter does. */
.recipe-assistant-resize { position:absolute; z-index:2; touch-action:none; }
.recipe-assistant-resize[data-edge=n] { inset:0 12px auto; height:6px; cursor:ns-resize; }
.recipe-assistant-resize[data-edge=s] { inset:auto 12px 0; height:6px; cursor:ns-resize; }
.recipe-assistant-resize[data-edge=e] { inset:12px 0 12px auto; width:6px; cursor:ew-resize; }
.recipe-assistant-resize[data-edge=w] { inset:12px auto 12px 0; width:6px; cursor:ew-resize; }
.recipe-assistant-resize:is([data-edge=ne],[data-edge=se],[data-edge=sw],[data-edge=nw]) { width:14px; height:14px; }
.recipe-assistant-resize[data-edge=ne] { top:0; right:0; cursor:nesw-resize; }
.recipe-assistant-resize[data-edge=se] { bottom:0; right:0; cursor:nwse-resize; }
.recipe-assistant-resize[data-edge=sw] { bottom:0; left:0; cursor:nesw-resize; }
.recipe-assistant-resize[data-edge=nw] { top:0; left:0; cursor:nwse-resize; }
.recipe-assistant[data-docked] .recipe-assistant-resize:not([data-edge=w]) { display:none; }
.recipe-assistant[data-docked] .recipe-assistant-resize[data-edge=w] { inset:0 auto 0 0; width:6px; cursor:col-resize; }
.recipe-assistant[data-docked] .recipe-assistant-resize[data-edge=w]:hover,.recipe-assistant[data-docked].resizing .recipe-assistant-resize[data-edge=w] { background:linear-gradient(90deg,#b79a56 2px,transparent 2px); }
@media (max-width:640px) { .recipe-assistant-resize { display:none; } }
@media print { .recipe-assistant-root { display:none; } }

/* Platform recipe maintenance uses the same unscoped forms as the campus recipe editor. */
.content:has(.system-recipe-library){max-width:none;padding-inline:20px}
.system-recipe-library{padding:18px;min-width:0;container-type:inline-size}
.system-recipe-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px;border-bottom:1px solid var(--line)}
.system-recipe-tabs a{padding:10px 16px;border-bottom:2px solid transparent;color:var(--muted);font-weight:600;text-decoration:none}
.system-recipe-tabs a[aria-current=page]{border-color:var(--green);color:var(--green)}
.system-recipe-search{position:relative;display:block;width:100%;margin:0}
.system-recipe-search .cg-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted)}
.system-recipe-library .system-recipe-search input{width:100%;max-width:none;padding-left:38px;margin:0}
.system-recipe-library .filter{margin-bottom:12px}
.system-recipe-note{line-height:1.8;margin:12px 0 18px}
.system-recipe-results-title{display:flex;align-items:baseline;gap:12px;border-top:1px solid var(--line);padding-top:16px;margin-bottom:12px;flex-wrap:wrap}
.system-recipe-results-title h2{font-size:15px;margin:0}
.system-recipe-results-title>button{margin-left:auto}
.system-recipe-table-wrap{max-width:100%;overflow:auto;max-height:65vh;overscroll-behavior:contain;border-block:1px solid var(--line)}
.system-recipe-table{width:100%;min-width:1250px;border-collapse:separate;border-spacing:0;font-size:12px}
.system-recipe-table th,.system-recipe-table td{padding:12px 6px;line-height:1.6;border-bottom:1px solid var(--line);vertical-align:middle}
.system-recipe-table th{position:sticky;top:0;background:#fff;z-index:2;color:var(--muted);font-weight:500;white-space:nowrap}
.system-recipe-table th small{display:block;font-size:10px;color:var(--muted);font-weight:400}
.system-recipe-table .numeric{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
.system-recipe-table .actions{text-align:right;white-space:nowrap;position:sticky;right:0;background:#fff;z-index:1}
.system-recipe-table th.actions{z-index:3}
.system-recipe-table .system-recipe-name{position:sticky;left:0;z-index:1;min-width:145px;max-width:190px;background:#fff;color:var(--green);font-size:14px;font-weight:600;overflow-wrap:anywhere}
.system-recipe-table th:first-child{left:0;z-index:3}
.system-recipe-name .text-btn{padding:0;white-space:normal;text-align:left}
.system-recipe-name small{display:block;margin-top:4px;color:var(--muted);font-size:11px;font-weight:400}
.system-recipe-kind{display:inline-block;padding:0 6px;margin-right:7px;border-radius:20px;background:#f0f4ec;color:#77877e;font-size:11px;font-weight:400;white-space:nowrap}
.system-recipe-table .system-recipe-formula{min-width:300px;color:#5d6d64;line-height:1.9}
.system-recipe-grams{white-space:nowrap}
.system-recipe-sort{display:flex;flex-direction:column;align-items:flex-end;margin-left:auto;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer}
.system-recipe-sort:hover{color:var(--green)}
.system-recipe-sort:focus-visible{outline:2px solid var(--green);outline-offset:3px}
.system-recipe-table :is(.is-aim,.is-sorted),.system-recipe-table th[aria-sort=ascending],.system-recipe-table th[aria-sort=descending]{color:var(--green)}
.system-recipe-table .is-sorted,.system-recipe-table th[aria-sort=ascending],.system-recipe-table th[aria-sort=descending]{font-weight:600;background:#f5f8f1}
.system-recipe-table tbody tr:hover>td{background:#f3f7ef}
.system-recipe-scroll-hint{font-size:11px;color:var(--muted);margin:0 0 8px}
.system-recipe-library .plan-pager{padding-bottom:0;border:0}
@media(min-width:1650px){.system-recipe-scroll-hint{display:none}}
@media(max-width:640px){
  .content:has(.system-recipe-library){padding-inline:10px}.system-recipe-library{padding:12px}
  .system-recipe-tabs a{padding-inline:10px}.system-recipe-library .plan-filter-row{align-items:flex-start}
  .system-recipe-library .plan-pager{gap:6px;padding-inline:0}.system-recipe-library .plan-pager>span:last-child{flex-basis:100%}
  .system-recipe-table .system-recipe-name{min-width:110px;max-width:130px;font-size:12px}.system-recipe-table .actions{position:static}
}
.system-food-option{display:flex;justify-content:space-between;gap:16px;width:100%;padding:12px;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line,#e5e7eb);cursor:pointer}
.system-food-option:hover,.system-food-option:focus-visible{background:var(--green-bg,#edf7f0)}
.system-food-option small{color:var(--muted,#667085)}
#system-food-results{max-height:45vh;overflow:auto}
#system-recipe-editor .recipe-editor-footer>p{max-width:580px}
.system-food-choice{max-width:100%;white-space:normal;overflow-wrap:anywhere;text-align:left}

/* Keep all eleven numbers comparable on laptop screens; the complete formula gets a second line. */
@container (min-width:800px) and (max-width:1349px){
  .system-recipe-table{--nums:11;display:grid;min-width:0;grid-template-columns:minmax(140px,1fr) repeat(var(--nums),max-content) 56px}
  .system-recipe-table[data-nutrients="12"]{--nums:12}
  .system-recipe-table[data-more=true]{grid-template-columns:minmax(140px,1fr) 64px repeat(var(--nums),max-content) 56px}
  .system-recipe-table thead,.system-recipe-table tbody{display:contents}
  .system-recipe-table tr{display:grid;grid-column:1/-1;grid-template-columns:subgrid;border-bottom:1px solid var(--line)}
  .system-recipe-table td{grid-row:1;border:0;padding-bottom:4px;min-width:0}
  .system-recipe-table td[colspan]{grid-column:1/-1}
  .system-recipe-table th{border:0;padding-inline:4px}
  .system-recipe-table thead>tr{position:sticky;top:0;z-index:3;background:#fff}
  .system-recipe-table .system-recipe-name{position:static;min-width:0;max-width:none}
  .system-recipe-table .system-recipe-formula{grid-row:2;grid-column:1/-1;min-width:0;padding-top:0;padding-bottom:12px}
  .system-recipe-table .system-recipe-formula-head{display:none}
  .system-recipe-table .actions{position:static}
  .system-recipe-scroll-hint{display:none}
}
