:root{
  color-scheme: light;

  --frame-bg: #FAFAF8;
  --panel-bg: #FAFAF8;
  --card-bg: #FFFFFF;
  --card-2: #F2F0EB;
  --input-bg: #F2F0EB;

  --line: #E8E4DD;
  --line-2: #E8E4DD;

  --text: #1A1A18;
  --muted: #4A4A46;
  --muted-2: #8A8A84;

  --accent: #40916C;
  --accent-dark: #2D6A4F;
  --accent-light: #74C69D;
  --accent-tint: #D8F3DC;

  --danger: #9B2020;
  --warning: #7D5A00;

  --hl-blue: 64, 145, 108;
  --hl-blue-strong: 64, 145, 108;

  --blue-line: rgba(64,145,108,.28);
  --blue-glow: rgba(64,145,108,.08);
}

:root[data-theme="dark"]{
  color-scheme: dark;

  --frame-bg: #1A1A18;
  --panel-bg: #1A1A18;
  --card-bg: #242422;
  --card-2: #2E2E2C;
  --input-bg: #2E2E2C;

  --line: #3A3A38;
  --line-2: #3A3A38;

  --text: #FAFAF8;
  --muted: #C8C8C4;
  --muted-2: #6A6A66;

  --accent: #40916C;
  --accent-dark: #74C69D;
  --accent-light: #74C69D;
  --accent-tint: rgba(64,145,108,.22);

  --danger: #FF8A8A;
  --warning: #FFD166;

  --hl-blue: 64,145,108;
  --hl-blue-strong: 64,145,108;

  --blue-line: rgba(64,145,108,.35);
  --blue-glow: rgba(64,145,108,.10);
}

:root[data-theme="dark"] option{
  background:#242422;
  color:#FAFAF8;
}

:root[data-theme="dark"] .bottomNav{
  background:rgba(26,26,24,.94);
}

:root[data-theme="dark"] .boot{
  background:#1A1A18;
  color:#FAFAF8;
}

:root[data-theme="dark"] .bootText{
  color:#C8C8C4;
}

html{ color-scheme: light dark; }
*{ box-sizing:border-box; }

body{
  margin:0;
  background: var(--frame-bg);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

img{ max-width:100%; }

.app,
.shell,
.appShell{
  max-width: 1280px;
  margin: 18px auto;
}

.app{
  padding: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(26,26,24,.06);
}

.shell{ padding:18px; }

.center{ text-align:center; }
.text{
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.msg{
  margin-top: 10px;
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}
.labelTitle{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.grow{ flex:1 1 auto; min-width:0; }
.logo{
  display:block;
  width:min(180px, 60vw);
  margin:0 auto 18px;
}

/* =========================
   TOPBAR
   ========================= */

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 16px;
  border-radius:14px;
  background: var(--card-bg);
  border: 1px solid var(--line);
}

.title{
  font-weight:800;
  letter-spacing:.2px;
  color: var(--text);
}
.subtitle{
  font-size:12px;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1.2px;
  margin-top:2px;
}

.topbar.topbarCockpit{
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: 0 12px 28px rgba(26,26,24,.08);
  position: sticky;
  top: 0;
  z-index: 80;
  transform: translateY(0);
  transition: transform 0.24s ease;
  will-change: transform;
}

.topbar.topbarCockpit.topbarScrollHidden{
  transform: translateY(calc(-100% - 8px));
}

.topbarLeft,
.topbarCenter,
.topbarRight{
  display:flex;
  align-items:center;
  min-width:0;
}

.topbarLeft{ justify-content:flex-start; }
.topbarCenter{ justify-content:center; }
.topbarRight{ justify-content:flex-end; }

.topbarTitle{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .4px;
  color: var(--text);
  text-align:center;
  white-space:nowrap;
  text-shadow:none;
}

.appLogo{
  height: 72px;
  width: auto;
  display:block;
  background: transparent;
  filter:none;
}

.topbarHelp{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  text-decoration:none;
  flex:0 0 auto;
}
.topbarHelp:hover{
  border-color: rgba(64,145,108,.35);
  background: var(--accent-tint);
  box-shadow:none;
}
.topbarHelp svg{
  width:18px;
  height:18px;
  fill: currentColor;
}

/* =========================
   BUTTONS / FORMS
   ========================= */

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:0 14px;
  border-radius:10px;
  font-size:13px;
  font-weight:900;
  letter-spacing:.2px;
  border:1px solid transparent;
  cursor:pointer;
  transition: all .15s ease;
  text-align:center;
}

.btn.primary{
  background: var(--accent);
  border:1px solid var(--accent);
  color:#fff;
  box-shadow: 0 8px 18px rgba(45,106,79,.16);
}
.btn.primary:hover{
  transform: translateY(-1px);
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}
.btn.primary:active{
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(45,106,79,.14);
}

.btn.secondary{
  background: var(--input-bg);
  border:1px solid var(--line);
  color: var(--muted);
}
.btn.secondary:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}
.btn.secondary:active{ background: rgba(216,243,220,.75); }

.btn.danger{
  background: #FFE8E8;
  border-color: rgba(155,32,32,.28);
  color: #9B2020;
}

select,
input,
textarea{
  width:100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius:10px;
  outline:none;
  font-size: 14px;
  font-family: inherit;
}

select,
input{
  padding: 7px 10px;
  height: 34px;
}

textarea{
  min-height: 86px;
  padding:10px;
  resize:vertical;
}

select:focus,
input:focus,
textarea:focus{
  border-color: rgba(64,145,108,.55);
  outline: 3px solid rgba(216,243,220,.9);
  outline-offset: 2px;
}

select{
  background: var(--input-bg) !important;
  color: var(--text) !important;
}
option{
  background: #FFFFFF;
  color: #1A1A18;
}

label{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  font-weight:600;
  color: var(--muted);
}

/* =========================
   LAYOUT / CARDS
   ========================= */

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
  margin-top:12px;
}

.card{
  grid-column: span 6;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}
.card.wide{ grid-column: span 12; }

.card.framed{
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.card.hero{
  position: relative;
  border: 1px solid rgba(64,145,108,.24);
  box-shadow: 0 16px 36px rgba(26,26,24,.08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  overflow:hidden;
  isolation:isolate;
}
.card.hero::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:16px;
  pointer-events:none;
  background: linear-gradient(135deg, rgba(216,243,220,.75), rgba(216,243,220,0) 40%);
  opacity:.9;
  mix-blend-mode: normal;
  z-index:-1;
}
@media (hover:hover){
  .card.hero:hover{
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(26,26,24,.10);
  }
}

h2{
  margin:0 0 12px;
  font-size:18px;
  font-weight:800;
  color: var(--text);
  letter-spacing:.2px;
}
.card.hero > h2{
  text-align:center;
  font-size:22px;
  font-weight:900;
  letter-spacing:.4px;
  margin-bottom:14px;
  text-shadow:none;
}
h3{
  margin:0 0 10px;
  font-size:14px;
  font-weight:700;
  color: var(--muted);
}

.row{
  display:flex;
  gap:10px;
  align-items:center;
}

.trackerDateNavRow{
  display:flex;
  align-items:center;
  gap:8px;
}

.trackerDateNavLabel{
  min-height:36px;
  padding:0 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  font-weight:800;
}

.trackerDateNavBtn{
  min-width:34px;
  height:34px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  box-shadow:none;
}

.trackerDateNavBtn:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}

.trackerDateNavBtn:active{
  transform:none;
}

.trackerTopRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.trackerTopLeft{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.trackerTopRight{
  display:flex;
  align-items:flex-start;
  gap:12px;
  min-width:0;
  margin-left:auto;
}

.trackerDateNav{
  display:flex;
  align-items:center;
  gap:8px;
}

.trackerDateCluster{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:34px;
  padding:3px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--input-bg);
}

.trackerDateLabelBox{
  min-height:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 12px;
  border-radius:999px;
  border:0;
  background: transparent;
  color: var(--muted);
  font-weight:800;
  font-size:13px;
  letter-spacing:.2px;
}

.trackerDateBtn{
  min-width:28px;
  width:28px;
  height:28px;
  padding:0;
  border-radius:999px;
  border:0;
  background: transparent;
  color: var(--muted);
  box-shadow:none;
}

.trackerDateBtn:hover{
  background: var(--accent-tint);
  border-color: transparent;
  color: var(--accent-dark);
}

.trackerDateBtn:active{
  background: rgba(216,243,220,.75);
  transform:none;
}

.trackerTargetsTopGroup{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}

.trackerTargetsTopLabel{
  font-size:13px;
  font-weight:800;
  color: var(--muted);
  white-space:nowrap;
  padding-top:0;
  line-height:36px;
}

.trackerTargetsTopRow{
  display:flex;
  align-items:flex-start;
  gap:10px;
  min-width:0;
}

.trackerTargetsTop{
  display:grid;
  grid-template-columns: repeat(4, minmax(72px, 96px));
  gap:8px;
  justify-content:start;
}

.trackerTargetsTop input{
  height:36px;
  font-weight:800;
}

.trackerTargetsTop input[readonly]{
  background: var(--input-bg);
  border-color: var(--line);
  color: var(--text);
  opacity:1;
  cursor:default;
}

.trackerTargetsTop input.targetsInlineEditing{
  background: var(--input-bg);
  border-color: rgba(64,145,108,.55);
  box-shadow: 0 0 0 3px rgba(216,243,220,.9);
  cursor:text;
}

.btnEditTargets{
  min-width:36px;
  width:36px;
  height:36px;
  padding:0;
  border-radius:10px;
  flex:0 0 auto;
}

.btnEditTargets svg{
  width:15px;
  height:15px;
  display:block;
}

/* =========================
   TAGESZIELE
   ========================= */

.targetsWrap{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.targetsLeft{
  min-width: 0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.targetsRight{
  min-width:0;
  display:flex;
  align-items:stretch;
}

.trackerKpiBlock{
  width:100%;
  min-width:0;
  border-top:1px solid var(--line);
  padding-top:12px;
  display:flex;
  justify-content:center;
  overflow:hidden;
}

.targets{
  display:grid;
  grid-template-columns: repeat(4, minmax(72px, 96px));
  gap:8px;
  justify-content:start;
}

.targets input{
  height: 36px;
  font-weight:800;
}

.trackerTargetsBlock{
  min-height:0;
}

.trackerTargetsBlock .msg{
  margin-top:0;
  min-height:0;
}

.trackerHero{
  margin-bottom:14px;
  padding:16px;
  border:1px solid rgba(64,145,108,.22);
  border-radius:16px;
  background:rgba(216,243,220,.38);
  box-shadow:0 12px 28px rgba(26,26,24,.06);
}

.trackerHeroTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.trackerHeroTopActions{
  display:flex;
  align-items:center;
  gap:10px;
}

.trackerHeroEditBtn{
  min-width:36px;
  width:36px;
  height:36px;
  padding:0;
  border-radius:10px;
  flex:0 0 auto;
}

.trackerTargetsEditScope{
  margin-top:12px;
}

.trackerTargetsEditPanel{
  padding-top:12px;
  border-top:1px solid var(--line);
}

.trackerTargetsEditPanel[hidden]{
  display:none !important;
}

.trackerTargetsWrapSlim{
  gap:0;
}

.trackerTargetsWrapSlim .trackerTargetsBlock{
  display:block;
}

.trackerTargetsWrapSlim .msg{
  margin-top:0;
}

.trackerHeroEyebrow{
  font-size:11px;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted-2);
}

.trackerHeroPercent{
  font-size:13px;
  font-weight:900;
  color:var(--muted);
}

.trackerHeroMain{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin-bottom:12px;
  flex-wrap:wrap;
}

.trackerHeroValue{
  font-size:42px;
  font-weight:900;
  line-height:1;
  color:var(--text);
  text-shadow:none;
}

.trackerHeroUnit{
  font-size:16px;
  font-weight:800;
  color:var(--muted);
}

.trackerHeroBar{
  position:relative;
  width:100%;
  height:14px;
  border-radius:999px;
  background:#E8E4DD;
  overflow:hidden;
  box-shadow:none;
}

.trackerHeroBarFill{
  height:100%;
  border-radius:999px;
  background:#40916C;
  box-shadow:none;
}

.trackerHeroMeta{
  margin-top:10px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.trackerHeroMacroGrid{
  margin-top:12px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}

.trackerHeroMacroCard{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card-bg);
  box-shadow:none;
}

.trackerHeroMacroHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.trackerHeroMacroLabel{
  font-size:12px;
  font-weight:900;
  color:var(--text);
}

.trackerHeroMacroValues{
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}

.trackerHeroMacroBar{
  position:relative;
  width:100%;
  height:8px;
  border-radius:999px;
  background:#E8E4DD;
  overflow:hidden;
  box-shadow:none;
}

.trackerHeroMacroBarFill{
  height:100%;
  border-radius:999px;
  background:#40916C;
  box-shadow:none;
}

.targetsActions{
  margin-top:auto;
  padding-top:12px;
}

.kpiGrid{
  width:max-content;
  max-width:100%;
  min-width:0;
  height:auto;
  display:grid;
  grid-template-columns: 108px repeat(4, 160px);
  column-gap:10px;
  row-gap:10px;
  align-content:start;
  justify-content:center;
  margin:0 auto;
  padding:0;
  border-left:none;
}

.kpiHead{
  font-size:11px;
  font-weight:900;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1.1px;
  text-align:right;
}
.kpiLabel{
  font-size:12px;
  font-weight:900;
  color: var(--muted);
  white-space:nowrap;
}
.kpiVal{
  width:160px;
  min-width:160px;
  max-width:160px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:0 10px;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--input-bg);
  font-size:13px;
  font-weight:900;
  color: var(--text);
}
.kpiVal.neg{
  border-color: rgba(155,32,32,.24);
  background: #FFE8E8;
  color: #9B2020;
}

.kpiLabelMain{
  color: var(--text);
  font-size:13px;
}

.kpiValMain{
  height:40px;
  font-size:15px;
  border-color: rgba(64,145,108,.24);
  background: var(--accent-tint);
  box-shadow:none;
}

/* =========================
   MACRO HEADER / TABLE
   ========================= */

.macroHeader{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.macroControls{
  display:flex;
  align-items:flex-end;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-start;
  flex:1 1 auto;
  min-width:0;
}

.macroActions{
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  gap:10px;
  flex:0 0 auto;
}

.recipeLoadingIndicator{
  min-height:36px;
  display:inline-flex;
  align-items:center;
  padding:0 12px;
  border-radius:10px;
  border:1px solid rgba(64,145,108,.24);
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
}

#macroSection.recipeLoading{
  border-color: rgba(64,145,108,.35);
  box-shadow: 0 16px 36px rgba(26,26,24,.08);
}

.ctrl{
  min-width:0;
}

.ctrlRecipe{
  width: 260px;
  flex: 0 0 260px;
}

.ctrlPortions{
  width: 56px;
  min-width: 56px;
  flex: 0 0 56px;
}

.ctrl select{ width:100%; }
.ctrlSmall select{ width:100%; }

.macroHeader label{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
}

.macroHeader select{
  height:36px;
  padding:6px 10px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.1px;
  border-color: var(--line);
  background: var(--input-bg);
}

.macroHeader select:focus{
  border-color: rgba(64,145,108,.55);
  outline: 3px solid rgba(216,243,220,.9);
  outline-offset: 2px;
}

.optimizerMode{
  display:flex;
  gap:8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--input-bg);
}

.viewTab{
  min-height:36px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.viewTab.active{
  color: var(--accent-dark);
  border-color: rgba(64,145,108,.35);
  background: var(--accent-tint);
  box-shadow:none;
}

.tableWrap{
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-2);
}

#ingTable,
#journalTable{
  width:100%;
  border-collapse:collapse;
}

#ingTable{
  table-layout:auto;
  min-width:980px;
}

#ingTable th,
#ingTable td,
#journalTable th,
#journalTable td{
  padding:8px;
  border-bottom:1px solid var(--line);
  color: var(--text);
}

#ingTable td{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#ingTable thead{ position:relative; z-index:2; }
#ingTable tbody{ position:relative; z-index:1; }

#ingTable th,
#journalTable th{
  position:sticky;
  top:0;
  z-index:2;
  background: var(--card-2);
  font-size:12px;
  color: var(--muted);
  text-align:left;
  border-bottom:1px solid var(--line-2);
  white-space:nowrap;
  vertical-align:middle;
}

#ingTable thead tr:nth-child(1) th{
  top:0;
  z-index:3;
  font-weight:800;
  color: var(--text);
}
#ingTable thead tr:nth-child(2) th{
  top:34px;
  z-index:2;
}

#ingTable td input{
  width:100%;
  min-width:0;
  height:30px;
  padding:6px 8px;
  background: var(--input-bg);
  color: var(--text);
  border:1px solid var(--line);
  border-radius:10px;
}
#ingTable td input[readonly]{
  background: #F8F7F4;
  border-color: var(--line);
  color: var(--text);
  opacity:1;
}
#ingTable td:nth-child(n+2) input{ text-align:right; }

#ingTable .col-ing{
  width:260px;
  min-width:260px;
}

#ingTable .orig-col,
#ingTable .adj-col{
  width:85px;
  min-width:85px;
}

#ingTable .col-adjg{
  width: 100px;
}

#ingTable .col-adjpct{
  width: 100px;
}

#ingTable.view-original .adj-col,
#ingTable.view-original .group-adjusted{
  display:none;
}

#ingTable.view-adjusted .orig-col,
#ingTable.view-adjusted .group-original{
  display:none;
}

.macroApplyBar{
  margin-top:12px;
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

/* top driver highlights */
td.hl-original,
td.hl-adjusted,
td.hl-ing{
  background: transparent !important;
  color: var(--text);
}
td.hl-original input,
td.hl-adjusted input,
td.hl-ing input{
  border-color: rgba(64,145,108,.55) !important;
  background: rgba(216,243,220,.55) !important;
  box-shadow:none;
  font-weight: 800;
}
td.hl-ing input{
  background: rgba(216,243,220,.72) !important;
  box-shadow:none;
}
td.hl-original input:focus,
td.hl-adjusted input:focus,
td.hl-ing input:focus{
  box-shadow: 0 0 0 3px rgba(216,243,220,.9) !important;
}

/* =========================
   TOTALS
   ========================= */

.totals2{
  margin-top:14px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.totRow{
  border-top:1px solid var(--line);
  padding-top:12px;
  min-width:0;
}

.totTitle{
  color:var(--text);
  font-weight:900;
  font-size:14px;
  letter-spacing:.2px;
  margin-bottom:8px;
}

.totCols{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.totCol{
  border: 1px solid var(--line);
  border-radius:16px;
  padding:14px 14px 12px;
  background: var(--card-bg);
  box-shadow:0 10px 24px rgba(26,26,24,.06);
  min-width:0;
}

.totLabel{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:800;
}

#totalsTotalOrig,
#totalsTotalAdj,
#totalsPortionOrig,
#totalsPortionAdj{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  gap:10px;
  font-size:14px;
  line-height:1.2;
  color: var(--text);
}

.totKcal{
  font-size:18px;
  font-weight:900;
  letter-spacing:.2px;
  color: var(--text);
  text-shadow:none;
}

.totSep{
  color: var(--muted-2);
  font-weight:800;
}

.totMacros{
  font-size:14px;
  font-weight:800;
  color: var(--muted);
}

#totalsTotalAdj,
#totalsPortionAdj{
  text-shadow:none;
}

/* =========================
   SAVE BOX
   ========================= */

.saveBox{
  margin-top:16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: var(--card-bg);
  box-shadow:0 10px 24px rgba(26,26,24,.06);
}

.saveMode{
  display:flex;
  gap:8px;
  padding:6px;
  border: 1px solid var(--line);
  border-radius:14px;
  background: var(--input-bg);
  margin-bottom:12px;
}
.saveTab{
  flex:1;
  min-height:36px;
  border-radius:12px;
  border:1px solid var(--line);
  background: var(--card-bg);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
}
.saveTab.active,
.saveTab[data-active="1"]{
  color: var(--accent-dark);
  border-color: rgba(64,145,108,.35);
  background: var(--accent-tint);
  box-shadow:none;
}

.saveBody{ padding:2px 2px 0; }
.saveRow{
  display:grid;
  grid-template-columns: 220px 1fr auto;
  gap:10px;
  align-items:end;
}
.saveField{ min-width:0; }
#slotSelect,
#slotName{
  height:40px;
  font-size:15px;
}
#slotSelect{ font-weight:900; }
#slotName{ font-weight:800; }

.saveActions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.saveActions .btn{
  min-height:40px;
  padding:10px 14px;
  font-weight:900;
}
.saveActionsSingle{
  margin-top:12px;
}

/* =========================
   JOURNAL
   ========================= */

.journalStack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.journalCard{
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.journalCollapse{
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.journalCollapseSummary{
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  background: var(--input-bg);
  border-bottom: 1px solid var(--line);
}

.journalCollapseSummary::-webkit-details-marker{ display:none; }

.journalCollapseSummary::after{
  content:"▾";
  opacity:.7;
  transform: translateY(-1px);
  transition: transform .15s ease;
}

.journalCollapse[open] .journalCollapseSummary::after{
  transform: rotate(180deg) translateY(1px);
}

.journalCollapseBody{
  padding: 14px 14px 16px 14px;
}

.journalTitle{
  font-weight:800;
  margin-bottom:12px;
  color: var(--text);
  font-size:16px;
}

.journalToolbar{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
  margin-bottom:14px;
}

.journalPeriodCtrl{
  max-width:220px;
}

.journalForm{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}
@media (min-width: 1100px){
  .journalForm{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap:8px;
  }
}
@media (min-width: 821px) and (max-width: 1099px){
  .journalForm{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:8px;
  }
}
.journalForm label{
  gap:4px;
  font-size:12px;
}
.journalForm input,
.journalForm select{
  height:32px;
  padding:6px 9px;
  font-size:13px;
}
.journalForm textarea{
  font-size:13px;
  padding:9px;
}
.journalNotes{ grid-column:1 / -1; }
.journalActions{
  grid-column:1 / -1;
  margin-top:4px;
  flex-wrap:wrap;
}

.journalEditHint{
  margin-bottom:12px;
  padding:10px 12px;
  border:1px solid rgba(64,145,108,.24);
  border-radius:12px;
  background: var(--accent-tint);
  color: var(--accent-dark);
  font-size:13px;
  font-weight:800;
}

.journalRowActions{
  white-space:nowrap;
  display:flex;
  align-items:flex-start;
  gap:8px;
}

.btnJournalEdit{
  min-height:30px;
  padding:0 10px;
}

.journalInlineInput,
.journalInlineTextarea{
  width:100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius:8px;
  font-size:13px;
  font-family: inherit;
}

.journalInlineInput{
  min-width:84px;
  height:32px;
  padding:6px 8px;
}

.journalInlineTextarea{
  min-width:180px;
  min-height:72px;
  padding:8px;
  resize:vertical;
}

.journalSummary{
  display:flex;
  flex-direction:column;
  gap:12px;
}
.journalAverages{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
.sumItem{
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 14px;
  padding: 10px 12px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.sumLabel{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  white-space: nowrap;
}
.sumLabelMetric{
  display:inline-flex;
  align-items:center;
  gap:6px;
}

.sumItemMetric .sumVal{
  align-self:center;
}
.sumVal{
  font-size:14px;
  font-weight:900;
  color: var(--text);
  text-align:right;
  white-space: nowrap;
}

.dashboardToolbar{
  justify-content:space-between;
}

.dashboardMetricsToggleBtn{
  min-height:40px;
}

.dashboardMetricChooser{
  margin-bottom:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.dashboardMetricChooserGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.dashboardMetricToggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:82px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--card-bg);
  box-shadow:0 10px 24px rgba(26,26,24,.06);
  text-align:left;
}

.dashboardMetricToggleMain{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1 1 auto;
}

.dashboardMetricToggleLabel{
  min-width:0;
  font-size:13px;
  font-weight:900;
  color:var(--text);
  line-height:1.2;
  text-align:left;
}

.dashboardMetricSwitch{
  position:relative;
  flex:0 0 auto;
  width:48px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.dashboardMetricSwitch input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
  z-index:2;
}

.dashboardMetricSwitchSlider{
  position:relative;
  width:48px;
  height:30px;
  border-radius:999px;
  background:#E8E4DD;
  border:1px solid var(--line);
  box-shadow:none;
  transition:
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.dashboardMetricSwitchSlider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#FFFFFF;
  box-shadow:0 3px 8px rgba(26,26,24,.12);
  transition:transform .18s ease;
}

.dashboardMetricSwitch input:checked + .dashboardMetricSwitchSlider{
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:none;
}

.dashboardMetricSwitch input:checked + .dashboardMetricSwitchSlider::after{
  transform:translateX(18px);
}

.dashboardMetricSwitch input:focus-visible + .dashboardMetricSwitchSlider{
  box-shadow:0 0 0 3px rgba(216,243,220,.9);
}

.dashboardSignalCard{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:stretch;
}

.dashboardMacroSignalCard{
  min-height:74px;
}

.dashboardSignalCardMain{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}

.dashboardSignalMeta,
.dashboardWeightSignalMeta{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:18px;
}

.dashboardSignalDot{
  width:8px;
  height:8px;
  border-radius:999px;
  background:#8A8A84;
  box-shadow:none;
  flex:0 0 auto;
}

.dashboardSignalText{
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}

.dashboardSignalCard[data-signal-state="green"],
.dashboardWeightSignal[data-signal-state="green"]{
  border-color: rgba(45,106,79,.24);
  background: #D8F3DC;
  box-shadow:none;
}

.dashboardSignalCard[data-signal-state="green"] .dashboardSignalDot,
.dashboardWeightSignal[data-signal-state="green"] .dashboardSignalDot{
  background:#2D6A4F;
  box-shadow:none;
}

.dashboardSignalCard[data-signal-state="yellow"],
.dashboardWeightSignal[data-signal-state="yellow"]{
  border-color: rgba(125,90,0,.24);
  background: #FFF3CD;
  box-shadow:none;
}
.dashboardSignalCard[data-signal-state="yellow"] .dashboardSignalDot,
.dashboardWeightSignal[data-signal-state="yellow"] .dashboardSignalDot{
  background:#7D5A00;
  box-shadow:none;
}

.dashboardSignalCard[data-signal-state="red"],
.dashboardWeightSignal[data-signal-state="red"]{
  border-color: rgba(155,32,32,.24);
  background: #FFE8E8;
  box-shadow:none;
}

.dashboardSignalCard[data-signal-state="red"] .dashboardSignalDot,
.dashboardWeightSignal[data-signal-state="red"] .dashboardSignalDot{
  background:#9B2020;
  box-shadow:none;
}

.dashboardSignalCard[data-signal-state="neutral"],
.dashboardWeightSignal[data-signal-state="neutral"]{
  border-color: var(--line);
  background: #F2F0EB;
  box-shadow:none;
}

.dashboardAverages{
  align-items:stretch;
}

.dashboardSummaryCard .journalSummary{
  gap:14px;
}

.journalWeightBox{
  border: 1px solid rgba(64,145,108,.22);
  background: rgba(216,243,220,.38);
  border-radius: 16px;
  padding: 12px;
  box-shadow:none;
}
.journalWeightTitle{
  font-weight:900;
  color: var(--text);
  font-size:13px;
  letter-spacing:.2px;
  margin-bottom:10px;
}
.journalWeightTitleWithIcon{
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.journalWeightGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
.wItem{
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 14px;
  padding: 10px 12px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.wLabel{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  white-space: nowrap;
}
.wVal{
  font-size:14px;
  font-weight:900;
  color: var(--text);
  text-align:right;
  white-space: nowrap;
}

#journalTable{
  min-width: 980px;
}
#journalTable th,
#journalTable td{
  font-size:12px;
  white-space:nowrap;
  vertical-align:top;
}

.jChartControls{
  display:flex;
  gap:12px;
  align-items:flex-end;
  flex-wrap:wrap;
  margin-bottom:10px;
}
.jChartControls label{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
}
.jChartControls select{
  height:40px;
  font-weight:900;
}

.jChartCheck{
  width:auto;
  flex-direction:row;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--muted);
  font-size:13px;
  font-weight:900;
  min-height:40px;
}
.jChartCheck input{
  width:16px;
  height:16px;
  margin:0;
}

.jChartWrap{
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-2);
  overflow:hidden;
}
.jChart{
  width:100%;
  height:460px;
}

/* =========================
   BOOT / LICENSE
   ========================= */

.boot{
  position:fixed;
  inset:0;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#FAFAF8;
  color:#1A1A18;
  font-family:Manrope,system-ui,sans-serif;
  padding:32px;
  text-align:center;
}
.bootCard{
  max-width:520px;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.bootLogo{
  width:min(240px, 70vw);
  height:auto;
  display:block;
  margin:0 auto 26px auto;
}
.bootTitle{
  font-size:28px;
  font-weight:800;
  line-height:1.15;
  margin-bottom:10px;
}
.bootText{
  font-size:15px;
  color:#4A4A46;
  line-height:1.5;
  max-width:420px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 980px){
  .targetsWrap{
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }

    .trackerHeroValue{
    font-size:36px;
  }

   .trackerHeroMacroGrid{
    grid-template-columns:1fr;
  }

  .targetsLeft{ min-width:0; }
  .targetsRight{ width:100%; }

  .trackerTopRow{
    align-items:flex-start;
  }

  .trackerTopLeft{
    width:100%;
  }

  .trackerTopRight{
    width:100%;
    justify-content:flex-start;
    align-items:flex-start;
    gap:10px;
    margin-left:0;
  }

  .trackerDateNav{
    width:auto;
  }

  .trackerDateCluster{
    width:auto;
  }

  .trackerTargetsTopGroup{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
  }

  .trackerTargetsTopLabel{
    padding-top:0;
    line-height:1.2;
    font-size:12px;
  }

  .trackerTargetsTopRow{
    width:100%;
    display:flex;
    align-items:flex-start;
    gap:10px;
  }

  .trackerTargetsTop{
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    gap:8px;
    width:100%;
    flex:1 1 auto;
  }

  .btnEditTargets{
    min-width:54px;
    width:54px;
    height:54px;
    align-self:flex-start;
    margin-top:0;
  }

  .kpiGrid{
    width:max-content;
    max-width:100%;
    grid-template-columns: 88px repeat(4, 132px);
    column-gap:8px;
    row-gap:12px;
    justify-content:center;
    padding:0;
    border-left:none;
    border-top:none;
  }

  .optimizerDayImpactGrid{
    grid-template-columns:1fr;
  }

  .totals2{ grid-template-columns:1fr; }
  .totCols{ grid-template-columns:1fr; }
  .journalAverages{ grid-template-columns: repeat(2, 1fr); }
  .journalWeightGrid{ grid-template-columns: repeat(2, 1fr); }
    .dashboardMetricChooserGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}


@media (max-width: 820px){
  .app{
    margin:10px;
    padding:12px;
    border-radius:16px;
  }

  .progressChartWrap{
  --chart-scale: .70;
  overflow-x: hidden;
  transform: translateZ(0);
}

.progressChartWrap .echart{
  transform: scale(var(--chart-scale));
  transform-origin: top left;
}

  .card{
    grid-column: span 12;
    padding:12px;
    border-radius:14px;
  }

  .topbar.topbarCockpit{
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items:center;
    gap:10px;
    padding:10px 12px;
  }

  .appLogo{ height:52px; }

  .topbarTitle{
    font-size:18px;
    line-height:1.1;
    white-space:nowrap;
  }

  .targets{
    grid-template-columns:1fr 1fr;
  }

  /* KEEP CURRENT GOOD MOBILE HEADER */
  .macroHeader{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    align-items:stretch;
  }

  .macroControls{
    display:grid;
    grid-template-columns:minmax(0, 1fr) 64px;
    gap:8px;
    align-items:end;
    width:100%;
  }

  .ctrlRecipe{
    width:auto;
    min-width:0;
    flex:auto;
  }

  .ctrlPortions{
    width:64px;
    min-width:64px;
    flex:auto;
  }

  .optimizerMode{
    width:100%;
    justify-content:stretch;
  }

  .optimizerMode .viewTab{
    flex:1 1 0;
  }

  .macroActions{
    width:100%;
    justify-content:stretch;
    flex-wrap:wrap;
  }

  .recipeLoadingIndicator{
    width:100%;
    justify-content:center;
  }

  .macroActions .btn{
    width:100%;
  }

  .saveRow{
    grid-template-columns:1fr;
  }

  .saveActions{
    justify-content:stretch;
  }

  .saveActions .btn{
    flex:1;
  }

  .journalToolbar{
    align-items:flex-end;
  }

  .journalPeriodCtrl{
    width:auto;
    max-width:220px;
  }

    .journalToolbar .journalPeriodCtrl select{
    min-width: 170px;
    width: auto;
  }

  .journalAverages{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .journalWeightGrid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

    .dashboardMetricChooserGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
    width:100%;
    max-width:100%;
    overflow:hidden;
  }

  .dashboardMetricToggle{
    min-width:0;
    width:100%;
    min-height:78px;
    padding:10px 8px;
    border-radius:16px;
  }

  .dashboardMetricToggleMain{
    gap:10px;
  }

  .dashboardMetricToggleLabel{
    font-size:12px;
    line-height:1.15;
  }

  .dashboardSignalText{
    font-size:10px;
  }
    .sumItem,
  .wItem{
    padding:8px 10px;
    min-height:52px;
  }

  .sumLabel,
  .wLabel{
    font-size:11px;
  }

  .sumVal,
  .wVal{
    font-size:13px;
  }

  /* JOURNAL FORM: DATE FULL WIDTH, OTHERS TWO COLUMNS */
  .journalForm{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .journalForm > label:first-child,
  .journalNotes,
  .journalActions{
    grid-column:1 / -1;
  }

  .journalForm > label:first-child input[type="date"]{
    width:100%;
    min-width:0;
    max-width:100%;
    height:40px;
    font-size:14px;
    padding:0 12px;
    text-align:left;
    box-sizing:border-box;
    -webkit-appearance:none;
    appearance:none;
    background-image:none;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-date-and-time-value{
    text-align:left;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-datetime-edit{
    padding:0;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-calendar-picker-indicator{
    opacity:0;
    display:none;
  }

  .jChartControls{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:8px;
    align-items:end;
  }

  .jChartControls .journalPeriodCtrl{
    grid-column:auto;
  }

  .jChartControls > *{
    min-width:0;
  }

  .jChartControls .journalPeriodCtrl select{
    height:36px;
    font-size:13px;
  }

  .jChartCheck{
    width:auto;
    min-height:36px;
    justify-content:flex-start;
    padding:6px 10px;
    font-size:13px;
  }

  /* RECIPE TABLE MOBILE: STABLE LEFT START + READABLE WIDTHS */

    .macroTableWrap{
    --macro-table-scale: .62;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
  }

  .macroTableWrap #ingTable{
    width: max-content;
    min-width: 0;
    table-layout: fixed;
    transform: scale(var(--macro-table-scale));
    transform-origin: top left;
  }

  .tableWrap{
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
  }

  #ingTable{
    width:max-content;
    min-width:0;
    table-layout:fixed;
  }

  #ingTable th,
  #ingTable td{
    padding:6px 5px;
  }

  #ingTable th{
  font-size:10px;
  line-height:1.05;
}

 #ingTable td input{
  height:27px;
  padding:3px 5px;
  font-size:11px;
  border-radius:8px;
}

 #ingTable .col-ing{
  width:168px;
  min-width:168px;
}

 #ingTable .orig-col,
#ingTable .adj-col{
  width:52px;
  min-width:52px;
}

  #ingTable .col-adjg,
#ingTable .col-adjpct{
  width:66px;
  min-width:66px;
}

  #ingTable thead tr:nth-child(1) th{
    height:38px;
  }

  #ingTable thead tr:nth-child(2) th{
    top:38px;
  }

  #journalTable{ min-width:920px; }

  /* MOBILE JOURNAL CHART: SCALED LIKE MACRO TABLE */
  .jChartWrap{
    overflow:hidden;
  }

  .progressChartWrap{
    --journal-chart-scale: .70;
    overflow:hidden;
    transform: translateZ(0);
  }

  .progressChartWrap .jChart{
    min-width:0;
    height:320px;
    transform: scale(var(--journal-chart-scale));
    transform-origin: top left;
  }
}

@media (max-width: 560px){
  .app{
    margin:8px;
    padding:10px;
  }

  .trackerHero{
    padding:14px;
    margin-bottom:12px;
  }

  .trackerHeroValue{
    font-size:32px;
  }

  .trackerHeroUnit{
    font-size:15px;
  }

  .trackerHeroBar{
    height:12px;
  }

  .trackerHeroMeta{
    font-size:11px;
  }

  .trackerHeroMacroGrid{
    gap:8px;
  }

  .trackerHeroMacroCard{
    padding:9px 10px;
  }

  .trackerHeroMacroLabel{
    font-size:11px;
  }

  .trackerHeroMacroValues{
    font-size:10px;
  }

  .progressChartWrap{
  --chart-scale: .62;
}

  .topbar.topbarCockpit{
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap:8px;
    padding:10px;
  }

  .appLogo{ height:44px; }

  .topbarTitle{
    font-size:16px;
    letter-spacing:.2px;
    white-space:nowrap;
  }

  .topbarHelp{
    width:36px;
    height:36px;
  }

  .trackerDateNavLabel{
    padding:0 10px;
    min-height:34px;
    font-size:13px;
  }

  .trackerDateNavBtn{
    min-width:32px;
    height:32px;
    padding:0 8px;
  }

  .trackerTopRow{
    gap:10px;
  }

  .trackerTopLeft{
    width:100%;
  }

  .trackerTopRight{
    width:100%;
    justify-content:flex-start;
    align-items:flex-start;
    gap:10px;
    margin-left:0;
  }

  .trackerDateNav{
    width:auto;
  }

  .trackerDateCluster{
    width:auto;
  }

  .trackerDateLabelBox{
    flex:0 0 auto;
    padding:0 12px;
    font-size:12px;
  }

  .trackerDateBtn{
    min-width:28px;
    width:28px;
    height:28px;
  }

  .trackerTargetsTop{
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    gap:8px;
    width:100%;
  }

  .trackerHeroTopActions{
    gap:8px;
  }

  .trackerHeroEditBtn{
    min-width:34px;
    width:34px;
    height:34px;
  }

  .trackerTargetsEditPanel{
    padding-top:10px;
  }

.targetsWrap{
  grid-template-columns: 1fr;
  gap:14px;
}

.targets{
  grid-template-columns: repeat(2, minmax(72px, 1fr));
  gap:8px;
}

  .kpiGrid{
  width:max-content;
  max-width:100%;
  grid-template-columns: 74px repeat(4, 52px);
  column-gap:6px;
  row-gap:10px;
  justify-content:start;
  margin:0;
  padding:0;
  border-left:0;
  border-top:0;
}

  .optimizerDayImpact{
    padding:10px;
  }

  .optimizerDayImpactBlock{
    padding:9px;
  }

  .optimizerDayImpactRow{
    font-size:12px;
  }



  .kpiHead{
    font-size:9px;
    letter-spacing:.6px;
  }

  .kpiLabel{
    font-size:10px;
    line-height:1.1;
    white-space:nowrap;
    align-self:center;
  }
 .kpiVal{
  width:52px;
  min-width:52px;
  max-width:52px;
  height:38px;
  font-size:11px;
  padding:0 4px;
  justify-content:center;
  overflow:hidden;
}

  .macroHeader{
    gap:8px;
  }

  .macroControls{
    grid-template-columns:minmax(0, 1fr) 60px;
    gap:8px;
  }

  .ctrlPortions{
    width:60px;
    min-width:60px;
  }

  .optimizerMode{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .macroActions .btn,
  .macroApplyBar .btn,
  .saveActions .btn,
  .journalActions .btn,
  .jChartControls .btn{
    min-height:42px;
  }

  .btnJournalEdit{
    min-height:36px;
    padding:0 10px;
  }

  .tableWrap{
    border-radius:12px;
  }

  /* RECIPE TABLE VERY SMALL MOBILE */
  #ingTable{
    width:max-content;
    min-width:0;
    table-layout:fixed;
  }

  #ingTable th,
  #ingTable td{
    padding:5px 4px;
  }

  #ingTable th{
    font-size:10px;
    line-height:1.1;
  }

  #ingTable td input{
    height:26px;
    padding:3px 5px;
    font-size:11px;
    border-radius:7px;
  }

  #ingTable .col-ing{
    width:160px;
    min-width:160px;
  }

  #ingTable .orig-col,
  #ingTable .adj-col{
    width:50px;
    min-width:50px;
  }

  #ingTable .col-adjg,
  #ingTable .col-adjpct{
    width:68px;
    min-width:68px;
  }

  #ingTable thead tr:nth-child(1) th{
    height:36px;
  }

  #ingTable thead tr:nth-child(2) th{
    top:36px;
  }

    .macroTableWrap{
    --macro-table-scale: .58;
  }

  .totRow{
    padding-top:10px;
  }

  .totCol{
    padding:12px;
  }

  .totKcal{
    font-size:16px;
  }

  .totMacros{
    font-size:13px;
  }

  #totalsTotalOrig,
  #totalsTotalAdj,
  #totalsPortionOrig,
  #totalsPortionAdj{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:6px 10px;
    align-items:start;
  }

  .totSep{
    display:none;
  }

  .saveMode{
    flex-direction:column;
  }

  .saveTab{
    width:100%;
  }

  .saveActions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
  }

  .journalCollapseSummary{
    padding:12px 14px;
    font-size:15px;
  }

  .journalCollapseBody,
  .journalCard{
    padding:12px;
  }

  /* SAFE FIX: DATE + NOTES FULL WIDTH, REST TWO COLUMNS */
  .journalForm{
    grid-template-columns:1fr 1fr;
    gap:10px;
  }

  .journalForm > label:first-child,
  .journalNotes,
  .journalActions{
    grid-column:1 / -1;
  }

  .journalForm label{
    gap:5px;
  }

  .journalForm input,
  .journalForm select{
    height:40px;
    font-size:14px;
  }

  .journalForm > label:first-child input[type="date"]{
    width:100%;
    min-width:0;
    max-width:100%;
    height:40px;
    font-size:14px;
    padding:0 12px;
    text-align:left;
    box-sizing:border-box;
    -webkit-appearance:none;
    appearance:none;
    background-image:none;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-date-and-time-value{
    text-align:left;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-datetime-edit{
    padding:0;
  }

  .journalForm > label:first-child input[type="date"]::-webkit-calendar-picker-indicator{
    opacity:0;
    display:none;
  }

  .journalForm textarea{
    min-height:110px;
    font-size:14px;
  }

  .journalActions{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    align-items:stretch;
  }

  .journalActions .btn{
    width:100%;
  }

  .sumItem,
  .wItem{
    padding:8px 9px;
  }

  .journalAverages{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .journalWeightGrid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .sumLabel,
  .wLabel{
    font-size:11px;
  }

  .sumVal,
  .wVal{
    font-size:13px;
  }

  .journalToolbar{
    align-items:flex-end;
  }

  .journalPeriodCtrl{
    width:auto;
    max-width:190px;
  }

  .journalToolbar .journalPeriodCtrl select{
    min-width:160px;
    width:auto;
  }

  #journalTable{
    min-width:840px;
  }

  .jChartWrap{
    overflow:hidden;
  }

  .progressChartWrap{
    --journal-chart-scale: .62;
  }

  .progressChartWrap .jChart{
    min-width:0;
    height:300px;
  }

  .licenseShell{
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 18px;
  }

  .licenseCard{
    width: min(760px, 100%);
    max-width: 760px;
    margin: 0 auto !important;
    padding: 24px !important;
  }

  .licenseInner{
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .licenseLogo{
    width: min(240px, 60vw);
    margin: 0 0 18px 0;
  }

  .licenseIntro{
    max-width: 620px;
    margin: 0 auto 22px auto;
  }

  .licenseField{
    width: 100%;
    margin-bottom: 16px;
  }

  .licenseField input{
    width: 100%;
  }

  .licenseActions{
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 12px;
    margin-bottom: 18px;
  }

  .licenseActions .btn{
    min-width: 180px;
  }

  .licenseMsg{
    width: 100%;
    text-align: center;
    margin-top: 0;
    margin-bottom: 10px;
  }

  .licenseHint{
    margin-top: 18px;
    max-width: 520px;
  }
}

.appView {
  display: contents;
}

.appView[hidden] {
  display: none !important;
}

.recipesSearchSystem{
  margin-bottom:14px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.recipesSearchBar{
  position:relative;
}

.recipesSearchBar{
  position:relative;
}

.recipesSearchSuggestions{
  position:absolute;
  left:0;
  right:0;
  top:calc(100% + 8px);
  z-index:30;
  padding:8px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--card-bg);
  box-shadow:0 14px 34px rgba(26,26,24,.12);
}

.recipesSearchSuggestionBtn{
  appearance:none;
  width:100%;
  min-height:42px;
  padding:9px 11px;
  border:0;
  border-radius:12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  background:transparent;
  color:var(--text);
  font:inherit;
  text-align:left;
  cursor:pointer;
}

.recipesSearchSuggestionBtn:hover{
  background:rgba(216,243,220,.65);
}

.recipesSearchSuggestionName{
  min-width:0;
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.recipesSearchSuggestionTags{
  flex:0 0 auto;
  max-width:45%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  font-weight:800;
  color:var(--muted-2);
  padding-top:2px;
}

@media (max-width: 560px){
  .recipesSearchSuggestions{
    top:calc(100% + 6px);
    border-radius:14px;
    padding:7px;
  }

  .recipesSearchSuggestionBtn{
    min-height:40px;
    padding:8px 10px;
    flex-direction:column;
    gap:3px;
  }

  .recipesSearchSuggestionTags{
    max-width:100%;
  }
}

.recipesSearchInput{
  height:46px;
  border-radius:16px;
  padding:0 16px;
  font-size:15px;
  font-weight:800;
  border-color:var(--line);
  background:var(--input-bg);
  box-shadow:none;
}

.recipesSearchInput::placeholder{
  color:var(--muted-2);
}

.recipesSearchInput:focus{
  border-color:rgba(64,145,108,.55);
  outline:3px solid rgba(216,243,220,.9);
}

.recipesFilterTopline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.recipesFilterToggleBtn{
  gap:8px;
  min-height:38px;
  border-radius:999px;
}

.recipesFilterCount{
  min-width:22px;
  height:22px;
  padding:0 7px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#D8F3DC;
  border:1px solid rgba(45,106,79,.24);
  color:#2D6A4F;
  font-size:11px;
  font-weight:900;
}

.recipesFilterPanel{
  margin-top:2px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--card-bg);
  box-shadow:0 12px 28px rgba(26,26,24,.06);
}

.recipesFilterPanel[hidden]{
  display:none !important;
}

.recipesFilterHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.recipesFilterTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.recipesFilterSubline{
  margin-top:2px;
  font-size:11px;
  font-weight:800;
  color:var(--muted-2);
}

.recipesFilterMeta{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.recipesFilterBlock{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.recipesFilterBlock + .recipesFilterBlock{
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.recipesFilterBlockLabel{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
}

.recipesFilterTags{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}

.recipesFilterTagBtn{
  appearance:none;
  min-height:32px;
  border:1px solid var(--line);
  background:var(--input-bg);
  color:var(--muted);
  border-radius:999px;
  padding:0 12px;
  font:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  transition:
    background .15s ease,
    border-color .15s ease,
    color .15s ease,
    box-shadow .15s ease,
    transform .15s ease;
}

.recipesFilterTagBtn:hover{
  background:rgba(216,243,220,.65);
  border-color:rgba(64,145,108,.35);
  color:#2D6A4F;
}

.recipesFilterTagBtn.is-active{
  border-color:rgba(45,106,79,.35);
  background:#D8F3DC;
  color:#2D6A4F;
  box-shadow:none;
}

.recipesFilterRangeGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(120px, 1fr));
  gap:9px 10px;
}

.recipesFilterRangeGrid label{
  min-width:0;
  gap:5px;
}

.recipesFilterRangeGrid .labelTitle{
  font-size:11px;
  font-weight:900;
  color:var(--muted-2);
}

.recipesFilterRangeGrid input{
  height:34px;
  font-size:13px;
  font-weight:900;
  border-radius:11px;
  background:var(--input-bg);
  border-color:var(--line);
}

.recipesFilterActions{
  margin-top:14px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.recipesFilterActions .btn{
  min-height:38px;
  border-radius:12px;
}

.recipesFilterActions #btnApplyRecipesFilter{
  min-width:140px;
}

.recipesFilterActions #btnResetRecipesFilter{
  min-width:140px;
}

.recipesFilterEmptyState{
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

@media (max-width: 980px){
  .recipesFilterRangeGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px){
  .recipesSearchSystem{
    gap:9px;
  }

  .recipesSearchInput{
    height:44px;
    border-radius:14px;
    font-size:14px;
    padding:0 13px;
  }

  .recipesFilterTopline{
    align-items:flex-start;
  }

  .recipesFilterToggleBtn{
    min-height:38px;
  }

  .recipesFilterMeta{
    width:100%;
    font-size:11px;
  }

  .recipesFilterPanel{
    padding:12px;
    border-radius:15px;
  }

  .recipesFilterTags{
    gap:6px;
  }

  .recipesFilterTagBtn{
    min-height:30px;
    padding:0 10px;
    font-size:11px;
  }

  .recipesFilterRangeGrid{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .recipesFilterRangeGrid input{
    height:36px;
  }

  .recipesFilterActions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .recipesFilterActions .btn,
  .recipesFilterActions #btnApplyRecipesFilter,
  .recipesFilterActions #btnResetRecipesFilter{
    width:100%;
    min-width:0;
    min-height:42px;
  }
}

.dashboardTargetsPlaceholderBody {
  min-height: 120px;
}

#dashboardView .dashboardTargetsPlaceholder {
  margin-bottom: 16px;
}



#dashboardTargetsMount {
  display: contents;
}
#trackerTargetsMount {
  display: contents;
}

.bottomNav{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  width:100%;
  height:68px;
  display:flex;
  align-items:center;
  justify-content:space-around;
  z-index:90;
  padding:0 max(10px, env(safe-area-inset-left)) env(safe-area-inset-bottom) max(10px, env(safe-area-inset-right));
  background:#FAFAF8F0;
  border-top:1px solid var(--line);
  box-shadow:0 -8px 22px rgba(26,26,24,.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.bottomNavBtn{
  appearance:none;
  flex:1 1 0;
  height:100%;
  border:0;
  background:transparent;
  color:#8A8A84;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.bottomNavBtn i{
  font-size:25px;
  line-height:1;
  font-style:normal;
}

.bottomNavBtn.is-active{
  color:#2D6A4F;
  text-shadow:none;
}

.bottomNavBtn.is-active i{
  filter:none;
}

.app{
  padding-bottom:88px;
}

@media (max-width: 560px){
  .bottomNav{
    height:66px;
  }

  .bottomNavBtn i{
    font-size:24px;
  }

  .app{
    padding-bottom:86px;
  }
}

.trackerTargetsTop label{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.trackerTargetsTop .labelTitle{
  font-size:11px;
  text-align:left;
  opacity:.7;
}

@media (min-width: 981px){
  .trackerTopRow{
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .trackerTopLeft{
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .trackerTopRight{
    flex: 0 0 auto !important;
    width: auto !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    margin-left: auto !important;
  }

  .trackerTargetsTopGroup{
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .trackerTargetsTopLabel{
    padding-top: 8px !important;
    margin: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .trackerTargetsTop{
    width: auto !important;
    grid-template-columns: repeat(4, minmax(72px, 76px)) !important;
    gap: 8px !important;
    align-items: start !important;
  }

  .trackerTargetsTop label{
    gap: 4px !important;
  }

  .trackerTargetsTop .labelTitle{
    font-size: 11px !important;
    line-height: 1.1 !important;
  }

  .trackerTargetsTop input{
    height: 28px !important;
    padding: 4px 10px !important;
    font-size: 13px !important;
  }

  .btnEditTargets{
    min-width: 42px !important;
    width: 42px !important;
    height: 36px !important;
    padding: 0 !important;
    border-radius: 12px !important;
    flex: 0 0 auto !important;
    align-self: flex-start !important;
    margin-top: 0 !important;
  }
}

.addToDayBar {
  margin-top: 10px;
}

.addToDayBar.underPortion {
  display: flex;
  gap: 10px;
  justify-content: flex-start;
}
.addToDayBar .btn[disabled]{
  cursor: default;
  opacity: .92;
}

.addToDayBar .btn.is-busy{
  filter: brightness(1.03);
}

.addToDayBar .btn.is-success{
  box-shadow:0 0 0 3px rgba(216,243,220,.9);
}

.optimizerDayImpact{
  margin-top:12px;
  padding:12px;
  border:1px solid rgba(64,145,108,.22);
  border-radius:14px;
  background: rgba(216,243,220,.45);
  box-shadow:none;
}

.optimizerDayImpactTitle{
  font-size:13px;
  font-weight:900;
  color: var(--text);
  margin-bottom:10px;
}

.optimizerDayImpactGrid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.optimizerDayImpactBlock{
  min-width:0;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background: var(--card-bg);
}

.optimizerDayImpactLabel{
  font-size:12px;
  font-weight:800;
  color: var(--muted);
  margin-bottom:8px;
}

.optimizerDayImpactRows{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.optimizerDayImpactRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:13px;
  color: var(--text);
}

.optimizerDayImpactRow span{
  color: var(--muted);
}

.optimizerDayImpactRow strong{
  color: var(--text);
  font-weight:900;
  text-align:right;
}
.trackSuccessPulse{
  animation: trackSuccessPulse .7s ease;
}

@keyframes trackSuccessPulse{
  0%{
    box-shadow: 0 0 0 rgba(45,106,79,0);
  }
  35%{
    box-shadow: 0 0 0 3px rgba(216,243,220,.9);
  }
  100%{
    box-shadow: 0 0 0 rgba(45,106,79,0);
  }
}

.quicktrackBox{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.quicktrackActions{
  display:flex;
  justify-content:flex-start;
  gap:8px;
}

.voiceFoodStartBtn i,
.barcodeScannerStartBtn i,
.labelScannerStartBtn i{
  font-size:18px;
}

.voiceFoodPanel{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background: var(--card-bg);
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.barcodeScannerPanel,
.labelScannerPanel{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:16px;
  background: var(--card-bg);
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.barcodeScannerHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.barcodeScannerTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.barcodeScannerSubline{
  margin-top:3px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  line-height:1.35;
}

.barcodeScannerCameraWrap{
  position:relative;
  width:100%;
  min-height:220px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--input-bg);
  overflow:hidden;
}

.barcodeScannerCameraWrap.is-scanning{
  border-color:rgba(64,145,108,.42);
  box-shadow:0 0 0 3px rgba(216,243,220,.65);
}

.barcodeScannerVideo{
  display:block;
  width:100%;
  min-height:220px;
  object-fit:cover;
  background:#F2F0EB;
}

.barcodeScannerBarcode{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}

.barcodeScannerMessage{
  margin-bottom:10px;
  padding:9px 11px;
  border:1px solid rgba(64,145,108,.24);
  border-radius:12px;
  background:rgba(216,243,220,.55);
  color:var(--text);
  font-size:12px;
  font-weight:900;
}

.barcodeScannerMessageError{
  border-color:rgba(155,32,32,.28);
  background:#FFE8E8;
  color:#9B2020;
}

.barcodeScannerReview{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.barcodeScannerReviewTitle{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:6px;
}

.barcodeScannerProductName{
  font-size:15px;
  font-weight:900;
  color:var(--text);
}

.barcodeScannerMacroLine{
  margin-top:5px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  line-height:1.45;
}

.barcodeScannerServingLine{
  margin-top:6px;
  font-size:12px;
  font-weight:900;
  color:var(--muted);
}

.barcodeScannerMacroGrid{
  margin-top:8px;
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.barcodeScannerMacroCard{
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
}

.barcodeScannerMacroCardPortion{
  border-color:rgba(64,145,108,.24);
  background:rgba(216,243,220,.45);
}

.barcodeScannerMacroLabel{
  font-size:11px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:4px;
}

.barcodeScannerMacroValue{
  font-size:12px;
  font-weight:900;
  color:var(--text);
  line-height:1.45;
}

.barcodeScannerManualBox{
  margin-top:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
}

.barcodeScannerManualInput{
  height:40px;
  font-weight:900;
}

.barcodeScannerManualActions{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.barcodeScannerNutritionWarning{
  margin-top:10px;
  padding:10px 11px;
  border:1px solid rgba(125,90,0,.28);
  border-radius:12px;
  background:#FFF3CD;
  color:#7D5A00;
  font-size:12px;
  font-weight:900;
  line-height:1.4;
}

.barcodeScannerNutritionEditBox{
  margin-top:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
}

.barcodeScannerNutritionEditTitle{
  margin-bottom:8px;
  font-size:12px;
  font-weight:900;
  color:var(--muted);
}

.barcodeScannerNutritionEditGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:8px;
}

.barcodeScannerNutritionEditGrid label{
  min-width:0;
}

.barcodeScannerNutritionInput{
  height:38px;
  font-weight:900;
}

.barcodeScannerNutritionEditActions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.barcodeScannerUnitGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns:1fr 96px;
  gap:8px;
  align-items:end;
}

.barcodeScannerAmountField,
.barcodeScannerUnitField{
  min-width:0;
}

.barcodeScannerAmountInput{
  height:40px;
  font-weight:900;
}

.barcodeScannerUnitToggle{
  height:40px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--input-bg);
}

.barcodeScannerUnitToggleBtn{
  appearance:none;
  -webkit-appearance:none;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.barcodeScannerUnitToggleBtn.is-active{
  background:var(--accent);
  color:#fff;
}

.barcodeScannerUnitHint{
  margin-top:6px;
  font-size:11px;
  font-weight:800;
  color:var(--muted);
  line-height:1.35;
}

.barcodeScannerInlineMessage{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid rgba(64,145,108,.24);
  border-radius:12px;
  background:rgba(216,243,220,.55);
  color:var(--text);
  font-size:12px;
  font-weight:900;
  line-height:1.4;
}

.barcodeScannerInlineMessageError{
  border-color:rgba(155,32,32,.28);
  background:#FFE8E8;
  color:#9B2020;
}

.barcodeScannerActions{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.labelScannerUploadBox{
  margin-top:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
}

.labelScannerFileInput{
  height:auto;
  min-height:42px;
  padding:8px 10px;
  font-weight:900;
}

.labelScannerPreview{
  margin-top:10px;
  border:1px solid rgba(64,145,108,.22);
  border-radius:14px;
  background:var(--card-bg);
  overflow:hidden;
}

.labelScannerPreview img{
  display:block;
  width:100%;
  max-height:320px;
  object-fit:contain;
  background:var(--card-bg);
}

.labelScannerEmptyPreview{
  margin-top:10px;
  padding:12px;
  border:1px dashed var(--line);
  border-radius:12px;
  background:var(--card-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  text-align:center;
}

.labelScannerProductGrid{
  margin-top:8px;
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}

.labelScannerMacroPreview{
  margin-top:10px;
}

@media (max-width:560px){
  .labelScannerPreview img{
    max-height:260px;
  }

  .labelScannerPanel .barcodeScannerActions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .labelScannerPanel .barcodeScannerActions .btn{
    width:100%;
    min-height:42px;
  }
}

.voiceFoodStatus{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:10px;
}

.voiceFoodRecorder{
  display:flex;
  align-items:center;
  gap:14px;
  min-height:86px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--input-bg);
  overflow:hidden;
}

.voiceFoodRecorder.is-listening{
  border-color:rgba(64,145,108,.42);
  background:
    radial-gradient(circle at 18% 50%, rgba(216,243,220,.70), transparent 34%),
    var(--input-bg);
  box-shadow:0 0 0 3px rgba(216,243,220,.65);
}

.voiceFoodRecorder.has-error{
  border-color:rgba(155,32,32,.34);
  background:#FFE8E8;
}

.voiceFoodMicOrb{
  width:54px;
  height:54px;
  min-width:54px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(64,145,108,.30);
  background:#D8F3DC;
  color:#2D6A4F;
  box-shadow:none;
}

.voiceFoodMicOrb i{
  font-size:25px;
  line-height:1;
  font-style:normal;
}

.voiceFoodRecorder.is-listening .voiceFoodMicOrb{
  animation: voiceFoodMicPulse 1.45s ease-in-out infinite;
}

.voiceFoodRecorderMain{
  flex:1 1 auto;
  min-width:0;
}

.voiceFoodRecorderTitle{
  font-size:14px;
  font-weight:900;
  color:var(--text);
}

.voiceFoodRecorderSubline{
  margin-top:3px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  line-height:1.35;
}

.voiceFoodEqualizer{
  margin-top:12px;
  height:24px;
  display:flex;
  align-items:center;
  gap:5px;
}

.voiceFoodEqualizer span{
  width:5px;
  height:7px;
  border-radius:999px;
  background:rgba(64,145,108,.76);
  box-shadow:none;
  opacity:.38;
}

.voiceFoodRecorder.is-listening .voiceFoodEqualizer span{
  opacity:1;
  animation: voiceFoodEqBar .82s ease-in-out infinite;
}

.voiceFoodRecorder.is-listening .voiceFoodEqualizer span:nth-child(2){
  animation-delay:.08s;
}

.voiceFoodRecorder.is-listening .voiceFoodEqualizer span:nth-child(3){
  animation-delay:.16s;
}

.voiceFoodRecorder.is-listening .voiceFoodEqualizer span:nth-child(4){
  animation-delay:.24s;
}

.voiceFoodRecorder.is-listening .voiceFoodEqualizer span:nth-child(5){
  animation-delay:.32s;
}

.voiceFoodTranscript{
  margin-top:10px;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--text);
  font-size:13px;
  font-weight:800;
  line-height:1.45;
}

.voiceFoodTranscript[hidden]{
  display:none !important;
}

@keyframes voiceFoodMicPulse{
  0%, 100%{
    transform:scale(1);
    box-shadow:0 0 0 0 rgba(216,243,220,0);
  }
  50%{
    transform:scale(1.045);
    box-shadow:0 0 0 6px rgba(216,243,220,.75);
  }
}

@keyframes voiceFoodEqBar{
  0%, 100%{
    height:7px;
  }
  50%{
    height:23px;
  }
}

.voiceFoodParsedResult{
  margin-top:8px;
}

.voiceFoodTrackingFeedback{
  margin-bottom:8px;
  padding:9px 11px;
  border:1px solid rgba(64,145,108,.24);
  border-radius:12px;
  background:rgba(216,243,220,.55);
  color:var(--text);
  font-size:12px;
  font-weight:900;
}

.voiceFoodParsedTitle{
  font-size:12px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:6px;
}

.voiceFoodParsedList{
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.voiceFoodParsedItem{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--card-bg);
}

.voiceFoodParsedItemMatched{
  border-color:rgba(45,106,79,.24);
  background:#D8F3DC;
}

.voiceFoodParsedItemUnmatched{
  border-color:rgba(125,90,0,.24);
  background:#FFF3CD;
}

.voiceFoodParsedItemStatus{
  font-size:11px;
  font-weight:900;
  color:var(--muted);
  margin-bottom:4px;
}

.voiceFoodParsedItemName{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.voiceFoodParsedItemMeta{
  margin-top:3px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.voiceFoodParsedItemActions{
  margin-top:8px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.voiceFoodProductForm{
  margin-top:10px;
  padding:10px;
  border:1px solid rgba(64,145,108,.22);
  border-radius:12px;
  background:rgba(216,243,220,.38);
}

.voiceFoodProductFormGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:8px;
}

.voiceFoodProductFormGrid label{
  min-width:0;
}

.voiceFoodProductFormGrid input,
.voiceFoodProductFormGrid select{
  height:36px;
  font-weight:800;
}

.voiceFoodProductFormActions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.voiceFoodProductFieldMissing input,
.voiceFoodProductFieldMissing select{
  border-color: rgba(125,90,0,.42) !important;
  background: #FFF3CD !important;
  box-shadow:none;
}

.voiceFoodProductFieldMissing .labelTitle{
  color: #7D5A00;
}

.voiceFoodProductFormError{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid rgba(125,90,0,.28);
  border-radius:12px;
  background:#FFF3CD;
  color:#7D5A00;
  font-size:12px;
  font-weight:900;
  line-height:1.35;
}

.voiceFoodRecorder.is-processing{
  border-color:rgba(64,145,108,.30);
  background:
    radial-gradient(circle at 18% 50%, rgba(216,243,220,.55), transparent 34%),
    var(--input-bg);
  box-shadow:none;
}

@media (max-width:560px){
    .voiceFoodRecorder{
    align-items:flex-start;
    padding:12px;
    gap:12px;
  }

  .voiceFoodMicOrb{
    width:48px;
    height:48px;
    min-width:48px;
  }

  .voiceFoodMicOrb i{
    font-size:22px;
  }

  .voiceFoodRecorderTitle{
    font-size:13px;
  }

  .voiceFoodRecorderSubline{
    font-size:11px;
  }
  .voiceFoodProductFormGrid{
    grid-template-columns:1fr;
  }

  .voiceFoodProductFormActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .voiceFoodProductFormActions .btn{
    width:100%;
  }
}

.voiceFoodParsedEmpty{
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:800;
}

.voiceFoodActions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.voiceFoodQuickConfirmCard{
  padding:12px;
  border:1px solid rgba(45,106,79,.24);
  border-radius:14px;
  background:#D8F3DC;
  box-shadow:none;
}

.voiceFoodQuickConfirmTitle{
  font-size:15px;
  font-weight:900;
  color:var(--text);
  margin-bottom:8px;
}

.voiceFoodQuickConfirmList{
  margin:0;
  padding-left:18px;
  display:flex;
  flex-direction:column;
  gap:6px;
  color:var(--text);
  font-size:13px;
  font-weight:900;
}

.voiceFoodQuickConfirmMeta{
  margin-top:10px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
}

.voiceFoodQuickConfirmActions{
  margin-top:12px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.voiceActivityReviewList{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:10px;
}

.voiceActivityReviewItem{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
}

.voiceActivityReviewItem label{
  margin-top:8px;
}

.voiceActivityDurationInput{
  min-height:42px;
  font-weight:900;
}

@media (max-width:560px){
  .voiceFoodQuickConfirmActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .voiceFoodQuickConfirmActions .btn{
    width:100%;
    min-height:42px;
  }
}

.quicktrackChooser{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-bg);
}

.quicktrackChooserActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-start;
}

.quicktrackOptionBtn[disabled]{
  cursor:default;
  opacity:.65;
}

.quicktrackPanel{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-bg);
}

.quicktrackGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(72px, 96px));
  gap:8px;
  justify-content:start;
}

.quicktrackGrid input{
  height:36px;
  font-weight:800;
}

.quicktrackPanelActions{
  margin-top:10px;
  display:flex;
  justify-content:flex-start;
  gap:8px;
  flex-wrap:wrap;
}

.quicktrackSaveProductBox{
  margin-top:10px;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.quicktrackSaveProductGrid{
  display:grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap:8px;
}

.quicktrackSaveProductGrid label{
  min-width:0;
}

.quicktrackSaveProductInput,
.quicktrackSaveProductSelect{
  height:36px;
  min-width:0;
}

.quicktrackSaveProductActions{
  margin-top:10px;
  display:flex;
  justify-content:flex-start;
}

.quicktrackSubmitBtn[disabled]{
  cursor:default;
  opacity:.92;
}

.quicktrackSubmitBtn.is-busy{
  filter: brightness(1.03);
}

.quicktrackSubmitBtn.is-success{
  box-shadow: 0 0 0 3px rgba(216,243,220,.9);
}

.trackerMetricsBox{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.trackerDaypartBox{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.trackerDaypartHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.trackerDaypartTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.trackerDaypartMeta{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.trackerDaypartList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.trackerDaypartRow{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.trackerDaypartRowTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}

.trackerDaypartLabelWrap{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}

.trackerDaypartLabel{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.trackerDaypartValue{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
  white-space:nowrap;
}

.trackerDaypartBar{
  width:100%;
  height:8px;
  border-radius:999px;
  background:#E8E4DD;
  overflow:hidden;
}

.trackerDaypartBarFill{
  height:100%;
  border-radius:999px;
  background:#40916C;
  box-shadow:none;
}

.trackerDaypartHint{
  margin-top:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  font-size:12px;
  color:var(--muted);
  line-height:1.45;
}

.trackerDaypartIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
  color:#40916C;
  flex:0 0 auto;
  filter:none;
}

.trackerDaypartIcon i{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:20px;
  line-height:1;
  font-style:normal;
}

@media (max-width: 560px){
  .trackerDaypartRow{
    padding:9px 10px;
  }

  .trackerDaypartRowTop{
    gap:8px;
  }

  .trackerDaypartLabel{
    font-size:12px;
  }

  .trackerDaypartValue{
    font-size:11px;
  }
}

.trackerMetricsHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.trackerMetricsTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.trackerMetricsChooser{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.trackerMetricsChooserGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.trackerMetricToggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:84px;
  padding:14px 14px;
  border:1px solid var(--line);
  border-radius:20px;
  background:var(--card-bg);
  box-shadow:0 10px 24px rgba(26,26,24,.06);
  text-align:left;
}

.trackerMetricToggleMain{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  flex:1 1 auto;
}

.trackerMetricToggleLabel{
  min-width:0;
  font-size:13px;
  font-weight:900;
  color:var(--text);
  line-height:1.2;
  text-align:left;
}

.trackerMetricIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:#40916C;
  flex:0 0 auto;
  filter:none;
}

.trackerMetricIcon svg{
  display:block;
  width:100%;
  height:100%;
  stroke:currentColor;
  fill:none;
  stroke-width:2.1;
  stroke-linecap:round;
  stroke-linejoin:round;
  overflow:visible;
}

.trackerMetricIconChooser{
  width:24px;
  height:24px;
  color:#40916C;
  filter:none;
}

.trackerMetricIconDisplay{
  width:38px;
  height:38px;
  color:#40916C;
  filter:none;
}

.trackerMetricHeadLabel{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  min-height:44px;
  overflow:visible;
}

.trackerMetricHead{
  align-items:center;
}

.trackerMetricSwitch{
  position:relative;
  flex:0 0 auto;
  width:48px;
  height:30px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.trackerMetricSwitch input{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  margin:0;
  opacity:0;
  cursor:pointer;
  z-index:2;
}

.trackerMetricSwitchSlider{
  position:relative;
  width:48px;
  height:30px;
  border-radius:999px;
  background:#E8E4DD;
  border:1px solid var(--line);
  box-shadow:none;
  transition:
    background .18s ease,
    border-color .18s ease,
    box-shadow .18s ease;
}

.trackerMetricSwitchSlider::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#FFFFFF;
  box-shadow:0 3px 8px rgba(26,26,24,.12);
  transition:transform .18s ease;
}

.trackerMetricSwitch input:checked + .trackerMetricSwitchSlider{
  background:var(--accent);
  border-color:var(--accent);
  box-shadow:none;
}

.trackerMetricSwitch input:checked + .trackerMetricSwitchSlider::after{
  transform:translateX(18px);
}

.trackerMetricSwitch input:focus-visible + .trackerMetricSwitchSlider{
  box-shadow:0 0 0 3px rgba(216,243,220,.9);
}

.trackerMetricsGrid{
  margin-top:10px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.trackerMetricField{
  min-width:0;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.trackerMetricFieldNotes{
  grid-column:1 / -1;
}

.trackerMetricBarRow{
  margin-top:6px;
  display:flex;
  align-items:center;
  gap:8px;
}

.trackerMetricHeaderActions{
  margin-top:8px;
  display:flex;
  justify-content:flex-start;
}

.trackerMetricActions{
  margin-top:8px;
  display:flex;
  justify-content:flex-start;
  gap:8px;
  flex-wrap:wrap;
}

.trackerMetricInlineBtn{
  min-height:28px;
  height:28px;
  padding:0 10px;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
}

.trackerMetricEditorPanel{
  margin-top:8px;
  padding-top:8px;
  border-top:1px solid var(--line);
}

.trackerMetricInput{
  height:36px;
  font-weight:800;
}

.trackerMetricTextarea{
  min-height:96px;
  padding:10px;
  resize:vertical;
}

.trackerMetricsEmpty{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
}

@media (max-width: 980px){
  .trackerMetricsChooserGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  .trackerMetricToggle{
    min-height:100px;
  }
}

@media (max-width: 560px){
  .trackerMetricsChooserGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
  }

  .trackerMetricsGrid{
    grid-template-columns:1fr;
  }

.trackerMetricToggle{
  min-width:0;
  width:100%;
  min-height:82px;
  padding:12px 8px;
  border-radius:18px;
  gap:8px;
}

.trackerMetricToggleMain{
  min-width:0;
  gap:8px;
}

.trackerMetricToggleLabel{
  min-width:0;
  font-size:12px;
  line-height:1.15;
  overflow-wrap:anywhere;
}

.trackerMetricIconChooser{
  width:20px;
  height:20px;
}

.trackerMetricIconDisplay{
  width:38px;
  height:38px;
  color:#40916C;
  filter:none;
}

  .trackerMetricSwitch{
    width:44px;
    height:28px;
  }

  .trackerMetricSwitchSlider{
    width:44px;
    height:28px;
  }

  .trackerMetricSwitchSlider::after{
    width:20px;
    height:20px;
  }

  .trackerMetricSwitch input:checked + .trackerMetricSwitchSlider::after{
    transform:translateX(16px);
  }

  .trackerMetricBarRow{
    gap:6px;
  }

  .trackerMetricBar{
    max-width:none;
  }

  .trackerMetricInlineBtn{
    min-height:26px;
    height:26px;
    padding:0 8px;
    font-size:10px;
  }

  .trackerMetricTargetRow{
    flex-wrap:wrap;
    gap:6px;
  }

  .trackerMetricTargetInput{
    max-width:100%;
  }
}

@media (max-width: 980px){
  .quicktrackGrid{
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    width:100%;
  }
}

@media (max-width: 560px){
  .quicktrackGrid{
    grid-template-columns: repeat(2, minmax(72px, 1fr));
    width:100%;
  }

  .quicktrackActions .btn,
  .quicktrackChooserActions .btn,
  .quicktrackPanelActions .btn,
  .quicktrackSaveProductActions .btn,
  .voiceFoodActions .btn,
  .barcodeScannerActions .btn,
  .barcodeScannerManualActions .btn,
  .barcodeScannerNutritionEditActions .btn{
    min-height:42px;
  }

  .quicktrackActions,
  .voiceFoodActions,
  .barcodeScannerActions,
  .barcodeScannerManualActions,
  .barcodeScannerNutritionEditActions{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .quicktrackActions .btn,
  .voiceFoodActions .btn,
  .barcodeScannerActions .btn,
  .barcodeScannerManualActions .btn,
  .barcodeScannerNutritionEditActions .btn{
    width:100%;
  }

    .barcodeScannerNutritionEditGrid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

    .barcodeScannerUnitGrid{
    grid-template-columns:1fr;
  }

  .quicktrackSaveProductGrid{
    grid-template-columns:1fr;
  }

  .quicktrackProductRow{
    gap:6px;
  }

  .quicktrackProductActions{
    gap:4px;
  }

  .quicktrackProductIconBtn{
    width:30px;
    height:30px;
    min-width:30px;
    border-radius:9px;
  }

  .quicktrackProductEditGrid{
    grid-template-columns:1fr;
  }

  .quicktrackProductEditActions{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
}

.quicktrackProductsPanel{
  display:flex;
  flex-direction:column;
  gap:12px;
  margin-top:10px;
}

.quicktrackProductsPanel[hidden]{
  display:none !important;
}

.quicktrackProductsSearchBar{
  display:flex;
  align-items:center;
}

.quicktrackSearchInput{
  width:100%;
  height:36px;
}

.quicktrackSessionMount[hidden]{
  display:none !important;
}

.quicktrackSessionBox{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-bg);
}

.quicktrackSessionHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.quicktrackSessionTitle{
  font-size:13px;
  font-weight:900;
  color: var(--text);
}

.quicktrackSessionActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.quicktrackSessionList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.quicktrackSessionItem{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background: var(--input-bg);
}

.quicktrackSessionItemMain{
  min-width:0;
  flex:1 1 auto;
}

.quicktrackSessionItemName{
  font-size:13px;
  font-weight:800;
  color: var(--text);
}

.quicktrackSessionItemMeta{
  margin-top:4px;
  font-size:12px;
  color: var(--muted);
  line-height:1.45;
}

.quicktrackSessionTotals{
  margin-top:10px;
  font-size:13px;
  color: var(--text);
}

.quicktrackSessionBox{
  margin-top:10px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-bg);
}

.quicktrackSessionHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.quicktrackSessionTitle{
  font-size:13px;
  font-weight:900;
  color: var(--text);
}

.quicktrackSessionActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.quicktrackSessionList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.quicktrackSessionItem{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background: var(--input-bg);
}

.quicktrackSessionItemMain{
  min-width:0;
  flex:1 1 auto;
}

.quicktrackSessionItemName{
  font-size:13px;
  font-weight:800;
  color: var(--text);
}

.quicktrackSessionItemMeta{
  margin-top:4px;
  font-size:12px;
  color: var(--muted);
  line-height:1.45;
}

.quicktrackSessionTotals{
  margin-top:10px;
  font-size:13px;
  color: var(--text);
}

.quicktrackSessionEmpty{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
}

.quicktrackProductsLoading{
  font-size:12px;
  font-weight:700;
  color: var(--muted);
  padding:2px 2px 0;
}

.quicktrackProductsGroup{
  border:1px solid var(--line);
  border-radius:12px;
  background: var(--card-bg);
  overflow:hidden;
}

.quicktrackFavoritesSection{
  border-color: rgba(125,90,0,.22);
  background: #FFF3CD;
  box-shadow:none;
}

.quicktrackFavoritesSummary{
  color: #7D5A00;
  font-weight:900;
  letter-spacing:.1px;
}

.quicktrackProductsCategory{
  list-style:none;
  cursor:pointer;
  padding:10px 12px;
  font-size:13px;
  font-weight:800;
  color: var(--text);
  background: var(--input-bg);
}

.quicktrackProductsCategory::-webkit-details-marker{
  display:none;
}

.quicktrackProductsCategory::after{
  content:"▾";
  float:right;
  opacity:.7;
  transition: transform .15s ease;
}

.quicktrackFavoritesSummary::before{
  content:"";
  display:inline-block;
  width:6px;
  height:6px;
  margin-right:8px;
  border-radius:999px;
  background: #7D5A00;
  vertical-align:middle;
  box-shadow:none;
}

.quicktrackProductsGroup[open] .quicktrackProductsCategory::after{
  transform: rotate(180deg);
}

.quicktrackProductsList{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px 12px;
  border-top:1px solid var(--line);
}

.quicktrackProductsNested{
  gap:8px;
}

.quicktrackProductsSubgroup{
  margin-top:2px;
}

.quicktrackProductsSubcategory{
  font-size:12px;
  font-weight:800;
}

.quicktrackProductsNested > .quicktrackProductsGroup{
  margin-left:8px;
}

.quicktrackProductCard{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.quicktrackProductRow{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}

.quicktrackProductItem{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex:1 1 auto;
  min-width:0;
  width:auto;
  min-height:34px;
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background: var(--card-bg);
  color: var(--text);
  font-size:13px;
  font-weight:700;
  text-align:left;
  cursor:pointer;
}

.quicktrackProductName{
  display:block;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.quicktrackProductItem:hover{
  background: rgba(216,243,220,.45);
  border-color: rgba(64,145,108,.28);
}

.quicktrackProductItem[disabled]{
  cursor:default;
  opacity:.92;
}

.quicktrackProductActions{
  display:flex;
  align-items:center;
  gap:6px;
  flex:0 0 auto;
}

.quicktrackProductIconBtn{
  width:32px;
  height:32px;
  min-width:32px;
  padding:0;
  border-radius:10px;
  border:1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.quicktrackProductAddToSessionBtn.is-success{
  box-shadow: 0 0 0 3px rgba(216,243,220,.9);
}

.quicktrackProductIconBtn:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}

.quicktrackProductIconBtn svg{
  width:15px;
  height:15px;
  display:block;
}

.quicktrackProductFavoriteBtn{
  color: var(--muted-2);
}

.quicktrackProductFavoriteBtn.is-active{
  color: #7D5A00;
  border-color: rgba(125,90,0,.28);
  background: #FFF3CD;
}

.quicktrackProductFavoriteBtn:hover{
  color: #7D5A00;
}

.quicktrackProductEditBox{
  padding:10px;
  border:1px solid var(--line);
  border-radius:12px;
  background: var(--input-bg);
}

.quicktrackProductEditGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
}

.quicktrackProductEditGrid label{
  min-width:0;
}

.quicktrackProductEditInput{
  height:34px;
  min-width:0;
}

.quicktrackProductEditActions{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.qtCategoryTitle{
  font-size:13px;
  font-weight:600;
  opacity:.7;
}

.qtProductList{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.qtProductItem{
  font-size:13px;
  padding:6px 8px;
  border-radius:6px;
  background:var(--input-bg);
  cursor:pointer;
}

.qtProductItem:hover{
  background:rgba(216,243,220,.45);
}

/* === BOOK STYLES ====*/

.bookRoot{
  color-scheme: inherit;
}

html{ color-scheme: light dark; }
*{ box-sizing:border-box; }

.bookRoot,
.bookRoot *{
  box-sizing:border-box;
}

.bookRoot{
  background: var(--frame-bg);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.bookRoot img{ max-width:100%; }

.bookRoot.app{
  max-width: 1280px;
  margin: 18px auto;
  padding: 18px;
  background: var(--panel-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(26,26,24,.06);
}

.bookRoot .grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:12px;
  margin-top:12px;
}

.bookRoot .card{
  grid-column: span 6;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.bookRoot .card.wide{ grid-column: span 12; }

.bookRoot .book-recipeIngredients{
  grid-column: span 4;
}

.bookRoot .book-recipeMethod{
  grid-column: span 8;
}

.bookRoot .book-recipeMacroCard{
  grid-column: span 8;
}

.bookRoot .book-recipeMicroCard{
  grid-column: span 4;
}

.bookRoot .card.framed{
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(26,26,24,.06);
}

.bookRoot .card.hero{
  position: relative;
  border: 1px solid rgba(64,145,108,.24);
  box-shadow: 0 16px 36px rgba(26,26,24,.08);
  overflow:hidden;
  isolation:isolate;
}

.bookRoot .card.hero::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:16px;
  pointer-events:none;
  background: linear-gradient(135deg, rgba(216,243,220,.85), rgba(216,243,220,0) 40%);
  opacity:.9;
  mix-blend-mode: normal;
  z-index:-1;
}

.bookRoot .topbar.topbarCockpit{
  display:grid;
  grid-template-columns: auto 1fr auto;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-radius:14px;
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: 0 12px 28px rgba(26,26,24,.08);
}

.bookRoot .topbarLeft,
.bookRoot .topbarCenter,
.bookRoot .topbarRight{
  display:flex;
  align-items:center;
  min-width:0;
}

.bookRoot .topbarLeft{ justify-content:flex-start; }
.bookRoot .topbarCenter{ justify-content:center; }
.bookRoot .topbarRight{ justify-content:flex-end; }

.bookRoot .topbarTitle{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: .4px;
  color: var(--text);
  text-align:center;
  white-space:nowrap;
  text-shadow:none;
}

.bookRoot .topbarHelp{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--text);
  text-decoration:none;
  flex:0 0 auto;
  font-weight: 900;
}

.bookRoot .brandMark{
  min-width: 64px;
  height: 38px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(64,145,108,.28);
  background: #D8F3DC;
  color: #2D6A4F;
  font-weight: 900;
  letter-spacing: .6px;
  box-shadow:none;
}

.bookRoot h2{
  margin:0 0 12px;
  font-size:18px;
  font-weight:800;
  color: var(--text);
  letter-spacing:.2px;
}

.bookRoot .card.hero > h2{
  text-align:left;
  font-size:18px;
  font-weight:800;
  letter-spacing:.2px;
  margin-bottom:12px;
  text-shadow:none;
}

.bookRoot .book-recipeHero{
  padding: 22px;
}

.bookRoot .book-recipeHeroContent{
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 18px;
  align-items: stretch;
}

.bookRoot .book-eyebrow{
  font-size:12px;
  font-weight:800;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1.2px;
  margin-bottom:10px;
}

.bookRoot .book-recipeTitle{
  margin:0;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--text);
  text-shadow:none;
}

.bookRoot .book-recipeIntro{
  margin: 14px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.bookRoot .book-macroSummary{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
  margin-top: 18px;
}

.bookRoot .book-macroPill{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: var(--card-bg);
  box-shadow:none;
}

.bookRoot .book-macroLabel{
  display:block;
  font-size:11px;
  font-weight:900;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1px;
  margin-bottom:6px;
}

.bookRoot .book-macroValue{
  display:block;
  font-size:18px;
  font-weight:900;
  color: var(--text);
}

.bookRoot .book-recipeHeroImageWrap{
  display:flex;
}

.bookRoot .book-recipeHeroImage{
  width:100%;
  min-height: 280px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--card-2);
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow:none;
}

.bookRoot .book-recipeCard{
  min-height: 100%;
}

.bookRoot .book-ingredientList,
.bookRoot .book-methodList{
  margin: 0;
  padding-left: 20px;
  color: var(--text);
}

.bookRoot .book-ingredientList li,
.bookRoot .book-methodList li{
  margin-bottom: 10px;
  line-height: 1.55;
}

.bookRoot .book-recipeMethod li{
  font-size: 15px;
  line-height: 1.7;
}

@media (min-width: 1000px){
  .bookRoot .book-recipeMethod li{
    font-size: 16px;
  }
}

.bookRoot .book-sectionHead{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.bookRoot .book-sectionMeta{
  font-size:12px;
  font-weight:800;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1px;
  white-space:nowrap;
}

.bookRoot .book-tableWrap{
  overflow:auto;
  -webkit-overflow-scrolling: touch;
  border:1px solid var(--line);
  border-radius:14px;
  background: var(--card-2);
}

.bookRoot .book-recipeTable{
  width:100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.bookRoot .book-recipeTable th,
.bookRoot .book-recipeTable td{
  padding:8px 10px;
  border-bottom:1px solid var(--line);
  color: var(--text);
  text-align:left;
  white-space:nowrap;
  font-size:13px;
}

.bookRoot .book-recipeTable th{
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--card-2);
  font-size:12px;
  font-weight:700;
  color: var(--muted);
  border-bottom:1px solid var(--line-2);
}

.bookRoot .book-recipeTable tbody tr:hover td{
  background: rgba(216,243,220,.35);
}

.bookRoot .book-microGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

.bookRoot .book-microItem{
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 14px;
  padding: 12px 12px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  box-shadow:none;
  text-decoration: none;
  color: inherit;
}

.bookRoot .book-microItem:hover,
.bookRoot .book-microItem:focus,
.bookRoot .book-microItem:active,
.bookRoot .book-microItem:visited{
  text-decoration: none;
  color: inherit;
}

.bookRoot .book-microName{
  font-size:13px;
  font-weight:800;
  color: var(--muted);
}

.bookRoot .book-microAmount{
  font-size:14px;
  font-weight:900;
  color: var(--text);
  text-align:right;
}

@media (max-width: 980px){
  .bookRoot .book-recipeHeroContent{
    grid-template-columns: 1fr;
  }

  .bookRoot .book-recipeIngredients,
  .bookRoot .book-recipeMethod,
  .bookRoot .book-recipeMacroCard,
  .bookRoot .book-recipeMicroCard{
    grid-column: span 12;
  }

  .bookRoot .book-macroSummary{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bookRoot .book-microGrid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px){
  .bookRoot.app{
    margin:10px;
    padding:12px;
    border-radius:16px;
  }

  .bookRoot .card{
    grid-column: span 12;
    padding:12px;
    border-radius:14px;
  }

  .bookRoot .topbar.topbarCockpit{
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items:center;
    gap:10px;
    padding:10px 12px;
  }

  .bookRoot .topbarTitle{
    font-size:18px;
    line-height:1.1;
  }

  .bookRoot .book-recipeTitle{
    font-size: 28px;
  }

  .bookRoot .book-recipeHero{
    padding: 16px;
  }

  .bookRoot .book-recipeHeroImage{
    min-height: 220px;
  }
}

@media (max-width: 560px){
  .bookRoot.app{
    margin:8px;
    padding:10px;
  }

  .bookRoot .topbar.topbarCockpit{
    gap:8px;
    padding:10px;
  }

  .bookRoot .topbarTitle{
    font-size:16px;
    letter-spacing:.2px;
  }

  .bookRoot .topbarHelp{
    width:36px;
    height:36px;
  }

  .bookRoot .brandMark{
    min-width: 52px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .bookRoot .book-recipeTitle{
    font-size: 24px;
  }

  .bookRoot .book-recipeIntro{
    font-size: 14px;
  }

  .bookRoot .book-macroSummary{
    grid-template-columns: 1fr 1fr;
    gap:8px;
  }

  .bookRoot .book-macroPill{
    padding: 10px 10px 9px;
  }

  .bookRoot .book-macroValue{
    font-size:16px;
  }

  .bookRoot .book-recipeHeroImage{
    min-height: 180px;
  }

  .bookRoot .book-microGrid{
    grid-template-columns: 1fr;
    gap:8px;
  }

  .bookRoot .book-recipeTable th,
  .bookRoot .book-recipeTable td{
    padding:8px 10px;
  }
}

.bookRoot .book-chapterHero{
  padding: 24px;
}

.bookRoot .book-chapterHeroInner{
  max-width: 980px;
}

.bookRoot .book-chapterTitle{
  margin:0;
  font-size: 36px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: .2px;
  color: var(--text);
  text-shadow:none;
}

.bookRoot .book-chapterIntro{
  margin: 16px 0 0;
  max-width: 860px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.bookRoot .book-chapterMetaRow{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-top: 20px;
}

.bookRoot .book-chapterMetaCard{
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: var(--card-bg);
  box-shadow:none;
}

.bookRoot .book-chapterMetaLabel{
  display:block;
  font-size:11px;
  font-weight:900;
  color: var(--muted-2);
  text-transform:uppercase;
  letter-spacing:1px;
  margin-bottom:6px;
}

.bookRoot .book-chapterMetaValue{
  display:block;
  font-size:15px;
  font-weight:800;
  color: var(--text);
}

.bookRoot .book-chapterIntroCard{
  grid-column: span 7;
}

.bookRoot .book-chapterQuickNav{
  grid-column: span 5;
}

.bookRoot .book-chapterBullets{
  display:grid;
  gap:10px;
}

.bookRoot .book-chapterBullet{
  border: 1px solid var(--line);
  background: var(--card-bg);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  box-shadow:none;
}

.bookRoot .book-quickNavGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

.bookRoot .book-quickNavItem{
  border: 1px solid rgba(64,145,108,.22);
  background: rgba(216,243,220,.45);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  box-shadow:none;
}

.bookRoot .book-nutrientCard{
  grid-column: span 6;
}

.bookRoot .book-chapterText{
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.bookRoot .book-chapterText:last-child{
  margin-bottom: 0;
}

@media (max-width: 980px){
  .bookRoot .book-chapterIntroCard,
  .bookRoot .book-chapterQuickNav,
  .bookRoot .book-nutrientCard{
    grid-column: span 12;
  }

  .bookRoot .book-chapterMetaRow{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px){
  .bookRoot .book-chapterHero{
    padding: 16px;
  }

  .bookRoot .book-chapterTitle{
    font-size: 30px;
  }
}

@media (max-width: 560px){
  .bookRoot .book-chapterTitle{
    font-size: 24px;
  }

  .bookRoot .book-chapterIntro{
    font-size: 14px;
  }

  .bookRoot .book-quickNavGrid{
    grid-template-columns: 1fr;
  }
}

.bookRoot .book-actionIconBtn{
  width:38px;
  height:38px;
  border-radius:12px;
  display:grid;
  place-items:center;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--muted);
  font-size:16px;
  font-weight:800;
  cursor:pointer;
  transition: all .15s ease;
}

.bookRoot .book-actionIconBtn:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}

.bookRoot .book-actionIconBtn.primary{
  border: 1px solid rgba(64,145,108,.28);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(45,106,79,.16);
}

.bookRoot .book-actionIconBtn.primary:hover{
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.bookRoot .book-recipeActions{
  display:flex;
  gap:8px;
  margin-top:14px;
}

.bookRoot .book-btnRecipeAction{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  width:36px;
  height:36px;
  padding:0;
  border-radius:10px;
  flex:0 0 auto;
  background: var(--card-2);
  border:1px solid var(--line);
  color: var(--muted);
  box-shadow:none;
  outline:none;
}

.bookRoot .book-btnRecipeAction svg{
  width:15px;
  height:15px;
  display:block;
  flex:0 0 auto;
}

@media (max-width:560px){
  .bookRoot .book-btnRecipeAction{
    min-width:36px;
    width:36px;
    height:36px;
  }
}

.bookRoot .book-btnRecipeAction:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}

.bookRoot .book-btnRecipeAction:focus{
  outline:none;
  box-shadow:none;
}

.bookRoot .book-btnRecipeAction:focus-visible{
  outline:none;
  box-shadow: 0 0 0 3px rgba(216,243,220,.9);
}

.macroStarterCalc{
  border-radius:14px;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--card-bg);
}

.macroStarterCalcSummary{
  list-style:none;
  cursor:pointer;
  padding:14px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font-weight:900;
  font-size:16px;
  color:var(--text);
  background:var(--input-bg);
}

.macroStarterCalcSummary::-webkit-details-marker{
  display:none;
}

.macroStarterCalcSummary::after{
  content:"▾";
  opacity:.7;
  transition:transform .15s ease;
}

.macroStarterCalc[open] .macroStarterCalcSummary::after{
  transform:rotate(180deg);
}

.macroStarterCalcBody{
  padding:14px 16px 16px;
  border-top:1px solid var(--line);
}

.macroStarterCalcGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.macroStarterCalcActions{
  margin-top:12px;
  display:flex;
  justify-content:flex-start;
}

.macroStarterCalcResult{
  margin-top:12px;
}

.macroStarterManualBox{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.macroStarterManualTargets{
  margin-top:8px;
}

.macroStarterCalcResultGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.macroStarterCalcResultItem{
  border:1px solid var(--line);
  background:var(--card-bg);
  border-radius:12px;
  padding:10px 12px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.macroStarterCalcResultLabel{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

@media (max-width: 820px){
  .macroStarterCalcGrid{
    grid-template-columns:1fr 1fr;
  }

  .macroStarterCalcResultGrid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 560px){
  .macroStarterCalcGrid{
    grid-template-columns:1fr;
  }

  .macroStarterCalcResultGrid{
    grid-template-columns:1fr 1fr;
  }
}

/* Inhaltsverzeichnis */

.tocSection {
  padding-top: 8px;
}

.tocContent {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tocBlock {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tocChapter {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
  color: var(--text);
}

.tocItem {
  font-size: 14px;
  color: var(--muted);
}

.tocSub {
  font-size: 14px;
  color: var(--muted);
  padding-left: 12px;
  opacity: 0.9;
}

.bookRoot .book-tocCard{
  grid-column: span 6;
}

.bookRoot .book-tocStandalone{
  grid-column: span 12;
}

.bookRoot .book-tocList{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.bookRoot .book-tocList p{
  margin:0;
  color: var(--text);
  font-size:15px;
  line-height:1.55;
}

.bookRoot .book-tocCard .book-tocList p{
  color: var(--muted);
}

.bookRoot .book-tocCard .book-sectionHead{
  margin-bottom:14px;
}

.bookRoot .book-tocCard .book-sectionHead h2{
  margin:0;
}

@media (max-width: 980px){
  .bookRoot .book-tocCard{
    grid-column: span 12;
  }
}

@media (max-width: 560px){
  .bookRoot .book-tocList{
    gap:8px;
  }

  .bookRoot .book-tocList p{
    font-size:14px;
    line-height:1.5;
  }
}

.tutorial-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tutorial-intro {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.tutorial-step {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tutorial-stepTitle {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}

.tutorial-step p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.tutorial-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tutorial-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--input-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 800;
}

.tutorial-caption {
  margin: 0;
  font-size: 13px;
  color: var(--muted-2);
  line-height: 1.5;
}

.tutorial-note {
  border: 1px solid rgba(64,145,108,.22);
  background: rgba(216,243,220,.45);
  border-radius: 14px;
  padding: 14px;
  box-shadow:none;
}

.tutorial-note h4 {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}

.tutorial-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 560px) {
  .tutorial-section {
    gap: 16px;
  }

  .tutorial-intro p,
  .tutorial-step p {
    font-size: 14px;
  }

  .tutorial-stepTitle {
    font-size: 15px;
  }

  .tutorial-image-placeholder {
    border-radius: 12px;
    font-size: 13px;
  }
}

.adjInputWrap{
  display:flex;
  align-items:center;
  gap:4px;
  width:100%;
}

.adjInputWrap input{
  flex:1 1 auto;
  min-width:0;
}

.adjSignBtn{
  flex:0 0 auto;
  min-width:28px;
  width:28px;
  height:28px;
  padding:0;
  border-radius:8px;
  border:1px solid var(--line);
  background: var(--input-bg);
  color: var(--muted);
  font-size:11px;
  font-weight:900;
  line-height:1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.adjSignBtn:hover{
  background: var(--accent-tint);
  border-color: rgba(64,145,108,.35);
  color: var(--accent-dark);
}

@media (max-width: 820px){
  .adjSignBtn{
    min-width:24px;
    width:24px;
    height:24px;
    font-size:10px;
  }
}

.trackerMetricHead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.trackerMetricValue{
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.trackerMetricBar{
  flex:1 1 auto;
  max-width:82%;
  height:6px;
  border-radius:999px;
  background:#E8E4DD;
  overflow:hidden;
}

.trackerMetricBarFill{
  height:100%;
  border-radius:999px;
  background:#40916C;
  box-shadow:none;
  transition:width .2s ease, background .2s ease, box-shadow .2s ease;
}
.trackerMetricTargetRow{
  margin-top:8px;
  display:flex;
  align-items:center;
  gap:8px;
}

.trackerMetricTargetLabel{
  flex:0 0 auto;
  font-size:11px;
  font-weight:800;
  color:var(--muted);
}

.trackerMetricTargetInput{
  width:100%;
  max-width:120px;
  height:32px;
  font-weight:800;
}
.trackerMetricIcon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.trackerMetricIcon i{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  font-style:normal;
}

.trackerMetricIconChooser{
  width:24px;
  height:24px;
  color:#40916C;
  filter:none;
}

.trackerMetricIconChooser i{
  font-size:24px;
}

.trackerMetricIconDisplay{
  width:38px;
  height:38px;
  color:#40916C;
  filter:none;
}

.trackerMetricIconDisplay i{
  font-size:38px;
}

.trackerMetricHeadLabel{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:42px;
  min-height:42px;
}
.trackerMetricIconSummary{
  width:16px;
  height:16px;
  color:#40916C;
  filter:none;
}

.trackerMetricIconSummary i{
  font-size:16px;
}

.recipesFeedItem{
  margin-bottom:18px;
  padding:14px;
  border-radius:16px;
  background:var(--card-bg);
}

.recipesFeedHero{
  cursor:pointer;
}

.recipesFeedDetail{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--line);
}

.recipesFeedItem .book-recipeHeroImage{
  min-height: 220px;
}

.recipesFeedItem .book-recipeHeroContent{
  align-items: center;
}

.recipesFeedDetail .book-microGrid{
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ==================================================
   RECIPES FEED – BOOK LAYOUT RESTORE
   ================================================== */

.recipesFeedItem{
  grid-column: span 12;
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap:12px;
  margin-bottom:18px;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
}

.recipesFeedItem > .book-recipeHero{
  grid-column: span 12;
}

.recipesFeedDetail{
  grid-column: span 12;
}

.recipesFeedDetail.grid{
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap:12px;
}

.recipesFeedDetail[hidden]{
  display:none !important;
}

.recipesFeedDetail .book-recipeIngredients{
  grid-column: span 4;
}

.recipesFeedDetail .book-recipeMethod{
  grid-column: span 8;
}

.recipesFeedDetail .book-recipeMacroCard{
  grid-column: span 8;
}

.recipesFeedDetail .book-recipeMicroCard{
  grid-column: span 4;
}

.recipesFeedItem .book-recipeHeroImage{
  min-height:280px;
  object-fit:contain;
}

@media (max-width: 980px){
  .recipesFeedDetail .book-recipeIngredients,
  .recipesFeedDetail .book-recipeMethod,
  .recipesFeedDetail .book-recipeMacroCard,
  .recipesFeedDetail .book-recipeMicroCard{
    grid-column: span 12;
  }
}

@media (max-width: 820px){
  .recipesFeedItem .book-recipeHeroImage{
    min-height:220px;
  }
}

@media (max-width: 560px){
  .recipesFeedItem{
    gap:10px;
  }

  .recipesFeedItem .book-recipeHeroImage{
    min-height:180px;
  }
}

.recipesSearchSuggestionBtn.is-active{
  background:var(--accent-tint);
  box-shadow:none;
}

@media (max-width: 560px){
  .bookRoot .book-stepEditorActions{
    display:grid !important;
    grid-template-columns:repeat(3, minmax(0, 1fr)) !important;
    column-gap:10px !important;
    row-gap:10px !important;
    width:100% !important;
  }

  .bookRoot .book-stepEditorActions .btn{
    width:100% !important;
    min-width:0 !important;
    margin:0 !important;
  }

  .bookRoot .book-stepEditorFooter{
    display:flex !important;
    flex-direction:column !important;
    gap:10px !important;
    width:100% !important;
    margin-top:12px !important;
  }

  .bookRoot .book-stepEditorFooter .btn{
    width:100% !important;
    margin:0 !important;
  }
}

#knowledgeView .micronutrientSearchBox{
  width:100%;
  margin:0 0 18px;
}

#knowledgeView .micronutrientSearchBar{
  display:flex;
  align-items:center;
  width:100%;
  height:48px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--input-bg);
  padding:0 14px;
  gap:10px;
}

#knowledgeView .micronutrientSearchIcon{
  position:static;
  left:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  line-height:1;
  color:var(--muted-2);
  flex:0 0 auto;
  pointer-events:none;
}

#knowledgeView .micronutrientSearchInput{
  flex:1 1 auto;
  width:auto;
  min-width:0;
  height:100%;
  border:none;
  border-radius:0;
  background:transparent;
  color:var(--text);
  padding:0;
  font:inherit;
  outline:none;
  box-shadow:none;
}

#knowledgeView .micronutrientSearchInput::placeholder{
  color:var(--muted-2);
}

#knowledgeView .micronutrientSearchInput:focus{
  border:none;
  background:transparent;
  box-shadow:none;
}

#knowledgeView .micronutrientSearchBar:focus-within{
  border-color:rgba(64,145,108,.55);
  background:var(--input-bg);
  box-shadow:0 0 0 3px rgba(216,243,220,.9);
}

.moreMenuGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}

.moreMenuBtn{
  appearance:none;
  min-height:92px;
  padding:16px;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--card-bg);
  color:var(--text);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  font:inherit;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 24px rgba(26,26,24,.06);
}

.moreMenuBtn i{
  font-size:28px;
  color:#40916C;
  filter:none;
}

.moreMenuBtn.danger i{
  color:#9B2020;
}

.knowledgeOverview{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.knowledgeOverviewIntro{
  color:var(--muted);
  font-size:14px;
  font-weight:800;
}

.knowledgeOverviewList{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.knowledgeOverviewBtn{
  appearance:none;
  width:100%;
  min-height:54px;
  padding:0 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--card-bg);
  color:var(--text);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  font:inherit;
  font-size:14px;
  font-weight:900;
  text-align:left;
  cursor:pointer;
}

.knowledgeOverviewBtn:hover{
  background:rgba(216,243,220,.65);
  border-color:rgba(64,145,108,.35);
}

.knowledgeOverviewBtn i{
  flex:0 0 auto;
  font-size:20px;
  color:var(--muted-2);
}

.knowledgeBackBtn{
  margin-bottom:14px;
}

@media (max-width:560px){
  .moreMenuGrid{
    grid-template-columns:1fr;
  }

  .moreMenuBtn{
    min-height:76px;
  }

  .knowledgeOverviewBtn{
    min-height:50px;
    font-size:13px;
  }
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
}

/* Link Wrapper */
.topbarAdLink{
  display:block;
  width:100%;
  text-decoration:none;
}

/* Slot */
.topbarAdSlot{
  width:100%;
  height:68px;
  border-radius:18px;

  display:flex;
  align-items:center;
  justify-content:center;

  border:1px solid var(--line);

  background:var(--card-bg);

  box-shadow:0 10px 24px rgba(26,26,24,.06);
}

/* Placeholder (kein echtes Ad!) */
.topbarAdPlaceholder{
  width:100%;
  height:100%;
  border-radius:inherit;

  background:
    linear-gradient(
      120deg,
      rgba(216,243,220,.75),
      rgba(242,240,235,.70),
      rgba(216,243,220,.75)
    );

  opacity:.75;
}

/* Optional: leichter Hover-Effekt */
.topbarAdLink:active .topbarAdSlot{
  transform:scale(.98);
}

.accountViewCard{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.accountSection{
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--card-bg);
}

.accountSectionTitle{
  margin-bottom:12px;
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.accountInfoGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}

.accountInfoItem{
  min-width:0;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
}

.accountInfoLabel{
  margin-bottom:6px;
  font-size:11px;
  font-weight:900;
  color:var(--muted-2);
  text-transform:uppercase;
  letter-spacing:.8px;
}

.accountInfoValue{
  font-size:14px;
  font-weight:900;
  color:var(--text);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.accountActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.accountActions .btn[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

.accountThemeControl{
  display:flex;
  gap:8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
}

.accountThemeOption{
  appearance:none;
  -webkit-appearance:none;
  flex:1 1 0;
  min-height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card-bg);
  color:var(--muted);
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.accountThemeOption.is-active{
  color:var(--accent-dark);
  border-color:rgba(64,145,108,.35);
  background:var(--accent-tint);
}

.accountThemeHint{
  margin-top:10px;
  font-size:12px;
  font-weight:800;
  color:var(--muted-2);
  line-height:1.4;
}

.accountThemeControl{
  display:flex;
  gap:8px;
  padding:6px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
}

.accountThemeOption{
  appearance:none;
  -webkit-appearance:none;
  flex:1 1 0;
  min-height:38px;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--card-bg);
  color:var(--muted);
  font:inherit;
  font-size:13px;
  font-weight:900;
  cursor:pointer;
}

.accountThemeOption.is-active{
  color:var(--accent-dark);
  border-color:rgba(64,145,108,.35);
  background:var(--accent-tint);
  box-shadow:none;
}

.accountThemeHint{
  margin-top:10px;
  font-size:12px;
  font-weight:800;
  color:var(--muted-2);
  line-height:1.4;
}

@media (max-width:560px){
  .accountInfoGrid{
    grid-template-columns:1fr;
  }

  .accountActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .accountActions .btn{
    width:100%;
    min-height:42px;
  }
}

.accountProfileGrid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-bottom:12px;
}

.accountProfileGrid label{
  min-width:0;
}

.accountProfileGrid input{
  height:40px;
  font-weight:800;
}

.accountAvatarBox{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--input-bg);
}

.accountAvatarPreview{
  flex:0 0 auto;
}

.accountAvatarImage{
  width:82px;
  height:82px;
  border-radius:999px;
  object-fit:cover;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(64,145,108,.28);
  background:#D8F3DC;
  color:#2D6A4F;
  font-size:30px;
  font-weight:900;
  box-shadow:none;
}

.accountAvatarActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width:560px){
  .accountProfileGrid{
    grid-template-columns:1fr;
  }

  .accountAvatarBox{
    align-items:stretch;
    flex-direction:column;
  }

  .accountAvatarActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .accountAvatarActions .btn{
    width:100%;
    min-height:42px;
  }
}

.accountPasswordGrid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  margin-bottom:10px;
}

.accountPasswordGrid label{
  min-width:0;
}

.accountPasswordGrid input{
  height:40px;
  font-weight:800;
}

.accountPasswordHint{
  margin-bottom:12px;
  font-size:12px;
  font-weight:800;
  color:var(--muted-2);
}

@media (max-width:560px){
  .accountPasswordGrid{
    grid-template-columns:1fr;
  }
}

.googleAuthBtn{
  width:100%;
  height:48px;
  border-radius:12px;
  border:1px solid var(--line);
  background:#FFFFFF;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.googleAuthInner{
  display:flex;
  align-items:center;
  gap:12px;
}

.googleAuthIcon{
  display:flex;
  align-items:center;
  justify-content:center;
}

.googleAuthText{
  font-size:14px;
  font-weight:600;
  color:var(--text);
}

.googleAuthBtn:hover{
  background:var(--input-bg);
}

.googleAuthBtn:active{
  transform:scale(.98);
}

.recipesCreateBox{
  margin-bottom:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--card-bg);
  box-shadow:0 12px 28px rgba(26,26,24,.06);
}

.recipesCreateHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.recipesCreateTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.recipesCreateSubline{
  margin-top:2px;
  font-size:12px;
  font-weight:800;
  color:var(--muted);
}

.recipesCreatePanel{
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.recipesCreatePanel[hidden]{
  display:none !important;
}

.recipesCreateGrid{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 120px;
  gap:10px;
}

.recipesCreateIngredientHead{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}

.recipesCreateIngredientTitle{
  font-size:13px;
  font-weight:900;
  color:var(--text);
}

.recipesCreateIngredientsList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.recipesCreateIngredientRow{
  display:grid;
  grid-template-columns:minmax(160px, 1.4fr) 82px 82px 82px 82px 82px 82px auto;
  gap:8px;
  align-items:center;
}

.recipesCreateIngredientRow input{
  min-width:0;
  height:36px;
  font-size:13px;
  font-weight:800;
}

.recipesCreateActions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

@media (max-width:980px){
  .recipesCreateIngredientRow{
    grid-template-columns:1fr 1fr;
  }

  .recipesCreateIngredientRow .btn{
    grid-column:1 / -1;
    width:100%;
  }
}

@media (max-width:560px){
  .recipesCreateHead{
    align-items:stretch;
  }

  .recipesCreateHead .btn{
    width:100%;
    min-height:42px;
  }

  .recipesCreateGrid{
    grid-template-columns:1fr;
  }

  .recipesCreateIngredientRow{
    grid-template-columns:1fr;
  }

  .recipesCreateActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .recipesCreateActions .btn{
    width:100%;
    min-height:42px;
  }
}

.recipesCreateStepsList{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.recipesCreateStepRow{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  gap:8px;
  align-items:start;
}

.recipesCreateStepRow textarea{
  min-height:84px;
  font-size:13px;
  font-weight:800;
}

@media (max-width:560px){
  .recipesCreateStepRow{
    grid-template-columns:1fr;
  }

  .recipesCreateStepRow .btn{
    width:100%;
    min-height:42px;
  }
}

.recipesCreateImageBox{
  margin-top:12px;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--input-bg);
}

.recipesCreateImageBox input[type="file"]{
  height:auto;
  min-height:40px;
  padding:8px 10px;
  font-weight:800;
}

.recipesCreateImagePreview{
  margin-top:10px;
  width:100%;
  max-width:320px;
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(64,145,108,.22);
  background:#FFFFFF;
}

.recipesCreateImagePreview[hidden]{
  display:none !important;
}

.recipesCreateImagePreview img{
  display:block;
  width:100%;
  aspect-ratio:16 / 10;
  object-fit:cover;
}


@media (max-width:820px){
  .bookRoot .book-recipeHeroImage.userRecipeHeroImage,
  .recipesFeedItem .book-recipeHeroImage.userRecipeHeroImage{
    min-height:220px;
  }
}

@media (max-width:560px){
  .recipesCreateImagePreview{
    max-width:none;
  }

  .bookRoot .book-recipeHeroImage.userRecipeHeroImage,
  .recipesFeedItem .book-recipeHeroImage.userRecipeHeroImage{
    min-height:180px;
  }
}

.userRecipeHeroImageWrap{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.userRecipeHeroImageWrap .book-recipeHeroImage{
  width:100%;
  min-height:280px;
}

.userRecipeHeroImageWrap img.book-recipeHeroImage{
  display:block;
  width:100%;
  aspect-ratio: 4 / 3;
  height:auto;
  max-height:360px;
  object-fit:cover;
}

.userRecipeImageActions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.userRecipeImageActions .btn{
  min-height:36px;
  flex:1 1 0;
}

@media (max-width:820px){
  .userRecipeHeroImageWrap .book-recipeHeroImage{
    min-height:220px;
  }

  .userRecipeHeroImageWrap img.book-recipeHeroImage{
    max-height:320px;
  }
}

@media (max-width:560px){
  .userRecipeHeroImageWrap .book-recipeHeroImage{
    min-height:180px;
  }

  .userRecipeHeroImageWrap img.book-recipeHeroImage{
    max-height:260px;
  }

  .userRecipeImageActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .userRecipeImageActions .btn{
    width:100%;
  }
}

.bookRoot .recipeLikeBtn{
  width:36px;
  min-width:36px;
  height:36px;
  padding:0;
  border-radius:10px;
}

.bookRoot .recipeLikeBtn i{
  font-size:17px;
  line-height:1;
  font-style:normal;
}

.recipeLikeCountPill{
  min-width:28px;
  height:28px;
  padding:0 9px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  background:#F2F0EB;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:12px;
  font-weight:900;
  line-height:1;
}

.bookRoot .recipeLikeBtn.is-liked{
  border-color:rgba(64,145,108,.28);
  background:#D8F3DC;
  color:#2D6A4F;
  box-shadow:none;
}

.bookRoot .recipeLikeBtn.is-liked i{
  color:#2D6A4F;
  filter:none;
}

.recipeLikeCountPill.is-liked{
  background:#D8F3DC;
  border-color:rgba(64,145,108,.28);
  color:#2D6A4F;
}

.recipeLikeHeart{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  font-size:19px;
  line-height:1;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight:900;
}

.communityRecipeBadge,
.publishedRecipeBadge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:24px;
  padding:0 9px;
  margin:0 7px 8px 0;
  border-radius:999px;
  font-size:11px;
  font-weight:900;
  letter-spacing:.3px;
  line-height:1;
  vertical-align:middle;
}

.communityRecipeBadge{
  border:1px solid rgba(64,145,108,.28);
  background:#D8F3DC;
  color:#2D6A4F;
  box-shadow:none;
}

.publishedRecipeBadge{
  border:1px solid rgba(45,106,79,.24);
  background:#D8F3DC;
  color:#2D6A4F;
}

.communityRecipeAuthor{
  margin-top:8px;
  font-size:12px;
  font-weight:900;
  color:var(--muted-2);
}

.userRecipePublishBtn,
.userRecipeUnpublishBtn{
  width:auto;
  min-width:0;
  padding:0 12px;
  white-space:nowrap;
}

@media (max-width:560px){
  .bookRoot .book-recipeActions{
    flex-wrap:wrap;
  }

  .userRecipePublishBtn,
  .userRecipeUnpublishBtn{
    min-height:36px;
  }
}

.communityRecipeAuthorBtn{
  appearance:none;
  -webkit-appearance:none;
  width:auto;
  min-height:30px;
  padding:3px 8px 3px 3px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#F2F0EB;
  color:var(--muted);
  font:inherit;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  text-align:left;
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.communityRecipeAuthorAvatar{
  width:24px;
  height:24px;
  border-radius:999px;
  object-fit:cover;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  border:1px solid rgba(64,145,108,.24);
  background:#D8F3DC;
  color:#2D6A4F;
  font-size:11px;
  font-weight:900;
}

.profileViewCard{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.profileHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  flex-wrap:wrap;
  padding:16px;
  border:1px solid rgba(64,145,108,.20);
  border-radius:18px;
  background:rgba(216,243,220,.34);
}
.profileHeader h2{
  margin-bottom:4px;
}

.profileIdentity{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.profileAvatarWrap{
  flex:0 0 auto;
}

.profileAvatarImage{
  width:92px;
  height:92px;
  border-radius:999px;
  object-fit:cover;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(64,145,108,.28);
  background:#D8F3DC;
  color:#2D6A4F;
  font-size:34px;
  font-weight:900;
  box-shadow:none;
}

.profileIdentityText{
  min-width:0;
}

.profileUsername{
  font-size:13px;
  font-weight:900;
  color:var(--muted-2);
}

.profileBio{
  margin:0;
  max-width:760px;
  color:var(--muted);
  font-size:14px;
  line-height:1.55;
}

.profileBioCard{
  margin:12px 0;
  padding:14px 16px;
  border-radius:14px;
  border:1px solid rgba(64,145,108,.22);
  background:rgba(216,243,220,.34);
}

.profileBioTitle{
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
  opacity:.7;
  margin-bottom:6px;
  color:var(--muted);
}

.profileBioText{
  font-size:14px;
  line-height:1.4;
  color:var(--text);
}

.profileBioEmpty{
  color:var(--muted-2);
}

.profileStats{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 160px));
  gap:10px;
}

.profileStat{
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
}

.profileStatValue{
  font-size:20px;
  font-weight:900;
  color:var(--text);
}

.profileStatLabel{
  margin-top:2px;
  font-size:11px;
  font-weight:900;
  color:var(--muted-2);
  text-transform:uppercase;
  letter-spacing:.8px;
}

.profileLinks{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
}

.profileLinks a{
  width:44px;
  height:44px;
  min-width:44px;
  min-height:44px;
  padding:0;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(64,145,108,.28);
  background:#D8F3DC;
  color:#2D6A4F;
  font-size:22px;
  font-weight:900;
  text-decoration:none;
  line-height:1;
}

.profileLinks a i{
  font-size:22px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
}

.profileLinks a:hover{
  background:#CDEFD4;
  border-color:rgba(45,106,79,.35);
}

.profileRecipesPlaceholder{
  margin-top:4px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--card-bg);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

@media (max-width:560px){
  .profileHeader{
    display:grid;
    grid-template-columns:1fr;
  }

  .profileIdentity{
    align-items:center;
  }

  .profileAvatarImage{
    width:78px;
    height:78px;
    font-size:28px;
  }

  .profileHeader .btn{
    width:100%;
    min-height:42px;
  }

  .profileStats{
    grid-template-columns:1fr 1fr;
  }

.profileLinks{
  display:flex;
  gap:10px;
  margin:12px 0;
  align-items:center;
  justify-content:flex-start;
}

.profileLinks a{
  width:46px;
  height:46px;
  min-width:46px;
  min-height:46px;
}
}

.voiceFoodPanel.has-parsed-result .voiceFoodAcceptBtn{
  display:none !important;
}

.voiceFoodSpeakAmountBtn{
  white-space:nowrap;
}

.voiceFoodAmountCorrection{
  margin-top:10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.voiceFoodAmountCorrection label{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.voiceFoodAmountCorrection input,
.voiceFoodAmountCorrection select{
  min-height:44px;
}

.voiceFoodAmountCorrectionActions{
  margin-top:14px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.voiceFoodAmountCorrectionActions .btn{
  min-height:40px;
}

@media (max-width:560px){
  .voiceFoodAmountCorrection{
    margin-top:12px;
    gap:12px;
  }

  .voiceFoodAmountCorrectionActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .voiceFoodAmountCorrectionActions .btn{
    width:100%;
    min-height:42px;
  }
}

.voiceFoodAmountCorrectionActions{
  margin-top:14px;
}

.voiceFoodAmountCorrection select{
  margin-bottom:4px;
}

@media (max-width:560px){
  .voiceFoodAmountCorrectionActions{
    margin-top:16px;
  }
}

.trackerMetricsHeadActions{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.voiceActivityBox{
  margin-top:10px;
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="green"],
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="green"],
:root[data-theme="dark"] .journalWeightBox{
  border-color:rgba(116,198,157,.28);
  background:rgba(64,145,108,.18);
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="yellow"],
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="yellow"]{
  border-color:rgba(255,209,102,.30);
  background:rgba(255,209,102,.14);
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="red"],
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="red"]{
  border-color:rgba(255,138,138,.30);
  background:rgba(255,138,138,.14);
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="neutral"],
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="neutral"]{
  border-color:var(--line);
  background:var(--card-2);
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="green"] .dashboardSignalDot,
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="green"] .dashboardSignalDot{
  background:#74C69D;
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="yellow"] .dashboardSignalDot,
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="yellow"] .dashboardSignalDot{
  background:#FFD166;
}

:root[data-theme="dark"] .dashboardSignalCard[data-signal-state="red"] .dashboardSignalDot,
:root[data-theme="dark"] .dashboardWeightSignal[data-signal-state="red"] .dashboardSignalDot{
  background:#FF8A8A;
}

:root[data-theme="dark"] .dashboardSignalText,
:root[data-theme="dark"] .sumLabel,
:root[data-theme="dark"] .wLabel{
  color:var(--muted);
}

:root[data-theme="dark"] .sumVal,
:root[data-theme="dark"] .wVal,
:root[data-theme="dark"] .journalWeightTitle{
  color:var(--text);
}

:root[data-theme="dark"] .bookRoot .card.hero::before,
:root[data-theme="dark"] .card.hero::before{
  background:linear-gradient(135deg, rgba(64,145,108,.16), rgba(64,145,108,0) 42%);
}

:root[data-theme="dark"] .bookRoot .book-macroPill,
:root[data-theme="dark"] .recipeLikeCountPill,
:root[data-theme="dark"] .communityRecipeAuthorBtn{
  background:var(--card-2);
  border-color:var(--line);
  color:var(--text);
}

:root[data-theme="dark"] .bookRoot .book-recipeHeroImage{
  background:var(--card-2);
  border-color:var(--line);
}

:root[data-theme="dark"] .trackerHero{
  background:rgba(64,145,108,.16);
  border-color:rgba(116,198,157,.28);
}

:root[data-theme="dark"] .trackerHeroEyebrow{
  color:#C8C8C4;
  opacity:1;
}

:root[data-theme="dark"] .trackerHeroPercent,
:root[data-theme="dark"] .trackerHeroMeta,
:root[data-theme="dark"] .trackerHeroUnit,
:root[data-theme="dark"] .trackerHeroMacroValues{
  color:#FAFAF8;
}

:root[data-theme="dark"] .trackerHeroBar,
:root[data-theme="dark"] .trackerHeroMacroBar{
  background:#3A3A38;
}

:root[data-theme="dark"] .trackerHeroMacroCard{
  background:#242422;
  border-color:#3A3A38;
}

.journalChartCustomLegend{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px 12px;
  padding:12px 14px 4px;
  background:transparent;
}

.journalChartLegendBtn{
  appearance:none;
  -webkit-appearance:none;
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:28px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--muted);
  font:inherit;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  opacity:.42;
}

.journalChartLegendBtn.is-active{
  opacity:1;
  color:var(--text);
}

.journalChartLegendMarker{
  width:10px;
  height:10px;
  border-radius:999px;
  border:2px solid var(--legend-color);
  background:var(--card-bg);
  flex:0 0 auto;
}

.journalChartLegendText{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  min-height:18px;
}

.journalChartLegendText i{
  font-size:18px;
  line-height:1;
  color:var(--muted);
}

.journalChartLegendBtn.is-active .journalChartLegendText i{
  color:var(--text);
}

@media (max-width:560px){
  .journalChartCustomLegend{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    flex-wrap:wrap;
    gap:10px 7px;
    padding:10px 10px 8px;
  }

  .journalChartLegendBtn{
    flex:0 0 auto;
    justify-content:center;
    gap:3px;
    font-size:11px;
    min-height:24px;
  }

  .journalChartLegendBtn[aria-label="Kcal"],
  .journalChartLegendBtn[aria-label="Protein"],
  .journalChartLegendBtn[aria-label="Fett"],
  .journalChartLegendBtn[aria-label="Carbs"]{
    font-size:10px;
    letter-spacing:-.2px;
  }

  .journalChartLegendBtn[aria-label="Flüssigkeit"]{
    margin-left:0;
  }

  .journalChartLegendBtn[aria-label="Flüssigkeit"]::before{
    content:"";
    flex-basis:100%;
  }

  .journalChartCustomLegend::after{
    content:"";
    flex-basis:100%;
    order:6;
  }

  .journalChartLegendBtn[aria-label="Flüssigkeit"],
  .journalChartLegendBtn[aria-label="Stress"],
  .journalChartLegendBtn[aria-label="Energie"],
  .journalChartLegendBtn[aria-label="Hunger"],
  .journalChartLegendBtn[aria-label="Regeneration"],
  .journalChartLegendBtn[aria-label="Intensität"],
  .journalChartLegendBtn[aria-label="Gewicht"]{
    order:7;
  }

  .journalChartLegendMarker{
    width:8px;
    height:8px;
    border-width:2px;
  }

  .journalChartLegendText{
    min-width:14px;
    min-height:18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    white-space:nowrap;
  }

  .journalChartLegendText i{
    font-size:17px;
  }

  .progressChartWrap{
    min-height:390px;
  }

  #journalChart,
  .progressChartWrap .jChart{
    height:560px !important;
    min-height:560px !important;
  }
    .journalControlsRow{
    gap:10px;
  }

  .journalControlsRow .inputWrap:first-child{
    flex:1.15;
    min-width:0;
  }

  .journalControlsRow .inputWrap:last-child{
    flex:.85;
    min-width:0;
  }

  .journalControlsRow .checkboxLabel{
    gap:8px;
    padding-left:12px;
    padding-right:12px;
  }
}

@media (max-width:560px){
  .dashboardAverages,
  .journalAverages.dashboardAverages{
    width:100%;
    max-width:100%;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
    overflow:hidden;
  }

  .dashboardAverages .sumItem,
  .journalAverages.dashboardAverages .sumItem,
  .dashboardSignalCard{
    min-width:0;
    width:100%;
    max-width:100%;
    box-sizing:border-box;
  }

  .dashboardSignalCardMain{
    min-width:0;
    gap:6px;
  }

  .dashboardSignalCard .sumLabel{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }

  .dashboardSignalCard .sumVal{
    flex:0 0 auto;
  }

  .dashboardSignalText{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
  }
}

.trackerDateToolbar{
  display:flex;
  align-items:center;
  gap:10px;
  width:100%;
}

.trackerDateToolbar .trackerDateCluster{
  flex:0 0 auto;
  min-width:0;
}

.trackerResetIconBtn{
  appearance:none;
  -webkit-appearance:none;
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:14px;
  border:1px solid var(--line);
  background:var(--card-2);
  color:var(--muted);
  cursor:pointer;
}

.trackerResetIconBtn i{
  font-size:20px;
  line-height:1;
}

.trackerResetIconBtn:active{
  transform:scale(.96);
}

:root[data-theme="dark"] .trackerResetIconBtn{
  background:#242422;
  border-color:#3A3A38;
  color:#B8B8B2;
}

/* ==================================================
   OPTIMIZER EDIT BUTTON – REPLACES ADJUSTMENT COLUMNS
   ================================================== */

#ingTable .col-edit{
  width:68px;
  min-width:68px;
  text-align:center;
}

.optimizerRowEditBtn{
  appearance:none;
  -webkit-appearance:none;
  width:30px;
  height:30px;
  min-width:30px;
  padding:0;
  border-radius:9px;
  border:1px solid var(--line);
  background:var(--input-bg);
  color:var(--muted);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.optimizerRowEditBtn i{
  font-size:15px;
  line-height:1;
  font-style:normal;
}

.optimizerRowEditBtn:hover{
  background:var(--accent-tint);
  border-color:rgba(64,145,108,.35);
  color:var(--accent-dark);
}

@media (max-width:820px){
  #ingTable .col-edit{
    width:68px;
    min-width:68px;
  }

  .optimizerRowEditBtn{
    width:30px;
    height:30px;
    min-width:30px;
  }
}

@media (max-width:560px){
  #ingTable .col-edit{
    width:68px;
    min-width:68px;
  }

  .optimizerRowEditBtn{
    width:28px;
    height:28px;
    min-width:28px;
  }

  .optimizerRowEditBtn i{
    font-size:14px;
  }
}

/* ==================================================
   OPTIMIZER ADJUSTMENT MODAL – FIX
   ================================================== */

.optimizerAdjustmentModal[hidden]{
  display:none !important;
}

.optimizerAdjustmentModal{
  position:fixed !important;
  inset:0 !important;
  z-index:99999 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:18px !important;
}

.optimizerAdjustmentBackdrop{
  position:absolute !important;
  inset:0 !important;
  background:rgba(26,26,24,.55) !important;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}

.optimizerAdjustmentSheet{
  position:relative !important;
  z-index:1 !important;
  width:min(460px, 100%) !important;
  max-height:calc(100vh - 36px) !important;
  overflow:auto !important;

  padding:16px !important;
  border-radius:18px !important;
  border:1px solid var(--line) !important;
  background:var(--card-bg) !important;
  color:var(--text) !important;
  box-shadow:0 22px 60px rgba(26,26,24,.32) !important;
}

.optimizerAdjustmentHead{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:10px;
}

.optimizerAdjustmentEyebrow{
  font-size:11px;
  font-weight:900;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted-2);
}

.optimizerAdjustmentTitle{
  margin-top:3px;
  font-size:18px;
  font-weight:900;
  color:var(--text);
}

.optimizerAdjustmentCloseBtn{
  width:34px;
  height:34px;
  min-width:34px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--input-bg);
  color:var(--muted);
  font-size:22px;
  font-weight:900;
}

.optimizerAdjustmentMeta{
  margin-bottom:14px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--input-bg);
  color:var(--muted);
  font-size:13px;
  font-weight:800;
}

.optimizerAdjustmentFields{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.optimizerAdjustmentFields input{
  height:42px;
  font-weight:900;
}

.optimizerAdjustmentActions{
  margin-top:14px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
  flex-wrap:wrap;
}

body.optimizerAdjustmentModalOpen{
  overflow:hidden;
}

@media (max-width:560px){
  .optimizerAdjustmentModal{
    align-items:flex-end !important;
    padding:0 !important;
  }

  .optimizerAdjustmentSheet{
    width:100% !important;
    max-height:calc(100vh - 24px) !important;
    border-radius:20px 20px 0 0 !important;
    border-left:0 !important;
    border-right:0 !important;
    border-bottom:0 !important;
    padding:16px 14px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .optimizerAdjustmentFields{
    grid-template-columns:1fr;
    gap:12px;
  }

  .optimizerAdjustmentFields input{
    height:44px;
    font-size:15px;
  }

  .optimizerAdjustmentActions{
    display:grid;
    grid-template-columns:1fr;
  }

  .optimizerAdjustmentActions .btn{
    width:100%;
    min-height:44px;
  }
}

/* ==================================================
   OPTIMIZER TABLE INPUTS – DARK MODE FIX
   ohne Highlighting zu überschreiben
   ================================================== */

[data-theme="dark"] #ingTable td:not(.hl-original):not(.hl-adjusted):not(.hl-ing) input{
  background:#232320 !important;
  color:#f3f3ef !important;
  border-color:rgba(255,255,255,.08) !important;
}

[data-theme="dark"] #ingTable td:not(.hl-original):not(.hl-adjusted):not(.hl-ing) input[readonly]{
  background:#232320 !important;
  color:#f3f3ef !important;
}

[data-theme="dark"] #ingTable td input::placeholder{
  color:rgba(243,243,239,.45) !important;
}