/* ---------- Local Font Setup ----------
   Google Fonts werden NICHT mehr extern geladen.
   Optional lokale Dateien:
   /assets/fonts/Manrope.woff2
   /assets/fonts/Fraunces.woff2
   Wenn sie fehlen, nutzt der Browser automatisch die Fallbacks.
*/
@font-face {
  font-family: 'Manrope Local';
  src: url('./assets/fonts/Manrope-Regular.ttf') format('truetype');
  font-weight: 500 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fraunces Local';
  src: url('./assets/fonts/Manrope-Bold.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* =========================================================
   KetoFlow — calm, premium health UI
   ========================================================= */

:root {
  /* palette — warm "freud.ai" cream / olive / mocha */
  --bg:        #B9B0A6;
  --surface:   #F4EEE3;
  --card:      #FCF8F1;
  --card-2:    #F1E9DC;

  --primary:   #94704E;
  --primary-600:#7E5E40;
  --primary-soft:#EFE3D6;

  --ink:       #3C342B;
  --ink-2:     #5C5346;
  --muted:     #9B9082;
  --line:      #ECE3D6;

  --green:     #6F8F4E;
  --green-soft:#E8EEDB;
  --amber:     #D98E2B;
  --amber-soft:#F8ECD6;
  --red:       #C75B4A;
  --red-soft:  #F4E0DB;

  /* shape */
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 12px;
  --pill: 999px;

  --shadow-soft: 0 10px 30px -12px rgba(74,57,40,.20);
  --shadow-card: 0 4px 18px -8px rgba(74,57,40,.18);
  --shadow-pop:  0 24px 60px -18px rgba(74,57,40,.42);

  --ff-display: 'Fraunces Local', "Georgia", "Times New Roman", serif;
  --ff-body:    'Manrope Local', system-ui, -apple-system, sans-serif;

  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--ff-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 70% -10%, #EFE6D7 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 110%, #E9DFCD 0%, transparent 55%),
    var(--bg);
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ---------- App shell ---------- */
.app {
  position: relative;
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 600px) {
  body { padding: 28px 0; align-items: flex-start; }
  .app {
    min-height: auto;
    height: calc(100dvh - 56px);
    border-radius: 42px;
    box-shadow: var(--shadow-pop);
    border: 10px solid #3C342B;
    outline: 2px solid #5C5346;
  }
}

/* scroll region */
.scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 20px 120px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.scroll::-webkit-scrollbar { width: 0; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 22px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, var(--surface) 72%, transparent);
  backdrop-filter: blur(2px);
}
.topbar .eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.topbar h1 {
  font-family: var(--ff-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-top: 2px;
	  color: #000;
}
.topbar .avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--primary));
  color: #fff;
  display: grid; place-items: center;
  font-family: var(--ff-display);
  font-weight: 800;
  box-shadow: var(--shadow-card);
  flex: none;
}

/* ---------- Screens ---------- */
.screen { display: none; }
.screen.is-active { display: block; }
.screen.is-active .reveal {
  animation: fadeUp .55s cubic-bezier(.22,.7,.25,1) both;
}
.reveal:nth-child(1){animation-delay:.02s}
.reveal:nth-child(2){animation-delay:.07s}
.reveal:nth-child(3){animation-delay:.12s}
.reveal:nth-child(4){animation-delay:.17s}
.reveal:nth-child(5){animation-delay:.22s}
.reveal:nth-child(6){animation-delay:.27s}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255,255,255,.6);
}
.card + .card { margin-top: 16px; }
.card-title {
  font-family: var(--ff-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-label {
  font-family: var(--ff-display);
  font-size: 18px; font-weight: 600; letter-spacing: -.01em;
  text-transform: none; color: var(--ink);
  margin: 26px 4px 14px;
}

/* ---------- Macro ring grid ---------- */
.macro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.macro {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 14px;
  border: 1px solid rgba(255,255,255,.7);
}
.ring { width: 62px; height: 62px; flex: none; }
.ring circle { fill: none; stroke-linecap: round; }
.ring .track { stroke: var(--line); }
.ring .bar { transition: stroke-dashoffset .9s cubic-bezier(.22,.7,.25,1); }
.ring text {
  font-family: var(--ff-display);
  font-weight: 800;
  fill: var(--ink);
}
.macro-meta .v {
  font-family: var(--ff-display);
  font-weight: 800; font-size: 17px; letter-spacing: -.02em;
}
.macro-meta .v small { color: var(--muted); font-weight: 700; font-size: 12px; }
.macro-meta .k { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 1px; }

/* hero calories */
.hero {
  background: linear-gradient(140deg, #9A7452, #7E5E40 60%, #6B4F37);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 22px;
  box-shadow: 0 18px 40px -16px rgba(31,107,234,.6);
  position: relative; overflow: hidden;
}
.hero::after {
  content:""; position:absolute; right:-40px; top:-50px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.12);
}
.hero::before {
  content:""; position:absolute; right: 30px; bottom:-60px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero .label { font-size: 13px; opacity: .9; font-weight: 700; }
.hero .big {
  font-family: var(--ff-display);
  font-size: 40px; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.05; margin: 6px 0 2px;
}
.hero .big small { font-size: 16px; opacity: .85; font-weight: 700; }
.hero .sub { font-size: 13px; opacity: .92; position: relative; z-index: 2; }
.hero .barwrap {
  margin-top: 14px; height: 10px; border-radius: 999px;
  background: rgba(255,255,255,.25); overflow: hidden; position: relative; z-index: 2;
}
.hero .barwrap > i {
  display: block; height: 100%; border-radius: 999px;
  background: #fff; transition: width .9s cubic-bezier(.22,.7,.25,1);
}

/* ---------- Ketosis status card ---------- */
.ketose {
  border-radius: var(--r-xl);
  padding: 20px;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--line);
  position: relative; overflow: hidden;
}
.ketose.green  { background: var(--green-soft); border-color: #BFEBCF; }
.ketose.yellow { background: var(--amber-soft); border-color: #F4DFAE; }
.ketose.red    { background: var(--red-soft);   border-color: #F6C7C1; }
.ketose .head { display: flex; align-items: center; gap: 12px; }
.dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 5px rgba(255,255,255,.6);
}
.green  .dot { background: var(--green); }
.yellow .dot { background: var(--amber); }
.red    .dot { background: var(--red); }
.pulse { animation: pulse 2s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22,163,74,.5); }
  70%  { box-shadow: 0 0 0 12px rgba(22,163,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); }
}
.yellow .pulse { animation-name: pulseY; }
.red .pulse { animation-name: pulseR; }
@keyframes pulseY {0%{box-shadow:0 0 0 0 rgba(224,146,11,.5)}70%{box-shadow:0 0 0 12px rgba(224,146,11,0)}100%{box-shadow:0 0 0 0 rgba(224,146,11,0)}}
@keyframes pulseR {0%{box-shadow:0 0 0 0 rgba(226,72,59,.5)}70%{box-shadow:0 0 0 12px rgba(226,72,59,0)}100%{box-shadow:0 0 0 0 rgba(226,72,59,0)}}
.ketose .status-label {
  font-family: var(--ff-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em;
}
.green  .status-label { color: #5C7A3C; }
.yellow .status-label { color: #9A6404; }
.red    .status-label { color: #B0503F; }
.ketose .desc { font-size: 14px; color: var(--ink-2); margin-top: 10px; line-height: 1.5; }
.ketose .carbs-line {
  margin-top: 14px; font-weight: 800; font-family: var(--ff-display);
  font-size: 15px; display: flex; align-items: center; gap: 8px;
}
.mini-block {
  margin-top: 14px; background: rgba(255,255,255,.6);
  border-radius: var(--r-md); padding: 12px 14px;
}
.mini-block .t { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); opacity: .8; }
.mini-block .c { font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  font-size: 12px; font-weight: 700; padding: 5px 11px;
  border-radius: var(--pill); background: rgba(255,255,255,.85); color: var(--ink-2);
}

/* ---------- Keto score gauge ---------- */
.score-card { display: flex; align-items: center; gap: 18px; }
.gauge { width: 96px; height: 96px; flex: none; position: relative; }
.gauge .val {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--ff-display); font-weight: 800; font-size: 28px; letter-spacing: -.03em;
}
.gauge .val small { font-size: 12px; color: var(--muted); display: block; text-align: center; font-weight: 700; }
.score-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

/* ---------- Gamification ---------- */
.xp-card { background: linear-gradient(135deg, #4A3D2F, #5E4A37); color: #fff; }
.xp-card .card-title { color: #fff; }
.xp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.level-badge {
  font-family: var(--ff-display); font-weight: 800; font-size: 15px;
  background: rgba(255,255,255,.14); padding: 7px 14px; border-radius: var(--pill);
}
.xp-bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.18); margin: 14px 0 8px; overflow: hidden; }
.xp-bar > i { display:block; height:100%; border-radius:999px; background: linear-gradient(90deg,#8FA86A,#B9CE92); transition: width .9s ease; }
.xp-note { font-size: 12.5px; opacity: .82; line-height: 1.5; }
.xp-meta { font-size: 13px; opacity: .9; font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--ff-body); font-weight: 800; font-size: 15.5px;
  border-radius: var(--pill); padding: 15px 20px;
  width: 100%; transition: transform .12s ease, box-shadow .2s ease, background .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { transform: scale(.975); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  color: #fff; box-shadow: 0 12px 26px -12px rgba(124,94,64,.6);
}
.btn-ghost { background: var(--primary-soft); color: var(--primary-600); }
.btn-soft { background: var(--card-2); color: var(--ink-2); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { width: auto; flex: 1; }



/* ------ Card-Buttons -------*/

.water-card .btn-primary{
  background: linear-gradient(135deg, #228fb5, #228fb5);
}


.water-card .pbar i{
background: #228fb5!important;
}

/* ---------- Inputs ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block; font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 7px; padding-left: 4px;
}
.input, select.input, textarea.input {
  width: 100%; font-family: var(--ff-body); font-size: 16px; font-weight: 600;
  color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; transition: border-color .2s, box-shadow .2s;
}
.input:focus, select.input:focus, textarea.input:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
textarea.input { resize: vertical; min-height: 60px; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2376839B' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px;
}
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* segmented choices (onboarding pills) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  flex: 1 1 auto; min-width: calc(33% - 8px);
  text-align: center; padding: 12px 10px; border-radius: var(--r-md);
  background: var(--card); border: 1.5px solid var(--line);
  font-weight: 700; font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  transition: all .18s;
}
.choice.sel {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600);
  box-shadow: 0 0 0 3px rgba(148,112,78,.12);
}
.choice.wide {
  min-width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  text-align: left; padding: 17px 18px; border-radius: var(--r-lg); font-size: 15.5px; font-weight: 700;
}
.choice.wide .cw-label { flex: 1; }
.choice.wide .cw-check {
  flex: none; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); display: grid; place-items: center; transition: .18s;
}
.choice.wide.sel { box-shadow: none; }
.choice.wide.sel .cw-check { background: var(--green); border-color: var(--green); }
.choice.wide.sel .cw-check::after {
  content: ""; width: 6px; height: 11px; border: 2px solid #fff; border-top: 0; border-left: 0;
  transform: rotate(45deg); margin-top: -2px;
}

/* ---------- Search ---------- */
.searchbar {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--pill); padding: 4px 6px 4px 16px;
  box-shadow: var(--shadow-card);
}
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.searchbar svg { color: var(--muted); flex: none; }
.searchbar input {
  border: 0; outline: 0; flex: 1; font-size: 16px; font-weight: 600; background: transparent; color: var(--ink);
  padding: 12px 0;
}
.searchbar .clear {
  border: 0; background: var(--card-2); color: var(--muted);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: none;
}

.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 9px 16px; border-radius: var(--pill);
  background: var(--card); border: 1.5px solid var(--line);
  font-weight: 800; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap;
  transition: all .18s;
}
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.hint {
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 40px 24px; line-height: 1.5;
}
.hint .ico { font-size: 30px; display: block; margin-bottom: 10px; opacity: .6; }

/* food result */
.food {
  background: var(--card); border-radius: var(--r-lg); padding: 16px;
  box-shadow: var(--shadow-card); border: 1px solid rgba(255,255,255,.7);
  margin-bottom: 12px; cursor: pointer; transition: transform .12s, box-shadow .2s;
}
.food:active { transform: scale(.99); }
.food.open { box-shadow: var(--shadow-soft); }
.food-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.food-name { font-family: var(--ff-display); font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.food-cat { color: var(--muted); font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.badge {
  flex: none; font-size: 11.5px; font-weight: 800; padding: 6px 11px; border-radius: var(--pill);
  display: inline-flex; align-items: center; gap: 5px;
}
.badge::before { content:""; width: 7px; height: 7px; border-radius: 50%; }
.badge.green  { background: var(--green-soft); color: #0E7A38; }
.badge.green::before  { background: var(--green); }
.badge.yellow { background: var(--amber-soft); color: #9A6404; }
.badge.yellow::before { background: var(--amber); }
.badge.red    { background: var(--red-soft); color: #B6362B; }
.badge.red::before    { background: var(--red); }

.macros-line { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.macros-line .m { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.macros-line .m b { color: var(--ink); font-family: var(--ff-display); font-weight: 800; font-size: 14px; }
.food .reason {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.5;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.food .adder { margin-top: 12px; display: none; }
.food.open .adder { display: block; animation: fadeUp .3s ease both; }
.adder .row { display: flex; gap: 10px; align-items: center; }
.adder .row .input { flex: 1; }

/* list entry (track) */
.entry {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--r-md); padding: 13px 14px;
  box-shadow: var(--shadow-card); margin-bottom: 10px; border: 1px solid rgba(255,255,255,.7);
}
.entry .swatch { width: 10px; height: 40px; border-radius: 6px; flex: none; }
.entry .swatch.green { background: var(--green); }
.entry .swatch.yellow { background: var(--amber); }
.entry .swatch.red { background: var(--red); }
.entry .info { flex: 1; min-width: 0; }
.entry .nm { font-weight: 800; font-size: 14.5px; font-family: var(--ff-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry .sm { color: var(--muted); font-size: 12px; font-weight: 700; margin-top: 2px; }
.entry .kc { text-align: right; font-family: var(--ff-display); font-weight: 800; font-size: 14px; flex: none; }
.entry .kc small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.entry .del {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; flex: none; font-size: 17px;
}
.entry .del:active { background: var(--red-soft); color: var(--red); }
.meal-group + .meal-group { margin-top: 16px; }
.meal-h { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }

/* total bar */
.totalbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--ink); color: #fff; border-radius: var(--r-lg);
  padding: 16px 20px; margin-bottom: 16px;
}
.totalbar .l { font-size: 13px; opacity: .85; font-weight: 700; }
.totalbar .r { font-family: var(--ff-display); font-weight: 800; font-size: 18px; }
.totalbar .r small { opacity: .7; font-weight: 700; font-size: 13px; }

/* info accordion blocks */
.info-block { margin-bottom: 14px; }
.info-block .ib-h { font-family: var(--ff-display); font-weight: 800; font-size: 15px; }
.info-block p { color: var(--ink-2); font-size: 14px; line-height: 1.55; margin-top: 6px; }
.legend { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.legend .li { display: flex; gap: 10px; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.legend .li .d { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 3px; }
.disclaimer { font-size: 12.5px; color: var(--muted); line-height: 1.5; text-align: center; padding: 8px 6px; }

/* ---------- Onboarding ---------- */
.onb { min-height: 100dvh; display: flex; flex-direction: column; padding: 0 22px; }
.onb-hero {
  padding: 30px 0 18px; text-align: left;
}
.onb-hero .logo {
  width: 56px; height: 56px; border-radius: 18px; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--green), var(--primary));
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-card);
}
.onb-hero h1 { font-family: var(--ff-display); font-size: 31px; font-weight: 600; letter-spacing: -.02em; line-height: 1.12; }
.onb-hero p { color: var(--muted); font-size: 15px; margin-top: 8px; }
.progress-dots { display: flex; gap: 6px; margin: 18px 0 22px; }
.progress-dots i { height: 5px; flex: 1; border-radius: 999px; background: var(--line); transition: background .3s; }
.progress-dots i.on { background: var(--primary); }
.onb-body { flex: 1; }
.onb-step { display: none; }
.onb-step.is-active { display: block; animation: fadeUp .4s ease both; }
.onb-step .q { font-family: var(--ff-display); font-weight: 600; font-size: 27px; margin-bottom: 6px; letter-spacing: -.02em; line-height: 1.15; }
.onb-step .qs { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.onb-foot { padding: 16px 0 calc(20px + var(--safe-bottom)); }

/* ---------- Bottom nav ---------- */
/* ---------- Bottom nav (floating pill) ---------- */
.tabbar {
  position: absolute;
  left: 14px; right: 14px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 2px;
  height: 64px;
  padding: 6px 6px;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--pill);
  box-shadow: var(--shadow-pop);
}
.tabbar.hidden { display: none; }
.tabbtn {
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-weight: 800; font-size: 10.5px; padding: 0px 0px;
  transition: color .2s; flex: 1;
}
.tabbtn svg { width: 23px; height: 23px; transition: transform .2s; }
.tabbtn .ic { display: grid; place-items: center; width: 44px; height: 30px; border-radius: var(--pill); transition: background .2s; }
.tabbtn.active { color: var(--primary-600); }
.tabbtn.active .ic { background: var(--primary-soft); }
.tabbtn.active svg { transform: translateY(-1px); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: 96px; z-index: 80;
  display: flex; justify-content: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: var(--pill);
  font-weight: 800; font-size: 14px; box-shadow: var(--shadow-pop);
  display: flex; align-items: center; gap: 9px;
  transform: translateY(30px); opacity: 0; transition: all .35s cubic-bezier(.22,.9,.3,1);
  max-width: 90%;
}
.toast.show { transform: none; opacity: 1; }
.toast .ic { color: #A6C57A; display: grid; place-items: center; }

/* ---------- Confirm sheet ---------- */
.sheet-backdrop {
  position: absolute; inset: 0; z-index: 60; background: rgba(15,28,51,.42);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 61;
  background: var(--card); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 22px 22px calc(22px + var(--safe-bottom));
  transform: translateY(110%); transition: transform .38s cubic-bezier(.22,.8,.3,1);
  box-shadow: var(--shadow-pop);
}
.sheet.show { transform: none; }
.sheet .grip { width: 42px; height: 5px; border-radius: 999px; background: var(--line); margin: 0 auto 16px; }
.sheet h3 { font-family: var(--ff-display); font-weight: 800; font-size: 18px; text-align: center; }
.sheet .sheet-sub { color: var(--muted); font-size: 14px; text-align: center; margin: 6px 0 18px; }
.sheet .added-badge {
  width: 56px; height: 56px; border-radius: 50%; background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; margin: 0 auto 14px;
}

/* language switch */
.lang-switch { display: inline-flex; background: var(--card-2); border-radius: var(--pill); padding: 4px; gap: 4px; }
.lang-switch button {
  border: 0; background: transparent; cursor: pointer; font-weight: 800; font-size: 13px;
  padding: 8px 16px; border-radius: var(--pill); color: var(--muted);
}
.lang-switch button.on { background: var(--card); color: var(--primary-600); box-shadow: var(--shadow-card); }

/* targets table */
.targets-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.target-cell { background: var(--card-2); border-radius: var(--r-md); padding: 12px 14px; }
.target-cell .tv { font-family: var(--ff-display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.target-cell .tk { color: var(--muted); font-size: 12px; font-weight: 700; }

.data-row { display: flex; justify-content: space-between; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.data-row:last-child { border-bottom: 0; }
.data-row .dk { color: var(--muted); font-weight: 700; }
.data-row .dv { font-weight: 800; }

.weight-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); }
.weight-row .wd { color: var(--muted); font-size: 13px; font-weight: 700; }
.weight-row .ww { font-family: var(--ff-display); font-weight: 800; font-size: 16px; }
.weight-row .wn { color: var(--muted); font-size: 12px; }

.placeholder-img {
  width: 100%; border-radius: var(--r-lg); display: block; box-shadow: var(--shadow-card);
}

/* ---------- Utilities added for shell/onboarding ---------- */
.hidden { display: none !important; }
@keyframes shake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }
.shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; }
.avatar { cursor: pointer; border: 0; }

/* ---------- Weight chart + stats ---------- */
.wchart { display: block; margin: 4px 0 2px; overflow: visible; }
.wstats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 10px; }
.wstats .cell { background: var(--card-2); border-radius: var(--r-md); padding: 10px 12px; text-align: center; }
.wstats .cv { font-family: var(--ff-display); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.wstats .ck { color: var(--muted); font-size: 11px; font-weight: 700; margin-top: 2px; }
.wstats .cell.goal .cv { color: var(--green); }
.wstats .cell.cur .cv { color: var(--primary-600); }
.wtrend { text-align: center; font-size: 12.5px; font-weight: 800; color: var(--muted); margin-top: 12px; }
.wtrend.down { color: var(--green); }
.wtrend.up { color: var(--red); }

/* ---------- Day navigation (Track) ---------- */
.day-nav {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--pill);
  padding: 6px; margin-bottom: 14px; box-shadow: var(--shadow-card);
}
.day-nav button {
  width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--card-2);
  color: var(--ink-2); cursor: pointer; display: grid; place-items: center; flex: none;
}
.day-nav button svg { width: 20px; height: 20px; }
.day-nav button:disabled { opacity: .32; cursor: default; }
.day-nav .day-label { font-family: var(--ff-display); font-weight: 800; font-size: 15px; text-align: center; }
.day-nav .day-label small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; font-family: var(--ff-body); }

/* entry edit affordance */
.entry .acts { display: flex; gap: 4px; flex: none; }
.entry .edit {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
}
.entry .edit:active { background: var(--card-2); }

/* ---------- Search: per-tab counts + keto suggestions ---------- */
.tab { display: inline-flex; align-items: center; gap: 7px; }
.tab .tab-count {
  font-size: 11px; font-weight: 800; line-height: 1;
  padding: 3px 7px; border-radius: var(--pill);
  background: var(--card-2); color: var(--muted);
}
.tab.active .tab-count { background: rgba(255,255,255,.28); color: #fff; }
.suggest-label { display: flex; align-items: center; color: var(--primary-600); }

/* ---------- 6-tab fit ---------- */
.tabbtn span { font-size: 10px; }

/* ---------- Mood: check-in faces ---------- */
.mood-faces { display: grid; grid-template-columns: repeat(5,1fr); gap: 6px; margin-top: 14px; }
.mface-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1.5px solid transparent; background: transparent; border-radius: var(--r-md);
  padding: 8px 2px; cursor: pointer; transition: .15s;
}
.mface-btn span { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.1; }
.mface-btn .mface { opacity: .55; transition: .15s; transform: scale(.92); }
.mface-btn.sel { border-color: var(--primary); background: var(--primary-soft); }
.mface-btn.sel .mface { opacity: 1; transform: scale(1); }
.mface-btn.sel span { color: var(--primary-600); }
.mood-faces.shake { animation: shake .45s; }

/* chips (scoped so home critical chips stay unaffected) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips .chip {
  border: 1.5px solid var(--line); background: var(--card-2); color: var(--ink-2);
  border-radius: var(--pill); padding: 8px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: .15s;
}
.chips .chip.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); }

.logged-note { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--green); font-size: 12.5px; font-weight: 800; margin-top: 12px; }
.logged-note svg { width: 16px; height: 16px; }

/* insight card */
.insight { border-left: 4px solid var(--muted); }
.insight.good { border-left-color: var(--green); }
.insight.watch { border-left-color: var(--amber); }
.insight.concern { border-left-color: var(--red); }
.insight-h { display: flex; align-items: center; font-family: var(--ff-display); font-weight: 800; font-size: 15.5px; }
.insight.good .insight-h { color: var(--green); }
.insight.watch .insight-h { color: var(--amber); }
.insight.concern .insight-h { color: var(--red); }
.insight-t { margin-top: 8px; color: var(--ink-2); font-size: 13.5px; line-height: 1.5; }

/* 14-day strip */
.mood-strip { display: grid; grid-template-columns: repeat(14,1fr); gap: 4px; }
.strip-cell { display: grid; place-items: center; }
.strip-empty { display: block; width: 16px; height: 16px; border-radius: 50%; border: 2px dashed var(--line); }

/* mood history rows */
.mood-row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--line); }
.mood-row:last-child { border-bottom: 0; }
.mood-row .info { flex: 1; }
.mood-row .nm { font-weight: 700; }
.mood-row .sm { color: var(--muted); font-size: 12px; margin-top: 2px; }
.mood-row .wd { color: var(--muted); font-size: 12px; font-weight: 700; }

/* mood prompt on home */
.mood-prompt { display: flex; align-items: center; gap: 14px; }
.mood-prompt .mp-text { flex: 1; }
.mood-prompt.done { cursor: pointer; }

/* tips */
.tip-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tip-row:last-child { border-bottom: 0; }
.tip-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.tip-t { font-weight: 800; font-size: 14px; }
.tip-d { color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.45; }

/* ---------- BMI ---------- */
.bmi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.bmi-val { font-family: var(--ff-display); font-weight: 800; font-size: 34px; letter-spacing: -.02em; line-height: 1; }
.bmi-badge { font-size: 12px; font-weight: 800; padding: 7px 13px; border-radius: var(--pill); }
.bmi-badge.green { background: var(--green-soft); color: var(--green); }
.bmi-badge.amber { background: var(--amber-soft); color: var(--amber); }
.bmi-badge.red { background: var(--red-soft); color: var(--red); }
.bmi-scale { position: relative; margin: 26px 0 4px; }
.bmi-track { display: flex; height: 10px; border-radius: var(--pill); overflow: hidden; }
.bmi-track .seg.under { background: #C9B79A; }
.bmi-track .seg.normal { background: var(--green); }
.bmi-track .seg.over { background: var(--amber); }
.bmi-track .seg.obese { background: var(--red); }
.bmi-marker { position: absolute; top: -7px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; }
.bmi-marker::after { content: ""; width: 3px; height: 22px; background: var(--ink); border-radius: 2px; }
.bmi-marker-val { position: absolute; top: -18px; font-size: 11px; font-weight: 800; color: var(--ink); white-space: nowrap; }
.bmi-ticks { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 10px; font-weight: 700; }

/* ---------- Mood: tinted hero band (freud-style) ---------- */
.mood-hero {
  border-radius: var(--r-lg); padding: 26px 18px 22px; text-align: center;
  margin-bottom: 16px; transition: background .3s ease;
  background: var(--card-2);
}
.mood-hero .mh-face svg { width: 92px; height: 92px; }
.mood-hero .mh-eyebrow { font-size: 12px; font-weight: 800; color: var(--ink-2); opacity: .65; margin-top: 12px; }
.mood-hero .mh-big { font-family: var(--ff-display); font-size: 26px; font-weight: 600; margin-top: 2px; color: var(--ink); letter-spacing: -.01em; }
.mood-hero.m0 .mh-face svg { opacity: .4; }
.mood-hero.m0 .mh-big { margin-top: 12px; }
.mood-hero.m1 { background: var(--red-soft); }
.mood-hero.m2 { background: var(--amber-soft); }
.mood-hero.m3 { background: var(--card-2); }
.mood-hero.m4 { background: var(--green-soft); }
.mood-hero.m5 { background: var(--green-soft); }

/* ---------- Generic progress bar ---------- */
.pbar { height: 12px; border-radius: var(--pill); background: var(--card-2); overflow: hidden; margin: 4px 0 2px; }
.pbar > i { display: block; height: 100%; border-radius: var(--pill); transition: width .7s cubic-bezier(.22,.7,.25,1); }

/* ---------- Big score ring (freud result) ---------- */
.score-hero { text-align: center; padding: 24px 20px; }
.score-ring { position: relative; width: 150px; height: 150px; margin: 0 auto 6px; }
.score-ring svg { width: 100%; height: 100%; }
.sr-center { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; }
.sr-num { font-family: var(--ff-display); font-weight: 600; font-size: 46px; line-height: 1; color: var(--ink); }
.sr-of { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.sh-title { font-family: var(--ff-display); font-size: 18px; font-weight: 600; margin-top: 8px; }
.sh-text { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-top: 6px; }

/* ---------- Water + fasting ---------- */
.wc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.wc-val { font-family: var(--ff-display); font-weight: 600; font-size: 22px; }
.wc-val small { font-size: 13px; color: var(--muted); font-family: var(--ff-body); font-weight: 700; }
.wc-sub { color: var(--muted); font-size: 12.5px; font-weight: 700; margin-top: 6px; }
.wc-btns { display: flex; gap: 10px; margin-top: 14px; }
.wc-btns #wMinus { width: 60px; flex: none; }
.wc-btns #wPlus { flex: 1; }
.fast-time { font-family: var(--ff-display); font-weight: 600; font-size: 34px; margin: 6px 0 2px; letter-spacing: -.01em; }
.fast-sub { color: var(--muted); font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }

/* ---------- Weekly review ---------- */
.week-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 14px; }
.week-grid .wk { background: var(--card-2); border-radius: var(--r-md); padding: 12px 6px; text-align: center; }
.week-grid .wk-v { font-family: var(--ff-display); font-weight: 600; font-size: 19px; letter-spacing: -.02em; }
.week-grid .wk-v small { font-size: 12px; color: var(--muted); }
.week-grid .wk-k { color: var(--muted); font-size: 10.5px; font-weight: 700; margin-top: 3px; line-height: 1.2; }

/* ---------- Reminder banner ---------- */
.reminder-banner {
  background: var(--primary-soft); border: 1.5px solid var(--primary);
  border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 14px;
}
.reminder-banner span { font-weight: 700; color: var(--primary-600); font-size: 14px; }
.rb-btns { display: flex; gap: 8px; margin-top: 12px; }

/* ---------- Search presets ---------- */
.presets { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.preset {
  border: 1.5px solid var(--line); background: var(--card-2); color: var(--ink-2);
  border-radius: var(--pill); padding: 8px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px; transition: .15s;
}
.preset small { color: var(--muted); font-size: 10.5px; }
.preset.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-600); }
.preset.on small { color: var(--primary-600); }

/* ---------- Settings ---------- */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.set-k { font-weight: 700; font-size: 14px; }
.set-input { width: 120px; padding: 10px 12px; text-align: right; }
.switch { position: relative; display: inline-block; width: 50px; height: 28px; flex: none; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: var(--line); border-radius: var(--pill); transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ---------- Mood calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-title { font-family: var(--ff-display); font-weight: 600; font-size: 17px; }
.cal-nav { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--card-2); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.cal-nav svg { width: 18px; height: 18px; }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.cal-wd { margin-bottom: 4px; }
.cal-wd-c { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--muted); padding: 4px 0; }
.cal-cell { position: relative; aspect-ratio: 1; border: 0; background: transparent; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-2); }
.cal-cell.empty { visibility: hidden; }
.cal-cell.has { background: var(--card-2); }
.cal-cell.future { opacity: .32; cursor: default; }
.cal-num { font-size: 12px; font-weight: 700; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; }
.cal-hint { text-align: center; color: var(--muted); font-size: 11.5px; font-weight: 700; margin-top: 12px; }

/* ---------- Warm dark mode ---------- */
html[data-theme="dark"] {
  --bg: #211D18; --surface: #1C1915; --card: #2A2620; --card-2: #332E27;
  --primary: #B58A63; --primary-600: #C9A079; --primary-soft: #3A322A;
  --ink: #F1EADF; --ink-2: #CBC2B4; --muted: #998F80; --line: #3A352D;
  --green: #93B26C; --green-soft: #2C331F; --amber: #E0A24A; --amber-soft: #3A301E; --red: #DB7860; --red-soft: #3A271F;
  --shadow-soft: 0 10px 30px -12px rgba(0,0,0,.5);
  --shadow-card: 0 4px 18px -8px rgba(0,0,0,.45);
  --shadow-pop: 0 24px 60px -18px rgba(0,0,0,.7);
}
html[data-theme="dark"] .card { border-color: rgba(255,255,255,.04); }
html[data-theme="dark"] .switch .slider::before { background: #E8E1D4; }
html[data-theme="dark"] .green .status-label { color: #A7C77E; }
html[data-theme="dark"] .red .status-label { color: #E08A72; }

/* ---------- Fasting card (plan picker + live ring) ---------- */
.fast-plan { font-size: 12px; font-weight: 800; padding: 6px 12px; border-radius: var(--pill); background: var(--primary-soft); color: var(--primary-600); }
.fast-card .score-ring { margin-top: 6px; }
.fast-count { font-family: var(--ff-display); font-weight: 600; font-size: 30px; letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.fast-of { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 2px; }
.fast-eat-line { text-align: center; color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 2px; }  
.fast-card[data-phase="eating"] .fast-plan { background: var(--green-soft); color: var(--green); }

.build-tag { text-align:center; color: var(--muted); font-size: 11px; font-weight:700; margin: 18px 4px calc(20px + var(--safe-bottom)); opacity:.8; }

/* ---------- Profi patch: coach, pro gates, smart search ---------- */
.coach-card { border: 1px solid var(--line); }
.coach-card.green { background: linear-gradient(180deg, var(--card), var(--green-soft)); }
.coach-card.yellow { background: linear-gradient(180deg, var(--card), var(--amber-soft)); }
.coach-card.red { background: linear-gradient(180deg, var(--card), var(--red-soft)); }
.coach-list { display:grid; gap:8px; margin-top:12px; }
.coach-item { padding:10px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.54); color: var(--ink-2); font-size:13px; line-height:1.35; }
.food-actions { display:flex; gap:8px; align-items:center; }
.favBtn { width:34px; height:34px; border:1px solid var(--line); border-radius:50%; background:var(--card-2); color:var(--muted); font-size:18px; display:grid; place-items:center; padding:0; box-shadow:none; }
.favBtn.on { background:var(--primary-soft); color:var(--primary); border-color:var(--primary-soft); }
.portion-note { margin-top:10px; padding:10px 12px; border-radius:var(--r-md); font-size:12px; line-height:1.35; font-weight:700; }
.portion-note.green { background:var(--green-soft); color:var(--green); }
.portion-note.yellow { background:var(--amber-soft); color:var(--amber); }
.portion-note.red { background:var(--red-soft); color:var(--red); }
.pro-card { position:relative; border:1px dashed color-mix(in srgb, var(--primary) 50%, var(--line)); background:linear-gradient(180deg, var(--card), var(--primary-soft)); }

.pro-pill,.pro-lock { display:inline-flex; 
align-items:center; 
justify-content:center; 
border-radius:var(--pill); 
padding:6px 10px; 
background:var(--ink)!important; 
color:var(--card); 
font-weight:900; 
font-size:11px; 
letter-spacing:.08em; 
margin-bottom:10px; 
    
}

.pro-lock { width:max-content; }
.check-row { display:flex; align-items:center; gap:10px; margin-top:10px; font-weight:800; color:var(--ink-2); }
.check-row input { width:18px; height:18px; accent-color:var(--primary); }


/* ---------- Final Product Patch ---------- */
.mission-card {
  background: linear-gradient(180deg, var(--card), var(--primary-soft));
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--line));
}
.product-card .pc-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.plan-current {
  flex:0 0 auto;
  padding:7px 10px;
  border-radius:var(--pill);
  font-size:11px;
  font-weight:900;
  letter-spacing:.02em;
  background:var(--card-2);
  color:var(--muted);
}
.plan-current.pro { background:var(--green-soft); color:var(--green); }
.plan-current.free { background:var(--amber-soft); color:var(--amber); }
.plan-list { display:grid; gap:10px; margin-top:14px; }

.plan-badge {
  flex:0 0 auto;
  padding:4px 8px;
  border-radius:var(--pill);
  font-size:10px;
  font-weight:900;
  background:var(--primary-soft);
  color:var(--primary);
}
.trust-card .trust-row,
.trust-card .info-block {
  padding:0 0 14px;
  margin:0 0 14px;
  border-bottom:1px solid var(--line);
}
.trust-card .trust-row:last-child,
.trust-card .info-block:last-child { border:0; margin-bottom:0; padding-bottom:0; }
.checkline {
  display:flex;
  gap:10px;
  align-items:flex-start;
  font-size:13px;
  color:var(--ink-2);
  line-height:1.35;
}
.checkline input { margin-top:2px; accent-color:var(--primary); }
.support-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:14px;
}
.hero-info-card {
  background:linear-gradient(180deg, var(--card), var(--primary-soft));
}
.info-mini-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  margin-top:14px;
}
.info-mini {
  background:rgba(255,255,255,.45);
  border:1px solid var(--line);
  border-radius:18px;
  padding:12px;
}
.info-mini b {
  display:block;
  font-size:12px;
  margin-bottom:4px;
}
.info-mini span {
  display:block;
  color:var(--muted);
  font-size:11px;
  line-height:1.35;
}
.pro-card .pro-pill {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border-radius:var(--pill);
  background:var(--ink);
  color:var(--surface);
  font-size:10px;
  font-weight:900;
  margin-bottom:10px;
}
@media (max-width: 390px) {
  .support-grid, .info-mini-grid { grid-template-columns:1fr; }
  .product-card .pc-head { flex-direction:column; }
}


/* ---------- Pro / Free visible patch ---------- */
.feature-status-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.feature-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card-2);
  font-size: 13px;
  color: var(--ink-2);
}
.feature-row b {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: var(--pill);
  background: var(--green-soft);
  color: var(--green);
}
.feature-row.is-locked b {
  background: var(--ink);
  color: var(--surface);
}
.pro-mini-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--primary-soft);
  color: var(--primary-600);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}
.pro-mini-note b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  margin-right: 6px;
  border-radius: var(--pill);
  background: var(--ink);
  color: var(--surface);
  font-size: 10px;
  letter-spacing: .06em;
}


/* ---------- Diet Mode Patch ---------- */
.diet-switch {
  max-width: 100%;
  overflow-x: auto;
}
.diet-switch button {
  white-space: nowrap;
}


/* ---------- Diet Mode Assistant Patch ---------- */
.diet-assistant-choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.diet-assistant-choices .choice {
  width: 100%;
}


/* ---------- Runtime Status Patch ---------- */
.runtime-card {
  border: 1px solid color-mix(in srgb, var(--green) 20%, var(--line));
}
.runtime-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.runtime-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--card-2);
  font-size: 12.5px;
  color: var(--ink-2);
}
.runtime-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.runtime-row b {
  text-align: right;
  color: var(--ink);
  font-size: 12px;
  word-break: break-word;
}
.status-ok,
.status-warn {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.status-ok { background: var(--green); }
.status-warn { background: var(--amber); }


/* ---------- Profile / Settings Split ---------- */
.profile-settings-entry {
  display: block;
}
.tech-details {
  margin-top: 16px;
}
.tech-details summary {
  cursor: pointer;
  font-family: var(--ff-display);
  font-weight: 800;
  font-size: 18px;
  list-style: none;
}
.tech-details summary::-webkit-details-marker {
  display: none;
}
.tech-details summary::after {
  content: "anzeigen";
  float: right;
  font-family: var(--ff-body);
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  background: var(--card-2);
  padding: 6px 10px;
  border-radius: var(--pill);
}
.tech-details[open] summary::after {
  content: "ausblenden";
}


/* DietRating food metadata */
.food-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.food-meta span{
  font-size:.78rem;
  font-weight:750;
  color:var(--muted);
  background:rgba(255,255,255,.68);
  border:1px solid var(--line);
  border-radius:999px;
  padding:5px 8px;
}
.portion-hint{
  margin-top:8px;
  font-size:.86rem;
  line-height:1.35;
  color:var(--muted);
  background:rgba(255,255,255,.55);
  border:1px dashed var(--line);
  border-radius:14px;
  padding:9px 10px;
}


/* Food detail / tracking UX patch */
.mode-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-top:8px;
  font-size:.78rem;
  font-weight:800;
  color:var(--muted);
  background:rgba(255,255,255,.62);
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 10px;
}
.food-explain{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--line);
}
.explain-title{
  font-size:.78rem;
  font-weight:900;
  color:var(--text);
  margin-bottom:5px;
}
.portion-hint{
  display:flex;
  flex-direction:column;
  gap:3px;
}
.portion-hint strong{
  font-size:.78rem;
  color:var(--text);
}
.portion-hint span{
  color:var(--muted);
}
.quick-impact{
  margin-top:10px;
  border-radius:16px;
  padding:10px 12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.58);
  display:flex;
  flex-direction:column;
  gap:3px;
}
.quick-impact strong{
  font-size:.78rem;
  color:var(--text);
}
.quick-impact span{
  font-size:.86rem;
  line-height:1.35;
  color:var(--muted);
}
.quick-impact.green{
  border-color:rgba(92,124,81,.24);
}
.quick-impact.yellow{
  border-color:rgba(160,120,42,.24);
}
.quick-impact.red{
  border-color:rgba(170,70,60,.24);
}
.food-actions .badge{
  max-width:150px;
  text-align:center;
  white-space:normal;
  line-height:1.1;
}

/* Cloud Clean v2: backup-first onboarding */
.backup-start-card{margin:16px auto 4px;max-width:560px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px;border:1px solid rgba(40,55,45,.12);border-radius:18px;background:rgba(255,255,255,.72);box-shadow:0 10px 30px rgba(20,30,20,.06);}
.backup-start-card b{display:block;font-size:.96rem;margin-bottom:3px;}
.backup-start-card span{display:block;font-size:.84rem;opacity:.72;}
.btn-small{padding:9px 12px;white-space:nowrap;}
@media (max-width:520px){.backup-start-card{align-items:stretch;flex-direction:column;text-align:left;}.backup-start-card .btn{width:100%;}}

/* Cloud v4 search cards */
.search-meta{font-size:.82rem;opacity:1;margin:12px 4px;}
.search-meta.hedaline-fav{    display: flex;
    justify-content: space-between;
    align-items: center; }
.result-list{display:grid;gap:12px;margin-top:12px;padding-bottom:90px;}
.food-card{background:rgba(255,255,255,.76);border:1px solid rgba(40,55,45,.1);border-radius:20px;padding:14px;box-shadow:0 10px 30px rgba(20,30,20,.05);}
.food-card-main{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;}
.food-title{font-weight:800;font-size:1rem;}
.food-sub,.macro-line{font-size:.82rem;opacity:.68;margin-top:3px;}
.rating-pill{display:inline-flex;border-radius:999px;padding:6px 10px;font-size:.75rem;font-weight:800;}
.rating-green{background:#dff3dc;color:#244b25;}
.rating-yellow{background:#fff0c8;color:#6a4a12;}
.rating-red{background:#ffd9d4;color:#75251d;}
.food-explain{margin-top:10px;font-size:.82rem;line-height:1.35;}
.food-explain p{margin:.35rem 0;}
.explain-title{font-weight:800;}
.portion-hint{opacity:.8;}
.quick-impact{opacity:.65;}
.food-actions{display:flex;gap:8px;margin-top:12px;}
.empty{text-align:center;margin:56px auto;color:rgba(45,40,35,.55);max-width:280px;}
.empty-emoji{font-size:30px;margin-bottom:12px;}

/* Cloud v6 admin + plans */
.admin-row{display:grid;grid-template-columns:1.4fr minmax(120px,.7fr) minmax(120px,.7fr) auto;gap:10px;align-items:center;padding:12px 0;border-bottom:1px solid rgba(40,55,45,.09);}
.admin-row:last-child{border-bottom:0;}
.admin-row b{display:block;font-weight:800;}
.admin-row span,.admin-row small{display:block;font-size:.78rem;opacity:.65;margin-top:3px;}
.admin-row .input{margin:0;}
.plan-row{grid-template-columns:1.4fr 1fr .8fr .7fr auto;}
.user-row{grid-template-columns:1.4fr .6fr .6fr auto;}
.plan-actions{display:flex;gap:10px;flex-wrap:wrap;}
.plans-list{display:grid;gap:10px;margin-top:14px;}
.plan-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px;border:1px solid rgba(40,55,45,.1);border-radius:16px;background:rgba(255,255,255,.5);}
.plan-card b{display:block;}
.plan-card span{display:block;font-size:.82rem;opacity:.68;margin-top:3px;}
@media (max-width:720px){
  .admin-row,.plan-row,.user-row{grid-template-columns:1fr;}
  .plan-card{align-items:stretch;flex-direction:column;}
}

/* Cloud v8 onboarding login */
.onboarding-cloud-card{
  display:block;
  text-align:left;
  max-width:560px;
}
.onboarding-card-head{
  display:block;
  margin-bottom:10px;
}
.onboarding-card-head b{
  display:block;
  font-size:.98rem;
  margin-bottom:4px;
}
.onboarding-card-head span{
  display:block;
  font-size:.84rem;
  opacity:.72;
  line-height:1.35;
}
.onboarding-login-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  margin:10px 0 12px;
}
.onboarding-login-grid .input{
  margin:0;
}
.onboarding-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.onboarding-actions .btn{
  flex:1;
  min-width:130px;
}
.onboarding-divider{
  height:1px;
  background:rgba(40,55,45,.1);
  margin:16px 0;
}
.onboarding-cloud-card > .btn{
  width:100%;
}

/* ---------- Flyout side menu ---------- */
.menu-btn {
  border: 0; background: var(--card-2); color: var(--ink-2);
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.flyout-backdrop {
  position: absolute; inset: 0; z-index: 70;
  background: rgba(15,28,51,.42); opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.flyout-backdrop.show { opacity: 1; pointer-events: auto; }
.flyout {
  position: absolute; top: 0; bottom: 0; left: 0; z-index: 71;
  width: 82%; max-width: 320px;
  background: var(--card); box-shadow: var(--shadow-pop);
  transform: translateX(-110%);
  transition: transform .34s cubic-bezier(.22,.8,.3,1);
  padding: 18px 14px calc(18px + var(--safe-bottom));
  overflow-y: auto; border-radius: 0 var(--r-xl) var(--r-xl) 0;
}
.flyout.show { transform: none; }
.flyout-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--ff-display); font-weight: 800; font-size: 18px;
  padding: 6px 8px 12px;
}
.flyout-close {
  border: 0; background: var(--card-2); color: var(--ink-2);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px;
}
.flyout-group {
  font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 14px 10px 6px;
}
.flyout-link {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer;
  padding: 12px; border-radius: var(--r-md); color: var(--ink); font-weight: 700; font-size: 15px;
}
.flyout-link small { color: var(--muted); font-weight: 600; font-size: 12px; }
.flyout-link:active { background: var(--card-2); }
.flyout-link.active { background: var(--primary-soft); color: var(--primary-600); }
