/* Sheets */
.diet-profile-form{display:grid;gap:15px}
.diet-profile-form>p{font-size:13px;line-height:2;color:var(--muted)}
.diet-profile-form label{display:grid;gap:7px;font-size:13px;font-weight:700}
.diet-profile-form select{width:100%;min-width:0;min-height:48px;padding:9px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--ink);font:inherit;font-size:16px}
.diet-profile-form select:disabled{opacity:.45}
.meal-portion,.food-result small{display:block;margin-top:7px;font-size:11px;line-height:1.8;font-weight:400;color:var(--muted);overflow-wrap:anywhere}
.detail-description p{white-space:pre-line;overflow-wrap:anywhere}
.diet-status{padding:24px 18px;border:1px solid var(--line);border-radius:17px;text-align:center;background:var(--surface)}
.diet-status h2{font-size:18px;line-height:1.8}
.diet-status p{margin:12px 0;font-size:13px;line-height:2;color:var(--muted)}
.more-results{display:block;margin:12px auto}
.app-sheet{--sheet-top:74px;--sheet-height:calc(100dvh - var(--sheet-top));position:fixed;inset:var(--sheet-top) 0 0;width:100%;max-width:510px;height:auto;min-height:var(--sheet-height);max-height:var(--sheet-height);margin:0 auto;padding:18px 20px calc(26px + env(safe-area-inset-bottom));border:1px solid var(--line);border-bottom:0;border-radius:24px 24px 0 0;background:var(--paper);color:var(--ink);overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;box-shadow:0 -12px 48px #213d4217}
.app-sheet::backdrop{background:#213d4266;backdrop-filter:blur(6px)}
.sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin-bottom:20px}
.sheet-heading h1{min-width:0;font-size:18px;line-height:1.65;overflow-wrap:anywhere;letter-spacing:-.4px}
.close-button{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:44px;height:44px;padding:13px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--ink)}
.close-button:hover{background:#e8faf5}
.close-button .icon{width:17px;height:17px}
.app-sheet>.close-button{margin-right:auto;margin-bottom:15px}

/* Food picker */
.search-box{display:flex;align-items:center;gap:10px;min-height:50px;margin-bottom:15px;padding:10px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--muted);transition:border-color .16s,box-shadow .16s}
.search-box .icon{width:19px;height:19px}
.search-box input{width:100%;min-width:0;border:0;background:none;font-size:16px;font-weight:400;color:var(--ink)}
.search-box input:focus-visible{outline:0}
.search-box:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px #213d4214}
.search-box input::placeholder{color:var(--muted)}
.entry-methods{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 0 20px}
.entry-methods button{display:flex;align-items:center;justify-content:center;gap:9px;min-height:48px;padding:9px 14px;border:1px solid #3cd5af;border-radius:13px;background:var(--brand);color:#213d42;font-size:13px;font-weight:700}
.entry-methods button:hover{background:#9eead7}
.entry-methods .icon{width:19px;height:19px;color:var(--ink)}
.search-results{padding:0 12px;border:1px solid var(--line);border-radius:17px;background:var(--surface);overflow:hidden}
.food-result{display:flex;align-items:center;gap:12px;min-height:88px;padding:14px 0;border-bottom:1px solid var(--line)}
.food-result:last-child{border-bottom:0}
.food-result>img,.food-result>.food-emoji{flex-shrink:0;width:64px;height:64px;border-radius:14px;object-fit:cover}
.food-result>span:not(.food-emoji){flex:1;min-width:0;font-size:15px;font-weight:700;line-height:1.7;overflow-wrap:anywhere}
.food-result small{margin-top:5px;font-size:12px}
.food-result .outline{flex-shrink:0;min-width:76px;min-height:44px;padding:7px 9px;font-size:12px}
.filter-block{margin-bottom:17px}
.sort-chips{display:flex;align-items:center;gap:4px;margin-bottom:12px;padding:3px;border:1px solid var(--line);border-radius:13px;background:#e8faf5}
.sort-chips button{display:flex;flex:1;align-items:center;justify-content:center;gap:5px;min-height:40px;padding:7px 6px;border-radius:10px;background:transparent;white-space:nowrap;font-size:11px;color:var(--muted)}
.sort-chips .icon{width:15px;height:15px;color:var(--accent)}
.sort-chips .active{background:var(--surface);color:var(--ink);font-weight:700;box-shadow:0 2px 5px #213d420a}
.category-chips{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding:1px 0 4px}
.category-chips button{display:flex;flex-shrink:0;align-items:center;gap:7px;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);white-space:nowrap;font-size:12px;color:var(--muted)}
.category-chips button span{display:flex;align-items:center}
.category-chips .icon{width:17px;height:17px}
.category-chips button.active{border-color:#bbf0e3;background:#e8faf5;color:var(--accent);font-weight:700}
.category-chips button:focus-visible{outline-offset:-3px}

/* Food detail */
.detail-sheet{--sheet-top:0px;padding:0;border:0;border-radius:0;background:var(--surface)}
.detail-cover{position:relative;width:100%;max-width:360px;aspect-ratio:1;margin-inline:auto;background:var(--surface);overflow:hidden}
.detail-cover>img,.detail-cover>.food-emoji{display:block;width:100%;height:100%;border-radius:0;object-fit:contain}
.detail-back{position:absolute;z-index:1;top:calc(16px + env(safe-area-inset-top));left:16px;width:44px;height:44px;border:1px solid #ffffff80;border-radius:14px;background:#fffffff0;color:var(--ink);backdrop-filter:blur(8px)}
.detail-body{position:relative;margin-top:0;padding:12px 20px calc(26px + env(safe-area-inset-bottom));border-radius:24px 24px 0 0;background:var(--surface)}
.sheet-handle{width:30px;height:3px;margin:0 auto 18px;border-radius:3px;background:#bbf0e3}
.detail-body>h1{margin-bottom:11px;font-size:21px;line-height:1.6;letter-spacing:-.5px}
.food-tags{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 20px}
.food-tags span{padding:4px 9px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:#536b70;font-size:10px;font-weight:700}
.food-tags .category{border-color:#bbf0e3;background:#effcf9;color:var(--accent)}
.nutrition-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:0 0 20px}
.nutrition-grid>div{position:relative;min-height:97px;padding:14px 13px 12px;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
.nutrition-grid>div>span{position:absolute;top:12px;left:12px;display:flex;align-items:center;justify-content:center;width:27px;height:27px;border:1px solid #d8f7ef;border-radius:8px;background:var(--surface);color:var(--accent);font-size:16px}
.nutrition-grid>div>span .icon{width:16px;height:16px}
.nutrition-grid h2{margin-bottom:13px;padding-left:28px;font-size:11px;color:var(--muted);font-weight:400}
.nutrition-grid strong{display:block;font-size:21px;line-height:1.2;font-variant-numeric:tabular-nums;letter-spacing:-.6px}
.nutrition-grid small{font-size:10px;font-weight:400;letter-spacing:0;color:var(--muted)}
.detail-description{margin:0 0 20px;padding:0 0 20px;border-bottom:1px solid var(--line)}
.detail-description h2{margin-bottom:8px;font-size:14px}
.detail-description p{font-size:13px;line-height:2;color:#536b70}
.fruit-portions{margin:0 0 20px;border:1px solid #bceee0;border-radius:16px;overflow:clip;background:#fff}
.fruit-portions summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:64px;padding:13px 16px;list-style:none;cursor:pointer;background:#effbf7;color:#213d42}
.fruit-portions summary::-webkit-details-marker{display:none}.fruit-portions summary::marker{content:''}.fruit-portions summary:after{content:'';width:7px;height:7px;flex:none;margin-inline-end:3px;border:solid currentColor;border-width:0 0 2px 2px;transform:rotate(-45deg)}.fruit-portions[open] summary:after{transform:rotate(135deg)}.fruit-portions summary:focus-visible{outline:2px solid #213d42;outline-offset:-4px;border-radius:15px}
.fruit-portions summary strong{display:block;font-size:13px}.fruit-portions summary small{display:block;margin-top:5px;font-size:10px;color:#536b70}.fruit-portions-body{padding:0 12px 10px}.fruit-portions-body>p{margin:12px 2px;font-size:11px;line-height:2;color:#536b70}.fruit-portions table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:11px;line-height:1.9;text-align:right;overflow-wrap:anywhere}.fruit-portions th,.fruit-portions td{padding:10px 5px;border-bottom:1px solid #e8f3ee;vertical-align:middle}.fruit-portions thead th{font-size:10px;color:#536b70;background:#f4faf7}.fruit-portions th:first-child{width:34%}.fruit-portions th:last-child{width:26%}.fruit-portions tbody th{font-weight:600;color:#213d42}.fruit-portions td:last-child{white-space:nowrap;color:#536b70;font-size:10px}.fruit-portions tbody tr:nth-child(even){background:#f7fcfa}.fruit-portions tbody tr:last-child>*{border-bottom:0}

/* Text entry */
.describe-sheet{--sheet-top:calc(10dvh + 60px)}
.ai-label{display:inline-flex;align-items:center;gap:7px;margin:0 0 13px;padding:5px 9px;border:1px solid #bbf0e3;border-radius:8px;background:#e8faf5;color:var(--accent);font-size:11px;font-weight:700}
.ai-label .icon{width:16px;height:16px}
.ai-title{font-size:22px;line-height:1.65;letter-spacing:-.5px;text-wrap:balance}
.ai-intro{margin:12px 0 22px;font-size:13px;line-height:2;color:var(--muted)}
.description-field{display:block;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--surface);font-size:12px;font-weight:700}
.description-field:focus-within{border-color:#9eead7}
.description-field textarea{display:block;width:100%;min-height:138px;margin-top:11px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#f7fdfb;resize:vertical;color:var(--ink);font-size:16px;font-weight:400;line-height:1.9}
.description-field textarea::placeholder{color:var(--muted)}
.note-empty{padding:22px 15px;border:1px dashed #bbf0e3;border-radius:15px;background:transparent}
.saved-notes article{position:relative;margin-bottom:10px;padding:14px 14px 14px 48px;border:1px solid var(--line);border-radius:14px;background:var(--surface);font-size:13px;line-height:1.9}
.saved-notes article p{overflow-wrap:anywhere}
.saved-notes small{display:block;margin-top:7px;font-size:10px;color:var(--muted)}
.saved-notes button{position:absolute;top:8px;left:4px;color:var(--muted)}

/* Menu and information */
.guide-content{padding:21px 19px;border:1px solid var(--line);border-radius:17px;background:var(--surface)}
.guide-content>.icon{width:46px;height:46px;margin:0 auto 16px;padding:10px;border:1px solid #bbf0e3;border-radius:14px;background:#e8faf5;color:var(--accent)}
.guide-content h2{margin-bottom:20px;font-size:18px;text-align:center;line-height:1.8;letter-spacing:-.4px}
.guide-content p{margin:13px 0;font-size:13px;line-height:2.1;color:#536b70}
.progress-cards{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:21px 0 13px}
.progress-cards>div{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:17px 15px;border:1px solid var(--line);border-radius:17px;background:var(--surface)}
.progress-cards>div:first-child{border-color:var(--night);background:var(--brand);color:#213d42}
.progress-cards .icon{width:21px;height:21px;margin-bottom:7px;color:var(--accent)}
.progress-cards>div:first-child .icon{color:var(--ink)}
.progress-cards strong{font-size:24px;line-height:1.3;font-variant-numeric:tabular-nums;letter-spacing:-1px}
.progress-cards span{font-size:11px;color:var(--muted)}
.progress-cards>div:first-child span{color:#536b70}
.daily-total{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:18px 15px;border:1px solid var(--line);border-radius:15px;background:var(--surface)}
.daily-total>span{font-size:12px;color:var(--muted)}
.daily-total strong{font-size:23px;white-space:nowrap;line-height:1.3;letter-spacing:-.6px}
.daily-total small{font-size:10px;font-weight:400;letter-spacing:0;color:var(--muted)}
.exercise-detail-photo{height:238px;overflow:hidden;border:1px solid var(--line);border-radius:17px;background:#e8faf5}
.exercise-detail-photo>img,.exercise-detail-photo>.food-emoji{width:100%;height:100%;object-fit:cover}
.exercise-detail-stats{display:flex;flex-wrap:wrap;gap:8px;margin:16px 0}
.exercise-detail-stats>span{display:flex;gap:8px;max-width:100%;padding:8px 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--muted);font-size:12px}
.exercise-detail-stats b{min-width:0;color:var(--accent);overflow-wrap:anywhere}

@media(min-width:700px){
 .app-sheet{--sheet-top:65px}
 .detail-sheet{--sheet-height:calc(100dvh - 40px);inset:20px 0;height:var(--sheet-height);border-radius:24px}
 .describe-sheet{--sheet-top:100px}
}
@media(max-width:370px){
 .app-sheet{padding-inline:15px}
 .sheet-heading h1{font-size:16px}
 .search-results{padding:0 9px}
 .food-result{gap:8px}
 .food-result>img,.food-result>.food-emoji{width:56px;height:56px;border-radius:12px}
 .food-result>span:not(.food-emoji){font-size:14px}
 .food-result .outline{min-width:70px;padding:7px;font-size:12px}
 .sort-chips button{font-size:10px;padding:7px 4px;gap:3px}
 .detail-sheet{padding:0}
 .detail-body{padding-inline:16px}
 .nutrition-grid>div{padding-inline:10px}
 .nutrition-grid>div>span{left:8px}
 .ai-title{font-size:20px}
 .guide-content{padding:18px 15px}
 .daily-total{padding:16px 12px}
 .daily-total>span{font-size:11px}
 .daily-total strong{font-size:21px}
}

.food-credits{text-align:right;border-top:1px solid var(--line);margin-top:24px;padding-top:16px;font-size:12px;line-height:1.9;overflow-wrap:anywhere}
.food-credits summary{cursor:pointer;font-size:14px;font-weight:700;color:var(--ink);padding:10px 0}
.food-credit-list{list-style:none;margin:0;padding:0}
.food-credit-list li{padding:14px 0;border-top:1px solid var(--line)}
.guide-content .food-credits p{font-size:12px;margin:6px 0}
.food-credits a{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
