/* ==========================================================================
   Tharvik - Calorie Tracker screen (js/calories.js), 2026-10-13.
   Same tokens as the rest of the app, so dark and light both work.
   ========================================================================== */

.cl-wrap{ max-width:540px; margin:0 auto; padding-bottom:44px; display:flex; flex-direction:column; gap:14px; }
.cl-eyebrow{ font:700 10.5px var(--font-ui); letter-spacing:.12em; text-transform:uppercase; color:var(--text-dim); }
.cl-hint{ margin:0; font:500 12px/1.45 var(--font-ui); color:var(--text-dim); text-wrap:pretty; }
.cl-ic{ display:inline-flex; width:22px; height:22px; }
.cl-ic svg{ width:100%; height:100%; display:block; }
#caloriePanel button:focus-visible, #caloriePanel input:focus-visible, #caloriePanel textarea:focus-visible{ outline:2px solid var(--gold); outline-offset:2px; }

/* ---- meal cards inside Tharvik's chat replies: the ring is drawn from that meal's macros ---- */
.meal-icon.meal-ring{ width:48px; height:48px; }
.meal-macros{ display:flex; flex-wrap:wrap; gap:3px 12px; margin-top:5px; font:600 11.5px 'Manrope', sans-serif; color:var(--text-dim); font-variant-numeric:tabular-nums; }
.meal-macros span{ display:inline-flex; align-items:center; gap:5px; }
.meal-macros i{ width:7px; height:7px; border-radius:50%; display:inline-block; }
.meal-macros [data-m="p"] i, .meal-macros span[data-m="p"] i{ background:var(--z-body, #5AA8FF); }
.meal-macros span[data-m="c"] i{ background:var(--gold); }
.meal-macros span[data-m="f"] i{ background:var(--z-team, #A58BFF); }

/* ---- day bar ---- */
.cl-daybar{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.cl-nav{ flex:0 0 auto; width:38px; height:38px; border-radius:50%; border:1px solid var(--line-strong); background:var(--panel); color:var(--text); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.cl-nav:disabled{ opacity:.35; cursor:default; }
.cl-nav .cl-ic{ width:18px; height:18px; }
.cl-daytitle{ flex:1; min-width:0; text-align:center; display:flex; flex-direction:column; gap:1px; }
.cl-daytitle b{ font:700 27px/1.05 var(--font-display); color:var(--text); }
.cl-daytitle span{ font:500 12px var(--font-ui); color:var(--text-dim); }
.cl-today{ flex:1 1 100%; align-self:center; height:30px; border:0; background:transparent; color:var(--gold); font:700 12.5px var(--font-ui); cursor:pointer; text-decoration:underline; text-underline-offset:3px; }

/* ---- summary ---- */
.cl-sum{ padding:18px 18px 16px; border-radius:22px; border:1px solid var(--accent-line); background:linear-gradient(160deg, var(--accent-tint) 0%, transparent 62%), var(--panel); display:flex; flex-direction:column; gap:16px; }
.cl-sum-top{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.cl-sum-l{ display:flex; flex-direction:column; align-items:flex-start; gap:3px; min-width:0; }
.cl-bignum{ font:400 60px/1 var(--font-ui); letter-spacing:-.02em; color:var(--text); font-variant-numeric:tabular-nums; }
.cl-left{ margin-top:2px; font:800 14px var(--font-ui); color:var(--gold); font-variant-numeric:tabular-nums; }
.cl-sum.over .cl-left{ color:var(--ember); }
.cl-sub{ font:600 12px var(--font-ui); color:var(--text-dim); font-variant-numeric:tabular-nums; }
.cl-goalbtn{ margin-top:6px; padding:4px 0; border:0; background:transparent; color:var(--gold); font:700 12.5px var(--font-ui); cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.cl-ringbox{ position:relative; flex:0 0 auto; width:118px; height:118px; }
.cl-ring{ width:100%; height:100%; display:block; }
.cl-ring circle{ transition:stroke-dasharray .7s cubic-bezier(.2,.7,.2,1), stroke-dashoffset .7s cubic-bezier(.2,.7,.2,1); }
.cl-ring-track{ stroke:var(--line); }
.cl-sum.over .cl-ring-track{ stroke:var(--ember); stroke-opacity:.35; }
.cl-ringc{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; }
.cl-ringc b{ font:700 17px 'Manrope', sans-serif; font-variant-numeric:tabular-nums; color:var(--text); }
.cl-macros{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:14px; }
.cl-mtop{ display:flex; flex-direction:column; gap:1px; margin-bottom:6px; }
.cl-mtop span{ font:700 10.5px var(--font-ui); letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); }
.cl-mtop b{ font:700 13px 'Manrope', sans-serif; font-variant-numeric:tabular-nums; color:var(--text); white-space:nowrap; }
.cl-mtrack{ height:6px; border-radius:var(--r-pill); background:var(--line); overflow:hidden; }
.cl-mfill{ display:block; height:100%; border-radius:var(--r-pill); transition:width .7s cubic-bezier(.2,.7,.2,1); }

/* ---- 7 days ---- */
.cl-week{ padding:14px 14px 10px; border-radius:18px; border:1px solid var(--line); background:var(--panel); }
.cl-whead{ display:flex; justify-content:space-between; align-items:baseline; gap:10px; margin-bottom:8px; }
.cl-wavg{ font:600 11.5px var(--font-ui); color:var(--text-dim); font-variant-numeric:tabular-nums; }
.cl-wcols{ display:grid; grid-template-columns:repeat(7, minmax(0, 1fr)); gap:4px; }
.cl-wday{ display:flex; flex-direction:column; align-items:center; gap:5px; padding:6px 0 5px; border:1px solid transparent; border-radius:12px; background:transparent; cursor:pointer; color:var(--text-dim); }
.cl-wday span{ font:700 11px var(--font-ui); text-transform:uppercase; }
.cl-wday.today span{ color:var(--gold); }
.cl-wday.sel{ background:var(--accent-tint); border-color:var(--accent-line); }
.cl-wday.sel span{ color:var(--text); }
.cl-wbarbox{ width:100%; height:54px; display:flex; align-items:flex-end; justify-content:center; }
.cl-wbar{ display:block; width:58%; max-width:22px; border-radius:6px 6px 3px 3px; background:var(--gold); opacity:.8; transition:height .5s ease; }
.cl-wday.sel .cl-wbar{ opacity:1; }
.cl-wbar.over{ background:var(--ember); }
.cl-wbar.none{ background:var(--line-strong); opacity:.7; }

.cl-insights{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; margin-top:10px; padding-top:12px; border-top:1px solid var(--line); }
.cl-ins{ display:flex; flex-direction:column; align-items:center; gap:2px; text-align:center; }
.cl-ins b{ font:700 19px 'Manrope', sans-serif; font-variant-numeric:tabular-nums; color:var(--text); }
.cl-ins span{ font:600 10.5px/1.3 var(--font-ui); color:var(--text-dim); }
.cl-askcoach{ align-self:flex-start; height:38px; padding:0 16px; border-radius:var(--r-pill); border:1px solid var(--accent-line); background:var(--accent-tint); color:var(--text); font:700 13px var(--font-ui); cursor:pointer; }
.cl-askcoach:active{ transform:scale(.98); }

/* ---- add ---- */
.cl-add{ display:flex; flex-direction:column; gap:10px; }
.cl-addtitle{ font:700 13px var(--font-ui); color:var(--text); }
.cl-addrow{ display:grid; grid-template-columns:1.25fr 1fr 1fr; gap:8px; }
.cl-addbtn{ min-height:92px; padding:12px 6px 10px; border-radius:18px; border:1px solid var(--line-strong); background:var(--panel); color:var(--text); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; cursor:pointer; text-align:center; }
.cl-addbtn b{ font:800 14px var(--font-ui); }
.cl-addbtn small{ font:600 11px var(--font-ui); color:var(--text-dim); }
.cl-addbtn .cl-ic{ margin-bottom:2px; }
.cl-addbtn:active, .cl-primary:active, .cl-chip:active{ transform:scale(.98); }
#caloriePanel button, #caloriePanel input{ touch-action:manipulation; }
.cl-photo{ background:var(--gold); border-color:var(--gold); color:var(--ink); }
.cl-photo small{ color:var(--ink); opacity:.75; }
.cl-photo.limit{ opacity:.55; }

/* ---- recents ---- */
.cl-recent{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.cl-chips{ display:flex; gap:8px; overflow-x:auto; padding:2px 2px 6px; margin:0 -2px; scrollbar-width:none; }
.cl-chips::-webkit-scrollbar{ display:none; }
.cl-chip{ flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-start; gap:1px; max-width:190px; padding:9px 13px; border-radius:14px; border:1px solid var(--line-strong); background:transparent; color:var(--text); cursor:pointer; text-align:left; }
.cl-chip span{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font:700 13px var(--font-ui); }
.cl-chip em{ font:600 11px 'Manrope', sans-serif; font-style:normal; color:var(--gold); }

/* ---- meals ---- */
.cl-meals{ display:flex; flex-direction:column; gap:14px; }
.cl-grp{ display:flex; flex-direction:column; gap:7px; }
.cl-grph{ display:flex; justify-content:space-between; align-items:baseline; }
.cl-grpk{ font:600 12px 'Manrope', sans-serif; color:var(--text-dim); font-variant-numeric:tabular-nums; }
.cl-mlist{ border:1px solid var(--line); border-radius:18px; background:var(--panel); overflow:hidden; }
.cl-meal{ display:flex; align-items:center; border-bottom:1px solid var(--line); }
.cl-meal:last-child{ border-bottom:0; }
.cl-mthumb, .cl-mico{ flex:0 0 auto; width:44px; height:44px; margin-left:12px; border-radius:12px; object-fit:cover; }
.cl-mico{ display:flex; align-items:center; justify-content:center; background:var(--accent-tint); border:1px solid var(--accent-line); color:var(--gold); }
.cl-mico .cl-ic{ width:21px; height:21px; }
.cl-new{ animation:clFlash 1.4s ease-out; }
@keyframes clFlash{ 0%{ background:var(--accent-tint); box-shadow:inset 3px 0 0 var(--gold); } 100%{ background:transparent; box-shadow:inset 3px 0 0 transparent; } }
.cl-mmain{ flex:1; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:13px 2px 13px 12px; border:0; background:transparent; color:var(--text); text-align:left; cursor:pointer; }
.cl-mmain:active{ background:var(--accent-tint); }
.cl-mact{ flex:0 0 auto; width:40px; height:48px; border:0; background:transparent; color:var(--text-dim); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.cl-mact .cl-ic{ width:18px; height:18px; }
.cl-mact:active{ color:var(--text); }
.cl-meal-del{ margin-right:4px; }
.cl-meal-del:hover, .cl-meal-del:active{ color:var(--ember); }
.cl-mtxt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cl-mtxt b{ font:700 14.5px/1.3 var(--font-ui); overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.cl-mtxt span{ font:500 12px/1.35 var(--font-ui); color:var(--text-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-mtxt small{ font:600 10.5px 'Manrope', sans-serif; color:var(--text-dim); font-variant-numeric:tabular-nums; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cl-mk{ flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; }
.cl-mk b{ font:700 19px 'Manrope', sans-serif; font-variant-numeric:tabular-nums; color:var(--text); }
.cl-mk span{ font:600 10px var(--font-ui); letter-spacing:.08em; text-transform:uppercase; color:var(--text-dim); }
.cl-empty{ padding:26px 16px; border-radius:18px; border:1px dashed var(--line-strong); text-align:center; display:flex; flex-direction:column; gap:5px; }
.cl-empty b{ font:700 24px var(--font-display); color:var(--text); }
.cl-empty span{ font:500 13px var(--font-ui); color:var(--text-dim); }
.cl-foot{ margin:6px 4px 0; text-align:center; font:500 11.5px/1.5 var(--font-ui); color:var(--text-dim); text-wrap:pretty; }

/* ---- sheets ---- */
.cl-back{ position:absolute; inset:0; z-index:40; display:flex; align-items:flex-end; justify-content:center; background:rgba(0,0,0,.55); animation:clFade .18s ease; }
.cl-sheet{ width:100%; max-width:560px; max-height:94%; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; box-sizing:border-box; display:flex; flex-direction:column; gap:12px;
  padding:16px 18px calc(20px + env(safe-area-inset-bottom)); background:var(--bg); border:1px solid var(--line-strong); border-bottom:0; border-radius:24px 24px 0 0; animation:clUp .26s cubic-bezier(.2,.7,.2,1); }
@keyframes clFade{ from{ opacity:0; } to{ opacity:1; } }
@keyframes clUp{ from{ transform:translateY(40px); opacity:.4; } to{ transform:none; opacity:1; } }
.cl-sheet > *{ flex-shrink:0; }   /* on a short phone screen the sheet scrolls; its parts must never squash into each other */
.cl-shead{ display:flex; justify-content:space-between; align-items:flex-start; gap:10px; }
.cl-shead > div{ display:flex; flex-direction:column; gap:1px; }
.cl-shead b{ font:700 27px/1.1 var(--font-display); color:var(--text); }
.cl-shead span{ font:500 12px var(--font-ui); color:var(--text-dim); }
.cl-x{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; border:1px solid var(--line-strong); background:var(--panel); color:var(--text); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.cl-x .cl-ic{ width:16px; height:16px; }
.cl-input{ width:100%; box-sizing:border-box; min-width:0; height:46px; padding:0 14px; border-radius:14px; border:1px solid var(--line-strong); background:var(--panel); color:var(--text); font:600 15px var(--font-ui); }
.cl-input::placeholder{ color:var(--text-dim); font-weight:500; }
.cl-ta{ height:auto; padding:12px 14px; resize:none; line-height:1.45; font-weight:500; }
.cl-bigin{ height:64px; text-align:center; font:400 38px var(--font-ui); }
.cl-primary{ min-height:52px; padding:0 18px; border-radius:var(--r-pill); border:1px solid var(--gold); background:var(--gold); color:var(--ink); font:800 15px var(--font-ui); cursor:pointer; }
.cl-primary:disabled{ opacity:.45; cursor:default; }
.cl-second{ min-height:48px; padding:0 18px; border-radius:var(--r-pill); border:1px solid var(--line-strong); background:transparent; color:var(--text); font:700 14px var(--font-ui); cursor:pointer; }
.cl-quiet{ min-height:42px; border:0; background:transparent; color:var(--text-dim); font:700 13px var(--font-ui); cursor:pointer; }
.cl-danger{ min-height:46px; padding:0 18px; border-radius:var(--r-pill); border:1px solid var(--ember-dim); background:transparent; color:var(--ember); font:700 14px var(--font-ui); cursor:pointer; }
.cl-actions{ display:flex; flex-direction:column; gap:8px; margin-top:4px; }
.cl-err{ font:600 12.5px var(--font-ui); color:var(--ember); }
.cl-err:empty, .cl-warn:empty{ display:none; }
.cl-warn{ font:600 12.5px var(--font-ui); color:var(--gold); }
.cl-suggest{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 14px; border-radius:16px; border:1px solid var(--accent-line); background:var(--accent-tint); }
.cl-suggest > div{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cl-suggest b{ font:700 14px var(--font-ui); color:var(--text); }
.cl-suggest span{ font:500 12px/1.4 var(--font-ui); color:var(--text-dim); }
.cl-machead{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; margin-top:2px; }
.cl-machead b{ font:700 14px var(--font-ui); color:var(--text); }
.cl-machead span{ font:500 12px var(--font-ui); color:var(--text-dim); }
.cl-macrow{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.cl-macfield{ display:flex; flex-direction:column; gap:5px; min-width:0; }
.cl-macfield > span{ font:700 12px var(--font-ui); color:var(--text-dim); display:flex; align-items:center; gap:6px; }
.cl-macfield > span::before{ content:''; width:8px; height:8px; border-radius:50%; background:var(--mc, var(--gold)); flex:none; }
.cl-macin{ text-align:center; font:600 17px var(--font-ui); padding:0 6px; }
.cl-macreset{ align-self:flex-start; min-height:34px; padding:0; border:0; background:transparent; color:var(--gold); font:700 13px var(--font-ui); cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.cl-macreset[hidden]{ display:none; }
.cl-failimg{ width:100%; max-height:200px; object-fit:cover; border-radius:16px; }
.cl-failtxt{ margin:0; font:500 14px/1.5 var(--font-ui); color:var(--text); }

/* review / edit */
.cl-etop{ display:flex; align-items:center; gap:12px; }
.cl-thumb{ flex:0 0 auto; width:62px; height:62px; border-radius:14px; object-fit:cover; }
.cl-pills{ display:flex; gap:6px; overflow-x:auto; scrollbar-width:none; max-width:100%; }
.cl-pill{ flex:0 0 auto; height:34px; padding:0 14px; border-radius:var(--r-pill); border:1px solid var(--line-strong); background:transparent; color:var(--text-dim); font:700 12.5px var(--font-ui); cursor:pointer; }
.cl-pill.on{ background:var(--accent-tint); border-color:var(--gold); color:var(--text); }
.cl-tot{ display:flex; flex-direction:column; gap:3px; padding:14px 16px; border-radius:18px; border:1px solid var(--accent-line); background:linear-gradient(160deg, var(--accent-tint) 0%, transparent 70%), var(--panel); }
.cl-totrow{ display:flex; align-items:center; justify-content:space-between; gap:10px; min-width:0; }
.cl-totkrow{ display:flex; align-items:baseline; gap:6px; flex:0 0 auto; }
.cl-totk{ font:400 52px/1 var(--font-ui); color:var(--text); font-variant-numeric:tabular-nums; letter-spacing:-.01em; }
.cl-totkrow em{ font:700 12px var(--font-ui); font-style:normal; color:var(--text-dim); }
.cl-totr{ font:700 12.5px var(--font-ui); color:var(--gold); }
.cl-totr:empty{ display:none; }
.cl-totm{ font:500 12px var(--font-ui); color:var(--text-dim); }
/* 2026-11-18: the badge may wrap onto two lines and shrink; before it was one rigid line that left the screen on phones narrower than ~380px */
.cl-conf{ flex:0 1 auto; min-width:0; max-width:52%; box-sizing:border-box; padding:5px 10px; border-radius:18px; font:700 11px/1.25 var(--font-ui); border:1px solid var(--line-strong); color:var(--text-dim); text-align:center; overflow-wrap:anywhere; }
.cl-conf.high{ color:var(--gold); border-color:var(--accent-line); background:var(--accent-tint); }
.cl-conf.low{ color:var(--ember); border-color:var(--ember-dim); }
.cl-conf.hide{ display:none; }
.cl-scale{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.cl-scale .cl-eyebrow{ margin-right:4px; }
.cl-sc{ min-width:44px; height:34px; padding:0 10px; border-radius:var(--r-pill); border:1px solid var(--line-strong); background:transparent; color:var(--text); font:700 13px var(--font-ui); cursor:pointer; }
.cl-sc.on{ background:var(--gold); border-color:var(--gold); color:var(--ink); }
.cl-items{ display:flex; flex-direction:column; gap:8px; }
.cl-item{ padding:10px 10px 10px 12px; border-radius:16px; border:1px solid var(--line); background:var(--panel); display:flex; flex-direction:column; gap:8px; }
.cl-irow{ display:flex; align-items:center; gap:8px; }
.cl-iname{ height:38px; border-color:transparent; background:transparent; padding:0 4px; font-weight:700; }
.cl-iname:focus{ border-color:var(--line-strong); background:var(--bg); }
.cl-irm{ flex:0 0 auto; width:30px; height:30px; border-radius:50%; border:0; background:transparent; color:var(--text-dim); display:flex; align-items:center; justify-content:center; cursor:pointer; }
.cl-irm .cl-ic{ width:15px; height:15px; }
.cl-irow2{ display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:6px 10px; padding-left:4px; min-width:0; }
.cl-irow2 .cl-ik{ margin-left:auto; }
.cl-step{ display:flex; align-items:center; gap:6px; }
.cl-step > span{ font:600 12px var(--font-ui); color:var(--text-dim); }
.cl-sb{ width:38px; height:38px; border-radius:50%; border:1px solid var(--line-strong); background:var(--bg); color:var(--text); font:600 20px/1 var(--font-ui); cursor:pointer; display:flex; align-items:center; justify-content:center; padding:0; }
.cl-gin{ width:78px; height:38px; padding:0 4px; text-align:center; font:700 15px 'Manrope', sans-serif; -moz-appearance:textfield; }
.cl-gin::-webkit-outer-spin-button, .cl-gin::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.cl-ik{ font:700 14px 'Manrope', sans-serif; color:var(--text); font-variant-numeric:tabular-nums; white-space:nowrap; }
.cl-addfood{ display:flex; gap:8px; align-items:center; }
.cl-addfood .tc-btn{ height:46px; padding:0 16px; flex:0 0 auto; }
.cl-fix{ display:flex; flex-direction:column; gap:7px; }
.cl-note{ margin:0; font:italic 500 12.5px/1.45 var(--font-ui); color:var(--text-dim); }
.cl-trust{ margin:0; font:500 11.5px/1.5 var(--font-ui); color:var(--text-dim); }
.cl-unsure{ flex:0 0 auto; padding:3px 8px; border-radius:var(--r-pill); font:700 10.5px var(--font-ui); color:var(--ember); border:1px solid var(--ember-dim); }
.cl-angle{ width:100%; margin:0; padding:11px 14px; border-radius:var(--r-pill); font:600 13px var(--font-ui); color:var(--text); background:transparent; border:1px dashed var(--line-strong); cursor:pointer; }
.cl-angle.hot{ color:var(--gold); border-color:var(--accent-line); background:var(--accent-tint); }
.cl-simple{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.cl-sf{ display:flex; flex-direction:column; gap:5px; }
.cl-sf.main{ grid-column:1 / -1; }
.cl-sf span{ font:700 11px var(--font-ui); letter-spacing:.06em; text-transform:uppercase; color:var(--text-dim); }

/* toast */
.cl-toast{ position:absolute; left:50%; bottom:calc(22px + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:60; max-width:calc(100% - 32px); display:flex; align-items:center; gap:14px; padding:11px 16px; border-radius:var(--r-pill); background:var(--text); color:var(--bg); font:700 13px var(--font-ui); box-shadow:var(--shadow-lift); animation:clUp .22s ease; }
.cl-toast-undo{ border:0; background:transparent; color:var(--gold-dim); font:800 13px var(--font-ui); cursor:pointer; padding:2px 0; text-decoration:underline; text-underline-offset:3px; }

/* the analysing overlay: the photo full screen behind the scan sweep */
#caloriePanel .calorie-scan{ position:fixed; inset:0; z-index:130; width:auto; aspect-ratio:auto; margin:0; border-radius:0; box-shadow:none; background:#000; }
#caloriePanel .calorie-scan-label{ bottom:calc(86px + env(safe-area-inset-bottom)); font-size:13px; color:#fff; background:none; }
/* foods appear here while the model is still writing */
.calorie-scan-live{ position:absolute; left:16px; right:16px; bottom:calc(122px + env(safe-area-inset-bottom)); display:flex; flex-direction:column; gap:6px; max-height:38%; overflow:hidden; justify-content:flex-end; }
.cl-liveitem{ display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 13px; border-radius:12px; background:rgba(0,0,0,.62); color:#fff; font:700 13px var(--font-ui); animation:clUp .22s ease both; }
.cl-liveitem em{ font:600 12px 'Manrope', sans-serif; font-style:normal; color:#fff; white-space:nowrap; }
.cl-liveitem span{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cl-live{ display:flex; flex-direction:column; gap:6px; }
.cl-live:empty{ display:none; }
.cl-live .cl-liveitem{ background:var(--panel); color:var(--text); border:1px solid var(--line); }
.cl-live .cl-liveitem em{ color:var(--gold); }
.calorie-scan-cancel{ position:absolute; left:50%; bottom:calc(30px + env(safe-area-inset-bottom)); transform:translateX(-50%); height:42px; padding:0 22px; border-radius:var(--r-pill); border:1px solid rgba(255,255,255,.5); background:rgba(0,0,0,.45); color:#fff; font:700 13px var(--font-ui); cursor:pointer; }

@media (max-width:360px){
  .cl-bignum{ font-size:52px; }
  .cl-ringbox{ width:100px; height:100px; }
}
@media (prefers-reduced-motion:reduce){
  .cl-back, .cl-sheet, .cl-toast{ animation:none; }
  .cl-ring circle, .cl-mfill, .cl-wbar{ transition:none; }
}

/* 2026-10-19: the meal camera and the analysing screen are a framed card (Cal AI style), not full screen */
#caloriePanel .calorie-camera, #caloriePanel .calorie-scan{ position:fixed; inset:0; display:block; background:#0b0b0c; }
.cc-frame{ position:absolute; left:50%; top:max(64px, calc(env(safe-area-inset-top) + 52px)); transform:translateX(-50%); width:min(calc(100% - 40px), 440px); height:min(62dvh, 600px); border-radius:28px; overflow:hidden; background:#151516; box-shadow:0 0 0 1px rgba(255,255,255,.08), 0 18px 50px rgba(0,0,0,.55); }
.cc-frame.cs-frame{ height:min(44dvh, 440px); }
.cc-frame video, .cc-frame .calorie-scan-img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.cc-frame .calorie-scan-corner{ width:28px; height:28px; opacity:.95; }
.cc-frame .calorie-scan-corner.tl{ top:14px; left:14px; border-width:1.5px 0 0 1.5px; border-top-left-radius:12px; }
.cc-frame .calorie-scan-corner.tr{ top:14px; right:14px; border-width:1.5px 1.5px 0 0; border-top-right-radius:12px; }
.cc-frame .calorie-scan-corner.bl{ bottom:14px; left:14px; border-width:0 0 1.5px 1.5px; border-bottom-left-radius:12px; }
.cc-frame .calorie-scan-corner.br{ bottom:14px; right:14px; border-width:0 1.5px 1.5px 0; border-bottom-right-radius:12px; }
#caloriePanel .cc-frame .calorie-scan-label{ left:0; right:0; bottom:0; padding:16px 12px 14px; font-size:13px; color:#fff; background:linear-gradient(0deg, rgba(0,0,0,.72), rgba(0,0,0,0)); }
#caloriePanel .calorie-scan .calorie-scan-live{ top:calc(max(64px, env(safe-area-inset-top) + 52px) + min(44dvh, 440px) + 16px); bottom:calc(96px + env(safe-area-inset-bottom)); max-height:none; justify-content:flex-start; left:20px; right:20px; }
.calorie-camera-hint{ top:max(22px, calc(env(safe-area-inset-top) + 10px)); }