#library{background:var(--bg);color:var(--ink);border-radius:3px;padding:28px;min-height:75vh}
#library .eyebrow,#library .sub,#library .muted{color:var(--muted)}
#library .heading{color:var(--ink)}
#library .library-toolbar .search{background:#fff;color:var(--ink);border-color:var(--line);font-size:16px;padding:16px 19px}
#library .library-toolbar .search::placeholder{color:#61717a}
#library .chips button{background:#fff;color:#415b65;border-color:var(--line);border-radius:4px}
#library .chips button.on{background:#2c4a57;color:#fff;border-color:#2c4a57}
#library .food-count{color:var(--muted)}
#library #libraryGrid{display:grid;grid-template-columns:1fr;gap:0;background:#fff;border:1px solid var(--line);border-radius:4px;overflow:hidden}
#library .food-card{min-height:0;background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;box-shadow:none;padding:16px 20px;display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,auto) auto;column-gap:20px;align-items:center;color:var(--ink)}
#library .food-card:last-child{border-bottom:0}
#library .food-card:hover{background:#f7fafb;transform:none}
#library .food-card .card-head{grid-column:1;grid-row:1;justify-content:flex-start;gap:9px}
#library .food-card .card-head .eyebrow{display:none}
#library .food-card .card-head .tag{background:#e8eef0;color:#294a55}
#library .food-card h3{grid-column:1;grid-row:2;font-family:inherit;font-size:18px;margin:5px 0;color:var(--ink)}
#library .food-card>p.muted{grid-column:1;grid-row:3;margin:0;color:#526570;line-height:1.5}
#library .food-card .macro{grid-column:2;grid-row:1/4;margin:0;min-width:220px}
#library .food-card .macro div{background:#f2f5f6;color:var(--ink);min-width:90px}
#library .food-card .macro small{color:#526570}
#library .food-card .macro + p.muted{grid-column:2;grid-row:4;margin:5px 0 0;color:#526570;font-size:12px;line-height:1.5}
#library .food-card .detail-open-hint{grid-column:3;grid-row:1/4;color:#2c4a57;white-space:nowrap}
#library .food-card .missing{grid-column:2;grid-row:1/4;color:#775a2a}
.food-sheet-wrap{position:fixed;inset:0;background:#16212999;z-index:80;display:none;align-items:flex-end;justify-content:center;padding:12px}
.food-sheet-wrap.open{display:flex}
.food-sheet{width:min(720px,100%);max-height:94vh;overflow:auto;background:#fff;color:var(--ink);border-radius:12px 12px 4px 4px;padding:24px;box-shadow:0 25px 80px #101b2533}
.food-sheet-top{display:flex;justify-content:space-between;align-items:center;gap:15px}
.food-sheet-top h2{font-size:24px;margin:0}
.food-sheet-close{border:0;background:#e8eef0;color:var(--ink);border-radius:50%;width:42px;height:42px;font-size:25px;cursor:pointer}
.food-sheet-card{background:#f2f5f6;border-radius:4px;padding:20px;margin:22px 0}
.food-sheet-identity{display:flex;gap:15px;align-items:center;margin-bottom:19px}
.food-sheet-icon{width:70px;height:70px;border-radius:4px;background:#e3ebee;color:#233d49;display:grid;place-items:center;font-size:32px}
.food-sheet-identity strong{display:block;font-size:23px}
.food-sheet-identity small{display:block;margin-top:6px;color:#526570}
.food-sheet-macros{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;border-top:1px solid #d7dfe2;padding-top:18px}
.food-sheet-macros span{font-size:11px;color:#526570}
.food-sheet-macros b{display:block;margin-top:6px;color:var(--ink);font-size:20px;font-weight:600}
.food-sheet-macros span:first-child b{color:#2c4a57}
.food-unit-tabs{display:grid;grid-template-columns:repeat(3,1fr);border-bottom:1px solid #d7dfe2;margin:15px 0}
.food-unit-tabs button{background:none;border:0;color:#526570;padding:14px;cursor:pointer;font-size:17px}
.food-unit-tabs button.active{color:#2c4a57;border-bottom:3px solid #2c4a57}
.food-sheet-quantity{display:flex;justify-content:space-between;align-items:center;background:#f2f5f6;border-radius:4px;padding:18px;margin-bottom:14px}
.food-sheet-quantity input{width:100px;background:transparent;color:#2c4a57;border:0;text-align:right;font-size:30px;outline:0}
.food-sheet-quantity span{color:#526570}
.food-sheet-help{color:#526570;font-size:12px;line-height:1.6}
.food-sheet-keypad{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:18px 0}
.food-sheet-keypad button{min-height:56px;border:1px solid #d7dfe2;border-radius:4px;background:#f2f5f6;color:var(--ink);font-size:24px;cursor:pointer}
.food-sheet-keypad button:hover{background:#e5edf0}
.food-sheet-keypad .save{background:#2c4a57;color:#fff;font-size:20px;font-weight:800}
.food-sheet-footer{display:flex;gap:10px;align-items:center}
.food-sheet-footer select,.food-sheet-footer button{border:1px solid #d7dfe2;background:#fff;color:var(--ink);border-radius:4px;padding:12px}
.food-sheet-footer select{flex:1}
.food-sheet-footer button{cursor:pointer}
.food-sheet-status{min-height:22px;color:#2c4a57;font-size:13px;margin-top:10px}
.food-sheet button:focus-visible,.food-sheet input:focus-visible,.food-sheet select:focus-visible,#library .food-card:focus-visible,#library .chips button:focus-visible{outline:2px solid #2c4a57;outline-offset:2px}
@media(max-width:720px){#library{padding:18px;border-radius:0;margin:-19px -15px}#library .food-card{grid-template-columns:1fr auto;gap:4px;padding:14px}#library .food-card .macro{grid-column:1/3;grid-row:4;min-width:0;margin-top:7px}#library .food-card .detail-open-hint{grid-column:2;grid-row:2;font-size:11px}#library .food-card .macro div{min-width:0}.food-sheet-wrap{padding:0}.food-sheet{border-radius:22px 22px 0 0;padding:18px;max-height:96vh}.food-sheet-macros{gap:4px}.food-sheet-macros b{font-size:16px}}
@media(max-width:720px){#library .food-card .macro + p.muted{grid-column:1/3;grid-row:5}}
@media(max-width:720px){#library .library-toolbar{flex-wrap:wrap;align-items:stretch;gap:10px}#library .library-toolbar>div:first-child{flex:1 1 100%!important;max-width:none!important}#library .library-toolbar>div:last-child{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;width:100%}#library .library-toolbar button{white-space:normal;padding:11px 7px;font-size:12px}}
