.app-loading:not([open]){display:none!important}.app-loading[open]{position:fixed;inset:0;margin:auto;width:min(340px,calc(100vw - 48px));max-width:none;max-height:calc(100dvh - 48px);height:fit-content;padding:0;border:0;border-radius:8px;background:var(--surface,#fff);color:var(--ink);box-shadow:0 20px 60px #00152555;animation:none;transform:none;overflow:auto}.app-loading::backdrop{background:color-mix(in srgb,var(--chrome,#123e32) 65%,transparent);backdrop-filter:blur(5px)}
.app-loading-panel{width:100%;padding:32px 24px;border-radius:inherit;background:var(--surface,#fff);color:var(--ink,#16435a);display:grid;justify-items:center;gap:14px;text-align:center}
.app-loading-panel progress{width:100%;height:7px;accent-color:var(--accent,#ff9b45)}.app-loading-panel small{color:var(--muted)}
.app-loading-spinner{width:42px;height:42px;border:4px solid var(--line,#d3dfd8);border-top-color:var(--accent,#ff9b45);border-radius:50%;animation:faitu-spin .8s linear infinite}@keyframes faitu-spin{to{transform:rotate(360deg)}}
input[readonly]{pointer-events:none;caret-color:transparent}
.day-choice-row{display:flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:8px;padding:6px;margin:8px 0}.day-choice-row>[data-day]{flex:1;min-width:0;border:0;margin:0;text-align:left}.day-choice-row .icon-btn{flex-shrink:0}.day-choice-row[aria-current=true]{border-color:var(--accent)}
.goal-rule{padding:18px;border:1px solid var(--line);border-radius:8px;background:var(--surface,#fff);box-shadow:0 3px 12px #00000006}.goal-rule-heading{margin-bottom:12px}.goal-rule-heading strong{font-size:1.1rem}.goal-rule-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.goal-rule-result{margin-top:10px;font-size:.8rem;color:var(--muted)}.goal-top{grid-template-columns:1fr!important}.day-name-field{margin:12px 0 20px}.duplicate-options{display:grid;gap:16px;margin:20px 0}.duplicate-options label{display:flex;align-items:center;gap:10px}.duplicate-options input{width:auto}
.recipe-editor-modal .food-rows{overflow:visible}.recipe-editor-modal .recipe-composition{overflow:visible}.recipe-editor-modal .recipe-picker{max-height:75dvh;overflow:auto}.recipe-editor-modal .recipe-row{user-select:none}.recipe-editor-modal .recipe-row input{user-select:text}.recipe-editor-modal .insert-slot{min-height:12px}
/* Compact shared day/plan lists keep all actions inside the modal. */
dialog.selection-modal{width:min(540px,calc(100vw - 20px));padding:22px 16px}
.selection-modal .modal-top{margin-bottom:14px}
.selection-modal .day-choices,.selection-modal .fit-plan-choices{display:grid;gap:6px;max-height:55dvh;overflow-y:auto;overflow-x:hidden;margin-top:12px;padding:2px}
.selection-modal .selection-choice{display:flex;flex-wrap:nowrap;align-items:center;gap:3px;min-width:0;min-height:48px;padding:3px 4px;margin:0;border:1px solid var(--line);border-radius:6px;background:var(--surface);box-sizing:border-box}
.selection-modal .selection-choice>[data-day],.selection-modal .selection-choice>[data-plan-view]{flex:1 1 0;min-width:0;min-height:40px;padding:5px 6px;gap:6px;margin:0;border:0;background:transparent;border-radius:4px;color:var(--ink);font-size:13px;overflow:hidden}
.selection-modal .selection-choice>[data-day] span,.selection-modal .selection-choice strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;overflow-wrap:normal;font-size:13px}
.selection-modal .selection-choice small{font-size:10px;margin-top:1px}
.selection-modal .selection-choice .icon-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 34px;min-width:34px;width:34px;height:38px;min-height:38px;padding:7px;gap:0;margin:0;border:1px solid var(--line);border-radius:4px;background:var(--surface);color:var(--ink)}
.selection-modal .selection-choice .icon-btn svg{width:17px;height:17px;flex:none}
.selection-modal .selection-choice[aria-current=true]{border:2px solid var(--accent);padding:2px 3px;background:color-mix(in srgb,var(--accent) 16%,var(--surface));box-shadow:inset 4px 0 var(--accent)}
.selection-modal .selection-choice[aria-current=true]>[data-day],.selection-modal .selection-choice[aria-current=true]>[data-plan-view]{font-weight:800}
.selection-modal .selection-choice[aria-current=true]>[data-day]:before,.selection-modal .selection-choice[aria-current=true]>[data-plan-view]:before{content:'✓';color:var(--ink);font-size:12px;float:left;margin-right:5px}
.selection-modal .new-day-choice,.selection-modal .fit-plan-actions{margin-bottom:6px}
.selection-modal .fit-plan-actions .btn{padding:8px 10px;min-height:38px;font-size:12px}
/* Keep targets versus food totals identifiable on phones too. */
:root .daily-dashboard .dashboard-caption{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px;margin:0 0 4px}
:root .daily-dashboard .dashboard-caption strong{font-size:10px}
:root .daily-dashboard .dashboard-caption>span{font-size:9px}
@media(max-width:600px){:root .daily-dashboard .dashboard-caption>span{display:none}}

.app-confirm-dialog{width:min(420px,calc(100vw - 28px));background:var(--surface);color:var(--ink);padding:24px}.app-confirm-dialog h2{font-size:21px;margin:0 0 12px}.app-confirm-dialog>p{font-size:14px;line-height:1.5}.app-confirm-dialog .modal-actions{justify-content:flex-end}
