:root{
  color-scheme: dark;

  --frame-bg: #07080b;
  --panel-bg: #0c0f14;
  --card-bg: #111622;
  --card-2: #0f1420;
  --input-bg: #0b0f18;

  --line: rgba(255,255,255,.10);
  --line-2: rgba(255,255,255,.07);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted-2: rgba(255,255,255,.50);

  --accent: #39d353;
  --danger: #ff4d4d;

  --hl-blue: 120, 170, 255;
  --hl-blue-strong: 0, 140, 255;

  --blue-line: rgba(74,168,255,.55);
  --blue-glow: rgba(74,168,255,.12);
}

html{ color-scheme: 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 rgba(255,255,255,.06);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

.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: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
}

.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 rgba(var(--hl-blue-strong), .35);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow:
    0 18px 50px rgba(0,0,0,.45),
    0 0 34px rgba(var(--hl-blue-strong), .12),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.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: rgba(255,255,255,.95);
  text-align:center;
  white-space:nowrap;
  text-shadow:
    0 0 8px rgba(var(--hl-blue-strong), .45),
    0 0 18px rgba(var(--hl-blue-strong), .35),
    0 0 40px rgba(var(--hl-blue-strong), .25),
    0 0 70px rgba(var(--hl-blue-strong), .18);
}

.appLogo{
  height: 72px;
  width: auto;
  display:block;
  background: transparent;
  filter:
    drop-shadow(0 0 10px rgba(var(--hl-blue-strong), .18))
    drop-shadow(0 0 22px rgba(var(--hl-blue-strong), .10));
}

.topbarHelp{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  text-decoration:none;
  flex:0 0 auto;
}
.topbarHelp:hover{
  border-color: rgba(var(--hl-blue-strong), .55);
  box-shadow: 0 0 18px rgba(var(--hl-blue-strong), .16);
}
.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: linear-gradient(180deg, rgba(var(--hl-blue-strong), .95), rgba(var(--hl-blue-strong), .80));
  border:1px solid rgba(var(--hl-blue-strong), .85);
  color:#fff;
  box-shadow:
    0 6px 18px rgba(var(--hl-blue-strong), .25),
    inset 0 1px 0 rgba(255,255,255,.15);
}
.btn.primary:hover{
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(var(--hl-blue-strong), 1), rgba(var(--hl-blue-strong), .9));
}
.btn.primary:active{
  transform: translateY(0);
  box-shadow:
    0 3px 10px rgba(var(--hl-blue-strong), .25),
    inset 0 1px 0 rgba(255,255,255,.12);
}

.btn.secondary{
  background: rgba(255,255,255,.04);
  border:1px solid rgba(var(--hl-blue-strong), .35);
  color: rgba(255,255,255,.85);
}
.btn.secondary:hover{
  background: rgba(var(--hl-blue-strong), .08);
  border-color: rgba(var(--hl-blue-strong), .6);
  color: #fff;
}
.btn.secondary:active{ background: rgba(var(--hl-blue-strong), .12); }

.btn.danger{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.30);
  color: rgba(255,235,235,.92);
}

select,
input,
textarea{
  width:100%;
  background: var(--input-bg);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
  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(57,211,83,.55);
  outline: 3px solid rgba(57,211,83,.16);
  outline-offset: 2px;
}

select{
  background: var(--input-bg) !important;
  color: var(--text) !important;
}
option{
  background: #0b0f18;
  color: rgba(255,255,255,.92);
}

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 rgba(255,255,255,.08);
  border-radius:16px;
  padding:14px;
  box-shadow:
    0 26px 70px rgba(0,0,0,.55),
    0 10px 26px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.07);
}
.card.wide{ grid-column: span 12; }

.card.framed{
  border: 1px solid rgba(var(--hl-blue-strong), .35);
  box-shadow:
    0 20px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.card.hero{
  position: relative;
  border: 1px solid rgba(var(--hl-blue-strong), .45);
  box-shadow:
    0 40px 120px rgba(0,0,0,.78),
    0 20px 60px rgba(0,0,0,.55),
    0 0 80px rgba(var(--hl-blue-strong), .28);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card.hero::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:16px;
  pointer-events:none;
  background: linear-gradient(135deg, rgba(var(--hl-blue-strong), .35), rgba(var(--hl-blue-strong), 0) 40%);
  opacity:.55;
  mix-blend-mode: screen;
}
@media (hover:hover){
  .card.hero:hover{
    transform: translateY(-3px);
    box-shadow:
      0 36px 110px rgba(0,0,0,.72),
      0 18px 46px rgba(0,0,0,.50),
      0 0 55px rgba(var(--hl-blue-strong), .18),
      inset 0 1px 0 rgba(255,255,255,.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:
    0 0 14px rgba(var(--hl-blue-strong), .22),
    0 0 30px rgba(var(--hl-blue-strong), .14);
}
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 rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight:800;
}

.trackerDateNavBtn{
  min-width:34px;
  height:34px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.82);
  box-shadow:none;
}

.trackerDateNavBtn:hover{
  background: rgba(255,255,255,.05);
  border-color: rgba(var(--hl-blue-strong), .30);
  color: var(--text);
}

.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:flex;
  align-items:center;
  gap:4px;
  min-height:40px;
  padding:4px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}

.trackerDateLabelBox{
  min-height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 16px;
  border-radius:10px;
  border:0;
  background: transparent;
  color: var(--text);
  font-weight:800;
}

.trackerDateBtn{
  min-width:32px;
  width:32px;
  height:32px;
  padding:0;
  border-radius:9px;
  border:0;
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.82);
  box-shadow:none;
}

.trackerDateBtn:hover{
  background: rgba(255,255,255,.07);
  border-color: transparent;
  color: var(--text);
}

.trackerDateBtn:active{
  background: rgba(255,255,255,.10);
  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: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.10);
  color: var(--text);
  opacity:1;
  cursor:default;
}

.trackerTargetsTop input.targetsInlineEditing{
  background: var(--input-bg);
  border-color: rgba(var(--hl-blue-strong), .55);
  box-shadow: 0 0 0 3px rgba(var(--hl-blue-strong), .12);
  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;
}


.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 rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  font-size:13px;
  font-weight:900;
  color: var(--text);
}
.kpiVal.neg{
  border-color: rgba(255,77,77,.22);
  background: rgba(255,77,77,.08);
  color: rgba(255,235,235,.92);
}

.kpiLabelMain{
  color: rgba(255,255,255,.92);
  font-size:13px;
}

.kpiValMain{
  height:40px;
  font-size:15px;
  border-color: rgba(var(--hl-blue-strong), .28);
  background: rgba(var(--hl-blue-strong), .08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

/* =========================
   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(var(--hl-blue-strong), .28);
  background: rgba(var(--hl-blue-strong), .08);
  color: rgba(255,255,255,.88);
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
  white-space:nowrap;
}

#macroSection.recipeLoading{
  border-color: rgba(var(--hl-blue-strong), .52);
  box-shadow:
    0 40px 120px rgba(0,0,0,.78),
    0 20px 60px rgba(0,0,0,.55),
    0 0 80px rgba(var(--hl-blue-strong), .28),
    inset 0 0 0 1px rgba(var(--hl-blue-strong), .18);
}

.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: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

.macroHeader select:focus{
  border-color: rgba(var(--hl-blue-strong), .80);
  outline: 3px solid rgba(var(--hl-blue-strong), .18);
  outline-offset: 2px;
}

.optimizerMode{
  display:flex;
  gap:8px;
  padding:6px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background: rgba(0,0,0,.18);
}

.viewTab{
  min-height:36px;
  padding:0 14px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
  white-space:nowrap;
}

.viewTab.active{
  color: var(--text);
  border-color: rgba(var(--hl-blue-strong), .55);
  background: rgba(var(--hl-blue-strong), .12);
  box-shadow: 0 0 26px rgba(var(--hl-blue-strong), .10);
}

.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 rgba(255,255,255,.06);
  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 rgba(255,255,255,.10);
  border-radius:10px;
}
#ingTable td input[readonly]{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.10);
  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(var(--hl-blue-strong), .95) !important;
  background: rgba(var(--hl-blue), .14) !important;
  box-shadow:
    0 0 0 1px rgba(var(--hl-blue-strong), .55),
    0 0 18px rgba(var(--hl-blue-strong), .22);
  font-weight: 800;
}
td.hl-ing input{
  background: rgba(var(--hl-blue), .18) !important;
  box-shadow:
    0 0 0 1px rgba(var(--hl-blue-strong), .65),
    0 0 22px rgba(var(--hl-blue-strong), .28);
}
td.hl-original input:focus,
td.hl-adjusted input:focus,
td.hl-ing input:focus{
  box-shadow:
    0 0 0 3px rgba(57,211,83,.16),
    0 0 18px rgba(57,211,83,.10) !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(--blue-line);
  border-radius:16px;
  padding:14px 14px 12px;
  background: rgba(255,255,255,.03);
  box-shadow:
    0 0 0 1px rgba(74,168,255,.10) inset,
    0 14px 34px rgba(0,0,0,.35),
    0 0 26px var(--blue-glow);
  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: 0 0 14px rgba(74,168,255,.14);
}

.totSep{
  color: rgba(255,255,255,.35);
  font-weight:800;
}

.totMacros{
  font-size:14px;
  font-weight:800;
  color: rgba(255,255,255,.82);
}

#totalsTotalAdj,
#totalsPortionAdj{
  text-shadow: 0 0 12px rgba(var(--hl-blue-strong), .18);
}

/* =========================
   SAVE BOX
   ========================= */

.saveBox{
  margin-top:16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
  background: rgba(255,255,255,.03);
  box-shadow:
    0 12px 30px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.saveMode{
  display:flex;
  gap:8px;
  padding:6px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius:14px;
  background: rgba(0,0,0,.18);
  margin-bottom:12px;
}
.saveTab{
  flex:1;
  min-height:36px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
}
.saveTab.active,
.saveTab[data-active="1"]{
  color: var(--text);
  border-color: rgba(var(--hl-blue-strong), .55);
  background: rgba(var(--hl-blue-strong), .12);
  box-shadow: 0 0 26px rgba(var(--hl-blue-strong), .10);
}

.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 18px 46px rgba(0,0,0,.35);
}

.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: rgba(255,255,255,.03);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.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(var(--hl-blue-strong), .28);
  border-radius:12px;
  background: rgba(var(--hl-blue), .10);
  color: rgba(255,255,255,.90);
  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 rgba(255,255,255,.10);
  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 rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  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;
}
.sumVal{
  font-size:14px;
  font-weight:900;
  color: var(--text);
  text-align:right;
  white-space: nowrap;
}

.journalWeightBox{
  border: 1px solid rgba(var(--hl-blue-strong), .28);
  background: rgba(var(--hl-blue), .10);
  border-radius: 16px;
  padding: 12px;
  box-shadow:
    0 0 0 1px rgba(var(--hl-blue-strong), .10) inset,
    0 16px 40px rgba(0,0,0,.35);
}
.journalWeightTitle{
  font-weight:900;
  color: rgba(255,255,255,.90);
  font-size:13px;
  letter-spacing:.2px;
  margin-bottom:10px;
}
.journalWeightGrid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap:10px;
}
.wItem{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.12);
  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: rgba(255,255,255,.72);
  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: rgba(255,255,255,.72);
}
.jChartControls select{
  height:40px;
  font-weight:900;
}

.jChartCheck{
  width:auto;
  flex-direction:row;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: rgba(255,255,255,.85);
  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:#0b0b0b;
  color:#ffffff;
  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:rgba(255,255,255,.72);
  line-height:1.5;
  max-width:420px;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 980px){
  .targetsWrap{
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }

  .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;
  }

  .totals2{ grid-template-columns:1fr; }
  .totCols{ grid-template-columns:1fr; }
  .journalAverages{ grid-template-columns: repeat(2, 1fr); }
  .journalWeightGrid{ grid-template-columns: repeat(2, 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;
  }

    .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;
  }

  .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 18px;
  }

  .trackerDateBtn{
    min-width:34px;
    width:34px;
    height:34px;
  }

  .trackerTargetsTopGroup{
    width:100%;
    flex-direction:column;
    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;
  }

.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;
}



  .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;
  }

  /* OLD-STYLE CHART FEEL */
  .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;
}

.dashboardTargetsPlaceholderBody {
  min-height: 120px;
}

#dashboardView .dashboardTargetsPlaceholder {
  margin-bottom: 16px;
}

#dashboardTargetsMount {
  display: contents;
}

.burgerBtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  cursor: pointer;
}

.burgerBtn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

.appDrawerBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 60;
}

.appDrawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 86vw);
  height: 100dvh;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 70;
  pointer-events: none;
  overflow: hidden;
}

.appDrawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.appDrawerInner {
  height: 100%;
  padding: 88px 18px 24px;
  background: #11151b;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.drawerNavBtn {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.drawerNavBtn.is-active {
  border-color: rgba(57, 211, 83, 0.45);
  background: rgba(57, 211, 83, 0.12);
}

#tutorialsView .msg {
  margin-top: 12px;
}

.drawerGroup {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
}

.drawerGroupSummary {
  list-style: none;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
  padding: 10px 4px;
}

.drawerGroupSummary::-webkit-details-marker {
  display: none;
}

.drawerGroupBody {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawerSubList,
.drawerNestedList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawerNestedList {
  padding-left: 14px;
}

.drawerSubBtn {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  font: inherit;
  cursor: pointer;
  border-radius: 10px;
}

.drawerSubBtn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.drawerSubBtn.is-active {
  background: rgba(57, 211, 83, 0.12);
  color: var(--text);
  font-weight: 700;
}

body.drawer-open {
  overflow: hidden;
}

.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;
  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 1px rgba(57,211,83,.42),
    0 0 18px rgba(57,211,83,.22),
    0 6px 18px rgba(57,211,83,.16);
}

.trackSuccessPulse{
  animation: trackSuccessPulse .7s ease;
}

@keyframes trackSuccessPulse{
  0%{
    box-shadow: 0 0 0 rgba(57,211,83,0);
  }
  35%{
    box-shadow: 0 0 0 1px rgba(57,211,83,.18), 0 0 24px rgba(57,211,83,.14);
  }
  100%{
    box-shadow: 0 0 0 rgba(57,211,83,0);
  }
}

.quicktrackBox{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}

.quicktrackActions{
  display:flex;
  justify-content:flex-start;
}

.quicktrackChooser{
  margin-top:10px;
  padding:12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background: rgba(255,255,255,.03);
}

.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 rgba(255,255,255,.08);
  border-radius:14px;
  background: rgba(255,255,255,.03);
}

.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 rgba(255,255,255,.08);
}

.quicktrackSaveProductGrid{
  display:grid;
  grid-template-columns: minmax(0, 1.4fr) 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 1px rgba(57,211,83,.42),
    0 0 18px rgba(57,211,83,.22),
    0 6px 18px rgba(57,211,83,.16);
}

@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{
    min-height:42px;
  }

  .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;
}

.quicktrackProductsLoading{
  font-size:12px;
  font-weight:700;
  color: var(--muted);
  padding:2px 2px 0;
}

.quicktrackProductsGroup{
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background: rgba(255,255,255,.03);
  overflow:hidden;
}

.quicktrackFavoritesSection{
  border-color: rgba(255,210,74,.18);
  background: linear-gradient(180deg, rgba(255,210,74,.05), rgba(255,255,255,.03));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.quicktrackFavoritesSummary{
  color: rgba(255,244,210,.96);
  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: rgba(255,255,255,.03);
}

.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: rgba(255,210,74,.72);
  vertical-align:middle;
  box-shadow: 0 0 10px rgba(255,210,74,.18);
}

.quicktrackProductsGroup[open] .quicktrackProductsCategory::after{
  transform: rotate(180deg);
}

.quicktrackProductsList{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px 12px;
  border-top:1px solid rgba(255,255,255,.06);
}

.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 rgba(255,255,255,.08);
  border-radius:10px;
  background: rgba(255,255,255,.04);
  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(255,255,255,.07);
  border-color: rgba(var(--hl-blue-strong), .35);
}

.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 rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.88);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.quicktrackProductIconBtn:hover{
  background: rgba(255,255,255,.07);
  border-color: rgba(var(--hl-blue-strong), .35);
}

.quicktrackProductIconBtn svg{
  width:15px;
  height:15px;
  display:block;
}

.quicktrackProductFavoriteBtn{
  color: rgba(255,255,255,.45);
}

.quicktrackProductFavoriteBtn.is-active{
  color: #ffd24a;
  border-color: rgba(255,210,74,.38);
  background: rgba(255,210,74,.10);
}

.quicktrackProductFavoriteBtn:hover{
  color: #ffd24a;
}

.quicktrackProductEditBox{
  padding:10px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
  background: rgba(255,255,255,.03);
}

.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:rgba(255,255,255,0.04);
  cursor:pointer;
}

.qtProductItem:hover{
  background:rgba(255,255,255,0.08);
}

/* === BOOK STYLES ====*/

.bookRoot{
  color-scheme: dark;

  --frame-bg: #07080b;
  --panel-bg: #0c0f14;
  --card-bg: #111622;
  --card-2: #0f1420;
  --input-bg: #0b0f18;

  --line: rgba(255,255,255,.10);
  --line-2: rgba(255,255,255,.07);

  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.68);
  --muted-2: rgba(255,255,255,.50);

  --accent: #39d353;
  --danger: #ff4d4d;

  --hl-blue: 120, 170, 255;
  --hl-blue-strong: 0, 140, 255;

  --blue-line: rgba(74,168,255,.55);
  --blue-glow: rgba(74,168,255,.12);
}

html{ color-scheme: 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 rgba(255,255,255,.06);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.55);
}

.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 rgba(255,255,255,.08);
  border-radius:16px;
  padding:14px;
  box-shadow:
    0 26px 70px rgba(0,0,0,.55),
    0 10px 26px rgba(0,0,0,.35),
    inset 0 1px 0 rgba(255,255,255,.07);
}

.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 rgba(var(--hl-blue-strong), .35);
  box-shadow:
    0 20px 60px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.bookRoot .card.hero{
  position: relative;
  border: 1px solid rgba(var(--hl-blue-strong), .45);
  box-shadow:
    0 40px 120px rgba(0,0,0,.78),
    0 20px 60px rgba(0,0,0,.55),
    0 0 80px rgba(var(--hl-blue-strong), .28);
}

.bookRoot .card.hero::before{
  content:"";
  position:absolute;
  inset:-1px;
  border-radius:16px;
  pointer-events:none;
  background: linear-gradient(135deg, rgba(var(--hl-blue-strong), .35), rgba(var(--hl-blue-strong), 0) 40%);
  opacity:.55;
  mix-blend-mode: screen;
}

.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 rgba(var(--hl-blue-strong), .35);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow:
    0 18px 50px rgba(0,0,0,.45),
    0 0 34px rgba(var(--hl-blue-strong), .12),
    inset 0 1px 0 rgba(255,255,255,.06);
}

.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: rgba(255,255,255,.95);
  text-align:center;
  white-space:nowrap;
  text-shadow:
    0 0 8px rgba(var(--hl-blue-strong), .45),
    0 0 18px rgba(var(--hl-blue-strong), .35),
    0 0 40px rgba(var(--hl-blue-strong), .25),
    0 0 70px rgba(var(--hl-blue-strong), .18);
}

.bookRoot .topbarHelp{
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.88);
  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(var(--hl-blue-strong), .35);
  background: rgba(var(--hl-blue-strong), .10);
  color: rgba(255,255,255,.92);
  font-weight: 900;
  letter-spacing: .6px;
  box-shadow: 0 0 24px rgba(var(--hl-blue-strong), .12);
}

.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:
    0 0 14px rgba(var(--hl-blue-strong), .22),
    0 0 30px rgba(var(--hl-blue-strong), .14);
}

.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: rgba(255,255,255,.97);
  text-shadow:
    0 0 12px rgba(var(--hl-blue-strong), .20),
    0 0 28px rgba(var(--hl-blue-strong), .12);
}

.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 rgba(var(--hl-blue-strong), .30);
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: rgba(255,255,255,.03);
  box-shadow:
    0 0 0 1px rgba(74,168,255,.10) inset,
    0 14px 34px rgba(0,0,0,.35),
    0 0 26px var(--blue-glow);
}

.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 rgba(var(--hl-blue-strong), .22);
  background:
    linear-gradient(180deg, rgba(var(--hl-blue-strong), .10), rgba(255,255,255,.02)),
    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:
    inset 0 1px 0 rgba(255,255,255,.05),
    0 18px 50px rgba(0,0,0,.35);
}

.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 rgba(255,255,255,.06);
  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(255,255,255,.02);
}

.bookRoot .book-microGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

.bookRoot .book-microItem{
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 12px 12px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 28px rgba(0,0,0,.25);
  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: rgba(255,255,255,.97);
  text-shadow:
    0 0 12px rgba(var(--hl-blue-strong), .20),
    0 0 28px rgba(var(--hl-blue-strong), .12);
}

.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 rgba(var(--hl-blue-strong), .30);
  border-radius: 14px;
  padding: 12px 12px 10px;
  background: rgba(255,255,255,.03);
  box-shadow:
    0 0 0 1px rgba(74,168,255,.10) inset,
    0 14px 34px rgba(0,0,0,.35),
    0 0 26px var(--blue-glow);
}

.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 rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 28px rgba(0,0,0,.25);
}

.bookRoot .book-quickNavGrid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:10px;
}

.bookRoot .book-quickNavItem{
  border: 1px solid rgba(var(--hl-blue-strong), .22);
  background: rgba(var(--hl-blue-strong), .08);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 28px rgba(0,0,0,.25);
}

.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 rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  font-size:16px;
  font-weight:800;
  cursor:pointer;
  transition: all .15s ease;
}

.bookRoot .book-actionIconBtn:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.18);
}

.bookRoot .book-actionIconBtn.primary{
  border: 1px solid rgba(var(--hl-blue-strong), .35);
  background: rgba(var(--hl-blue-strong), .12);
  color: #fff;
  box-shadow: 0 0 18px rgba(var(--hl-blue-strong), .25);
}

.bookRoot .book-actionIconBtn.primary:hover{
  background: rgba(var(--hl-blue-strong), .18);
}

.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: rgba(255,255,255,.04);
  border:1px solid rgba(var(--hl-blue-strong), .35);
  color: rgba(255,255,255,.85);
  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: rgba(var(--hl-blue-strong), .08);
  border-color: rgba(var(--hl-blue-strong), .6);
  color:#fff;
}

.bookRoot .book-btnRecipeAction:focus{
  outline:none;
  box-shadow:none;
}

.bookRoot .book-btnRecipeAction:focus-visible{
  outline:none;
  box-shadow:
    0 0 0 1px rgba(var(--hl-blue-strong), .45),
    0 0 18px rgba(var(--hl-blue-strong), .14);
}

.macroStarterCalc{
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
}

.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:rgba(255,255,255,.03);
}

.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 rgba(255,255,255,.06);
}

.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;
}

.macroStarterCalcResultGrid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:10px;
}

.macroStarterCalcResultItem{
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
  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-primary);
}

.tocItem {
  font-size: 14px;
  color: var(--text-secondary);
}

.tocSub {
  font-size: 14px;
  color: var(--text-secondary);
  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 rgba(255,255,255,.14);
  background: rgba(255,255,255,.03);
  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(var(--hl-blue-strong), .22);
  background: rgba(var(--hl-blue-strong), .08);
  border-radius: 14px;
  padding: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.04),
    0 12px 28px rgba(0,0,0,.25);
}

.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;
  }
}