.ml-screen,.ml-home { min-width:0; overflow-wrap:anywhere; color:var(--ink); }
.ml-screen { display:grid; gap:14px; }
.ml-tabs,.ml-tools,.ml-home-heading { display:flex; align-items:center; gap:7px; }
.ml-tabs { flex-wrap:wrap; border-bottom:1px solid var(--line); gap:3px; }
.ml-action,.ml-search { font:inherit; color:var(--ink); border-radius:8px; }
.ml-action { padding:7px 11px; min-height:36px; border:1px solid var(--line); background:white; color:var(--pine); cursor:pointer; font-size:.84rem; font-weight:650; }
.ml-tabs .ml-action { border:0; border-bottom:2px solid transparent; border-radius:7px 7px 0 0; background:transparent; min-height:41px; }
.ml-tabs .ml-action[aria-pressed=true] { border-bottom-color:var(--pine); }
.ml-action:hover,.ml-action[aria-pressed=true] { background:var(--mint); }
.ml-grid { display:grid; grid-template-columns:minmax(240px,.82fr) minmax(0,1.35fr); gap:16px; align-items:start; }
.ml-box { min-width:0; border:1px solid var(--line); background:white; border-radius:15px; padding:clamp(15px,2vw,24px); }
.ml-box h3,.ml-home h2 { font-size:1.08rem; font-weight:650; letter-spacing:-.02em; margin:0; }
.ml-muted,.ml-detail small,.ml-energy span,.ml-macros span,.ml-kicker,.ml-chart-dates { color:var(--muted); }
.ml-muted { margin:.35rem 0; font-size:.82rem; }
.ml-summary.ml-box { background:linear-gradient(130deg,#e9f6ed,white 78%); }
.ml-kicker { font-size:.71rem; font-weight:650; letter-spacing:.11em; text-transform:uppercase; margin:0; }
.ml-energy { display:flex; flex-wrap:wrap; gap:6px; align-items:baseline; }
.ml-energy strong,.ml-stat { font-size:clamp(1.7rem,4vw,2.25rem); line-height:1.2; font-weight:650; letter-spacing:-.045em; font-variant-numeric:tabular-nums; }
.ml-energy span { font-size:.84rem; }
.ml-progress { display:block; appearance:none; overflow:hidden; border:0; height:6px; width:100%; margin:8px 0 4px; border-radius:8px; background:#dcebe3; accent-color:var(--pine); }
.ml-progress::-webkit-progress-bar { background:#dcebe3; }
.ml-progress::-webkit-progress-value { background:var(--pine); border-radius:8px; }
.ml-progress::-moz-progress-bar { background:var(--pine); }
.ml-macros { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; border-top:1px solid var(--line); padding-top:8px; margin-top:10px; }
.ml-macros span,.ml-macros strong { display:block; font-size:.78rem; }
.ml-definition,.ml-detail summary { display:flex; align-items:baseline; justify-content:space-between; gap:10px; padding:8px 0; min-width:0; }
.ml-definition { font-size:.84rem; border-top:1px solid var(--line); }
.ml-definition strong { text-align:right; font-size:.82rem; font-weight:600; }
.ml-detail { border-top:1px solid var(--line); }
.ml-detail:first-of-type { margin-top:10px; }
.ml-detail summary { cursor:pointer; align-items:center; list-style:none; min-height:47px; }
.ml-detail summary::-webkit-details-marker { display:none; }
.ml-detail summary:hover,.ml-more summary:hover { color:var(--pine); }
.ml-detail-label { flex:1; min-width:0; }
.ml-detail-label strong,.ml-detail-label small { display:block; }
.ml-detail-label strong { font-size:.96rem; font-weight:600; }
.ml-detail-label small,.ml-detail-value { font-size:.78rem; }
.ml-detail-value { text-align:right; max-width:44%; }
.ml-chevron { flex:none; color:var(--pine); }
.ml-detail[open] .ml-chevron { transform:rotate(180deg); }
.ml-detail[open] { padding-bottom:7px; }
.ml-detail>.ml-definition { margin-inline:8px; }
.ml-prose { white-space:pre-line; margin:.4rem 0; font-size:.88rem; }
.ml-more { margin-top:14px; font-size:.83rem; }
.ml-more summary { cursor:pointer; color:var(--pine); font-weight:620; padding-block:6px; }
.ml-tools { margin:12px 0; flex-wrap:wrap; }
.ml-search { flex:1; min-width:8rem; max-width:30rem; width:100%; line-height:1.25; padding:8px 10px; background:white; border:1px solid #afc5b8; }
.ml-stat { display:block; }
.ml-trend { display:flex; align-items:end; gap:3px; height:85px; padding-block:10px 3px; border-bottom:1px solid var(--line); }
.ml-trend span { flex:1; min-width:1px; border-radius:4px 4px 0 0; background:#328977; }
.ml-trend .ml-day-unknown { background:#c8d6ce; }
.ml-chart-dates { display:flex; justify-content:space-between; margin-block:5px; font-size:.75rem; }
.ml-home { container-type:inline-size; }
.ml-home-heading { justify-content:space-between; gap:8px; margin-bottom:8px; }
.ml-home-heading .ml-action { border:0; background:transparent; padding:3px; min-height:32px; }
.ml-home-summary { margin-bottom:10px; }
.ml-home-summary .ml-energy strong { font-size:1.65rem; }
.ml-home-compact { display: none; }
.ml-home-entries { margin-top: 12px; }
.ml-home-entries .ml-definition { padding-block: 6px; }
@media (max-width: 760px), (min-width: 761px) and (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .ml-home-heading { margin-bottom: 2px; }
  .ml-home-heading h2 { font-size: .9rem; }
  .ml-home-heading .ml-action { min-height: 28px; font-size: .75rem; }
  .ml-home-compact { display: block; }
  .ml-home-nutrient { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 2px 10px; margin: 3px 0; font-size: .85rem; line-height: 1.25; }
  .ml-home-nutrient > span { font-size: .78rem; color: var(--muted); }
  .ml-home-nutrient > strong { text-align: right; font-variant-numeric: tabular-nums; }
  .ml-home-nutrient small { color: var(--muted); font-weight: 500; }
  .ml-home-nutrient .ml-progress { grid-column: 1 / -1; height: 4px; margin: 0; }
  .ml-home-entries, .ml-home-summary { display: none; }
}
@media(min-width:1100px) {
  .ml-catalog { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 22px; align-items:start; }
  .ml-catalog .ml-detail:first-of-type { margin-top:0; }
}
@media(max-width:700px) {
  .ml-grid { grid-template-columns:minmax(0,1fr); gap:10px; }
  .ml-screen { gap:9px; }
  .ml-tabs { flex-wrap:nowrap; overflow-x:auto; }
  .ml-tabs .ml-action { min-width:max-content; padding:7px 9px; }
  .ml-box { padding:14px; border-radius:12px; }
}

.ml-editor { color:var(--ink); width:min(550px,calc(100% - 22px)); max-height:89dvh; margin:auto; padding:clamp(15px,3vw,25px); border:1px solid var(--line); border-radius:16px; background:#fff; overflow:auto; }
.ml-editor::backdrop {background:#09231f70;}
.ml-editor h2 {font-size:1.35rem;} .ml-editor h3 {font-size:1rem;margin-block:8px;}
.ml-editor fieldset {border:0;padding:0;margin:8px 0; min-width:0;}
.ml-editor legend {font-size:.75rem;font-weight:650;color:var(--muted);}
.ml-editor label {display:grid; gap:3px; margin:7px 0; font-size:.8rem;font-weight:600; min-width:0;}
.ml-editor input,.ml-editor select,.ml-editor textarea {font:inherit;font-weight:400;min-width:0;width:100%;min-height:36px;border:1px solid var(--line);border-radius:7px;padding:6px 8px;background:white;color:var(--ink);}
.ml-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 10px;}
.ml-editor p {margin:6px 0;font-size:.82rem;color:var(--muted);}
.ml-edit-items {margin-block:10px;}
.ml-edit-item {display:grid;grid-template-columns:minmax(0,1fr) minmax(72px,92px) auto;align-items:center;gap:8px;border-bottom:1px solid var(--line);padding-block:4px;}
.ml-edit-item strong {font-size:.86rem;overflow-wrap:anywhere;}
.ml-picker {background:#f3f8f4; padding:12px; border:1px solid var(--line);border-radius:10px;}
.ml-editor-actions {display:flex;flex-wrap:wrap;gap:7px;justify-content:flex-end;margin-top:10px;}
.ml-editor .ml-primary {background:var(--pine);color:white;border-color:var(--pine);}
.ml-editor [role=status]:not(:empty) {font-weight:600;color:var(--pine);}
.ml-editor [hidden] {display:none;}
