.nut-page,.nut-dialog {
  --nut-ink:#292536; --nut-muted:#696675; --nut-accent:#7050b6; --nut-border:#e8e3ee;
  color:var(--nut-ink);font:inherit;
}
.nut-page *, .nut-dialog * {box-sizing:border-box}
.nut-page [hidden],.nut-dialog [hidden]{display:none!important}
.nut-page button,.nut-dialog button,.nut-dialog input,.nut-dialog select,.nut-dialog textarea,.nut-page input{font:inherit}
.nut-page button,.nut-dialog button{cursor:pointer}
.nut-page :focus-visible,.nut-dialog :focus-visible{outline:3px solid #ab87e8;outline-offset:2px}
.nut-page {border:1px solid var(--nut-border);border-radius:22px;background:white;padding:25px;min-width:0;box-shadow:0 5px 18px #36265105}
.nut-toolbar,.nut-toolbar>div,.nut-date,.nut-day-summary,.nut-add-meal,.nut-round,
.nut-meal-info>span,.nut-form-header,.nut-form-header h2,.nut-icon-button,.nut-footer,.nut-light,.nut-primary,.nut-photo-actions,
.nut-text-btn,.nut-calculator summary,.nut-calc-fields,.nut-portions>div,.nut-choice,.nut-photo-symbol,.nut-day-summary span,.nut-grams{display:flex;align-items:center}
.nut-toolbar,.nut-day-summary{justify-content:space-between;gap:14px}
.nut-toolbar>div{gap:12px;white-space:nowrap;font-size:17px}
.nut-round,.nut-photo-symbol{background:#f1eafa;color:#7650b2;border-radius:13px;display:inline-flex;justify-content:center;width:40px;height:40px;flex:none}
.nut-date {gap:8px;color:var(--nut-muted);font-size:12px}
.nut-date input{min-width:0;border:1px solid var(--nut-border);border-radius:9px;background:#fff;height:37px;padding:5px 8px;color:var(--nut-ink)}
.nut-day-summary{margin:22px 0;background:linear-gradient(110deg,#f6efff,#f2edf8);border:1px solid #ebe3f5;border-radius:16px;min-height:135px;padding:22px 28px}
.nut-day-summary span{gap:6px;color:#68517f;font-weight:600;font-size:13px}
.nut-day-summary strong{display:block;font-size:clamp(34px,5vw,48px);color:#4b316d;line-height:1.2;margin-top:8px;font-weight:650;letter-spacing:-1.3px}
.nut-day-summary strong small{font-size:16px;font-weight:500;letter-spacing:0;color:#796787}
.nut-count{color:#584768;font-size:26px;font-weight:600}
.nut-count small{font-size:14px;font-weight:500}
.nut-meal-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:14px}
.nut-meal-card{position:relative;display:grid;grid-template-columns:minmax(70px,30%) 1fr;align-items:center;gap:14px;min-height:105px;text-align:left;padding:0 22px 0 0;border:1px solid var(--nut-border);background:white;border-radius:14px;color:var(--nut-ink);overflow:hidden}
.nut-meal-card:hover,.nut-meal-card:focus-visible{border-color:#c8b2df;background:#fcfaff}
.nut-meal-image{align-self:stretch;display:grid;place-items:center;background:#f5eff8;color:#ad96bc;min-height:104px}
.nut-meal-image img{width:100%;height:100%;object-fit:cover;display:block}
.nut-meal-info{min-width:0;display:grid;gap:5px;padding:10px 0}
.nut-meal-info strong{font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.nut-meal-info>span{gap:7px;font-size:12px;color:var(--nut-muted)}
.nut-meal-info i{width:3px;height:3px;border-radius:50%;background:#aba5b0}
.nut-meal-info small{font-size:13px;color:#7551a4}
.nut-edit{position:absolute;right:9px;top:10px;color:#a79caf}
.nut-add-meal{margin-top:16px;gap:6px;justify-content:center;background:#fbf9fe;border:1px dashed #d5c7e8;border-radius:11px;min-height:43px;width:100%;color:#6d4e9e;font-weight:600}
.nut-blank{padding:20px;display:grid;place-items:center;gap:10px;font-size:13px;color:var(--nut-muted);text-align:center}
.nut-blank strong{font-size:17px;color:var(--nut-ink)}
.nut-dialog{border:1px solid #e9e4ee;border-radius:23px;padding:0;width:min(510px,calc(100vw - 26px));max-width:none;max-height:calc(100dvh - 30px);margin:auto;background:#fff;box-shadow:0 24px 90px #2d1c4c38;overflow:hidden}
.nut-dialog::backdrop{background:#21172e68;backdrop-filter:blur(3px)}
.nut-form{display:flex;flex-direction:column;max-height:calc(100dvh - 34px);margin:0}
.nut-form-header{padding:18px 22px;gap:12px;border-bottom:1px solid var(--nut-border)}
.nut-form-header h2{font-size:20px;font-weight:700;letter-spacing:-.04em;margin:0}
.nut-icon-button{background:#f7f5f9;border:0;border-radius:50%;width:34px;height:34px;justify-content:center;margin-left:auto;color:var(--nut-muted)}
.nut-form-body{overflow:auto;overscroll-behavior:contain;padding:18px 22px;display:grid;grid-template-columns:minmax(0,1fr);gap:15px}
.nut-photo-picker{display:grid;justify-items:center;border:1px dashed #d7cae8;border-radius:15px;padding:12px;background:#fbf9fd;gap:10px}
.nut-preview{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;font-size:14px;color:#5a496e}
.nut-preview img{width:100%;max-height:165px;object-fit:contain;border-radius:10px}
.nut-photo-symbol{width:42px;height:42px;background:#f2eafa}
.nut-photo-actions{justify-content:center;gap:8px;flex-wrap:wrap}
.nut-photo-picker>small{font-size:11px;color:var(--nut-muted)}
.nut-photo-picker>small a{color:#6c5189}
.nut-light,.nut-primary{font-size:14px!important;justify-content:center;gap:6px;border:1px solid var(--nut-border);border-radius:9px;min-height:36px;padding:7px 12px;line-height:1.25;background:white;color:var(--nut-ink)}
.nut-light:hover,.nut-text-btn:hover{background:#f5effa}
.nut-primary{background:var(--nut-accent);border-color:transparent;color:#fff;font-weight:600!important}
.nut-primary:hover{background:#6343a6}
.nut-primary:disabled{opacity:.6}
.nut-text-btn,.nut-delete{border:0;background:transparent;color:var(--nut-accent);font-size:13px!important;min-height:30px;padding:3px;border-radius:5px}
.nut-analysis{font-size:13px;line-height:1.6;color:#63516f;background:#f6f1fb;border:1px solid #e6dcef;border-radius:11px;padding:10px 13px}
.nut-analysis .nut-text-btn{color:#634292;text-decoration:underline}
.nut-candidates{display:flex;flex-wrap:wrap;gap:5px}
.nut-choice{border:1px solid #dbceeb;border-radius:7px;padding:5px 8px;background:#fff;color:#62477d;font-size:12px!important;text-align:left;line-height:1.45}
.nut-choice:first-child{margin-top:3px}
.nut-portion-adjust{display:flex;align-items:center;flex-wrap:wrap;gap:7px}
.nut-scale{display:flex;gap:4px;margin-top:7px}
.nut-scale button{border:1px solid #d7cce4;border-radius:7px;padding:5px 7px;color:#614581;background:#fff;font-size:12px}
.nut-scale button[aria-pressed=true],.nut-choice[aria-pressed=true]{background:#e5d6f3;border-color:#ae8cca;color:#48305f}
.nut-grams{gap:7px;margin-top:7px}
.nut-grams input{width:80px;border:1px solid #d2cbdc;border-radius:6px;padding:4px}
.nut-categories{padding:0;border:0;margin:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.nut-categories legend,.nut-field{font-size:13px;font-weight:600;color:#474052}
.nut-categories legend{padding:0;margin-bottom:7px}
.nut-categories label{position:relative}
.nut-categories input{opacity:0;position:absolute;width:1px;height:1px}
.nut-categories label span{display:grid;place-items:center;padding:7px 2px;border:1px solid #e5e0ea;border-radius:8px;background:#fff;font-size:13px;color:#736b7a;cursor:pointer}
.nut-categories input:checked+span{border-color:#bda2da;background:#f3ebfa;color:#6e479f;font-weight:650}
.nut-categories input:focus-visible+span{outline:2px solid #9670ca;outline-offset:1px}
.nut-field{display:block;min-width:0}
.nut-field input,.nut-field select,.nut-field textarea{color:var(--nut-ink);display:block;width:100%;min-width:0;max-width:100%;border:1px solid #e1dce6;background:#fff;border-radius:9px;padding:9px 11px;line-height:1.3;margin-top:5px;min-height:40px;font-size:14px;font-weight:400}
.nut-field textarea{resize:vertical}
.nut-field input::placeholder,.nut-field textarea::placeholder{color:#898393}
.nut-optional{color:var(--nut-muted);font-size:12px;font-weight:400}
.nut-field-pair{display:grid;grid-template-columns:1.1fr 1fr;gap:10px}
.nut-unit{position:relative}
.nut-unit input{padding-right:50px}
.nut-unit>span{position:absolute;right:11px;top:50%;transform:translateY(-50%);font-size:12px;color:#776d81}
.nut-calculator{border:1px solid #e9e0f2;border-radius:10px;background:#fcfaff;min-width:0}
.nut-calculator summary{color:#705498;padding:9px 12px;gap:7px;font-size:13px;font-weight:600;cursor:pointer;list-style:none}
.nut-calculator summary::-webkit-details-marker{display:none}
.nut-calculator summary svg:last-child{margin-left:auto}
.nut-calculator[open] summary svg:last-child{transform:rotate(180deg)}
.nut-calc-body{padding:0 10px 10px}
.nut-calc-fields{align-items:flex-end;gap:7px}
.nut-calc-fields .nut-field:first-child{flex:1.9}
.nut-calc-fields .nut-field:nth-child(2){flex:.65}
.nut-calc-fields>button{margin-bottom:2px;flex:none}
.nut-calc-body small{font-size:11px;color:var(--nut-muted);display:block;margin-top:7px}
.nut-calc-body small a{color:#6e508e}
.nut-portions>div{font-size:12px;gap:8px;border-bottom:1px solid #eee7f3;padding:6px 0}
.nut-portions>div b{margin-left:auto;font-weight:600}
.nut-portions>div button{padding:3px;display:grid;place-items:center;border:0;border-radius:5px;color:#816e91;background:#efe8f4}
.nut-portions>.nut-light{width:100%;margin-top:6px;background:#f2eaf9;border-color:#decee9;color:#6c4b92}
.nut-error{font-size:13px;color:#aa3947;margin:0}
.nut-footer{justify-content:flex-end;gap:8px;padding:14px 22px;padding-bottom:max(14px,env(safe-area-inset-bottom));border-top:1px solid var(--nut-border)}
.nut-delete{margin-right:auto;color:#a84454;padding:4px 8px}
.nut-footer .nut-primary,.nut-footer .nut-light{min-height:40px;padding:8px 17px}
@media(max-width:550px){
  .nut-page{padding:15px;border-radius:16px}
  .nut-toolbar>div{font-size:15px;gap:7px}
  .nut-date{font-size:0;gap:0}
  .nut-date input{font-size:13px;width:135px}
  .nut-day-summary{padding:16px;min-height:110px;margin:15px 0}
  .nut-count{font-size:22px}
  .nut-dialog{width:100%;max-height:94dvh;margin:auto 0 0;border-radius:20px 20px 0 0;border-bottom:0}
  .nut-form{max-height:94dvh}
  .nut-form-header,.nut-form-body,.nut-footer{padding-left:16px;padding-right:16px}
  .nut-field input,.nut-field textarea,.nut-field select,.nut-grams input{font-size:16px}
}
