
:root{
  --accent:#F2D300;
  --accent-2:#FFE74F;
  --accent-ink:#171717;

  --bg:#F5F6F7;
  --panel:#FFFFFF;
  --panel-2:#F1F2F3;
  --line:#DADDE2;
  --text:#15171A;
  --muted:#6E7681;

  --danger:#D94C54;
  --warn:#B97700;
  --good:#16875D;

  --shadow:0 18px 45px rgba(26,30,36,.10);
  --radius:18px;
}

html[data-theme="dark"]{
  --bg:#0E1013;
  --panel:#16191E;
  --panel-2:#1D2128;
  --line:#2A3039;
  --text:#F4F5F7;
  --muted:#9AA2AE;

  --danger:#FF686F;
  --warn:#FFC45C;
  --good:#42D49A;

  --shadow:0 18px 55px rgba(0,0,0,.34);
}

*{box-sizing:border-box}
html,body{
  margin:0;
  min-height:100%;
  background:var(--bg);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
a{color:inherit}
.hidden{display:none!important}
.logo-dark{display:none}
html[data-theme="dark"] .logo-light{display:none}
html[data-theme="dark"] .logo-dark{display:block}

.app-shell{min-height:100vh;display:grid;grid-template-columns:258px 1fr}

.sidebar{
  position:sticky;
  top:0;
  height:100vh;
  padding:0;
  background:var(--panel);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  z-index:30;
  overflow:hidden;
}

.brand{
  min-height:126px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  justify-content:center;
  gap:8px;
  padding:18px 18px 16px;
  border-bottom:1px solid var(--line);
}

.brand-logo-wrap{
  width:100%;
  min-height:70px;
  display:grid;
  place-items:center;
  overflow:hidden;
}

.nav-logo{
  width:100%;
  max-width:220px;
  max-height:82px;
  object-fit:contain;
  margin:0 auto;
}


/* A navigációban egyszerre csak az aktuális témához tartozó logó látszódhat. */
html[data-theme="light"] .nav-logo.logo-light{display:block}
html[data-theme="light"] .nav-logo.logo-dark{display:none}
html[data-theme="dark"] .nav-logo.logo-light{display:none}
html[data-theme="dark"] .nav-logo.logo-dark{display:block}

.brand-household{
  display:block;
  width:100%;
  color:var(--muted);
  text-align:center;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  padding:0 4px;
}

.brand-fallback{
  width:58px;
  height:58px;
  border-radius:18px;
  display:grid;
  place-items:center;
  background:var(--accent);
  color:var(--accent-ink);
  font-size:28px;
  font-weight:900;
}

nav{
  display:grid;
  gap:0;
  width:100%;
}

nav button{
  width:100%;
  min-height:52px;
  border:0;
  border-bottom:1px solid color-mix(in srgb,var(--line) 60%,transparent);
  background:transparent;
  color:var(--muted);
  text-align:left;
  padding:0 22px;
  border-radius:0;
  font-weight:720;
  transition:
    background .16s ease,
    color .16s ease,
    padding-left .16s ease,
    box-shadow .16s ease;
}

nav button:hover{
  background:var(--panel-2);
  color:var(--text);
  padding-left:27px;
  box-shadow:inset 4px 0 0 color-mix(in srgb,var(--accent) 52%,transparent);
}

nav button.active{
  background:var(--accent);
  color:var(--accent-ink);
  box-shadow:inset 5px 0 0 color-mix(in srgb,#000 22%,transparent);
}

nav button.active:hover{
  background:var(--accent-2);
  padding-left:27px;
}

.sidebar-footer{
  margin-top:auto;
  padding:14px 18px 16px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.footer-actions{display:flex;align-items:center;gap:5px}

.link-btn{
  border:0;
  background:none;
  color:var(--muted);
  padding:8px 5px;
}

.main{min-width:0}

.topbar{
  position:sticky;
  top:0;
  z-index:40;
  min-height:80px;
  background:color-mix(in srgb,var(--bg) 90%,transparent);
  backdrop-filter:blur(15px);
  border-bottom:1px solid var(--line);
  padding:0 0 0 24px;
  display:flex;
  justify-content:space-between;
  align-items:stretch;
  gap:18px;
}

.topbar-title{
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:10px 0;
}

.topbar h1{
  font-size:1.34rem;
  margin:0 0 2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.top-actions{
  margin-left:auto;
  display:flex;
  align-items:stretch;
  gap:0;
  min-height:79px;
}

.header-tile{
  min-height:79px;
  border:0;
  user-select:none;
  -webkit-user-select:none;
  border-left:1px solid var(--line);
  border-radius:0;
  background:color-mix(in srgb,var(--panel) 72%,transparent);
  color:var(--text);
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 18px;
  transition:background .16s ease,box-shadow .16s ease,color .16s ease;
}

.header-tile:hover{
  background:var(--panel-2);
  box-shadow:inset 0 -3px 0 color-mix(in srgb,var(--accent) 55%,transparent);
}

.header-tile-copy{
  min-width:0;
  display:grid;
  gap:3px;
  text-align:left;
}

.header-tile-caption{
  color:var(--muted);
  font-size:.68rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.055em;
}

.header-tile-value{
  max-width:190px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  font-size:.91rem;
}

.header-account-control{
  position:relative;
  display:flex;
  align-items:stretch;
}

.header-account-btn{
  min-width:224px;
  justify-content:flex-start;
}

.header-account-chevron{
  color:var(--muted);
  font-size:1.05rem;
  margin-left:auto;
  transition:transform .16s ease;
}

.header-account-btn[aria-expanded="true"] .header-account-chevron{
  transform:rotate(180deg);
}

.account-color-dot{
  flex:0 0 auto;
  width:11px;
  height:11px;
  border-radius:50%;
  border:1px solid color-mix(in srgb,var(--text) 18%,transparent);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--panel) 75%,transparent);
}

.account-color-dot-all{
  background:conic-gradient(from 35deg,var(--accent),#42D49A,#43A7E7,#B779FF,var(--accent));
}

.header-account-menu{
  position:absolute;
  top:calc(100% + 1px);
  right:0;
  z-index:90;
  width:300px;
  max-height:min(420px,70vh);
  overflow:auto;
  padding:6px;
  background:var(--panel);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.header-account-option{
  width:100%;
  min-height:54px;
  border:0;
  border-bottom:1px solid color-mix(in srgb,var(--line) 58%,transparent);
  border-radius:0;
  background:transparent;
  color:var(--text);
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:11px;
  padding:8px 11px;
  text-align:left;
}

.header-account-option:last-child{border-bottom:0}
.header-account-option:hover{background:var(--panel-2)}

.header-account-option.selected{
  background:color-mix(in srgb,var(--accent) 15%,var(--panel));
  box-shadow:inset 4px 0 0 var(--accent);
}

.header-account-option-copy{
  min-width:0;
  display:grid;
  gap:2px;
}

.header-account-option-copy strong{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.header-account-option-copy small{color:var(--muted)}
.header-account-check{color:var(--good);font-weight:900}

.header-month-control{
  position:relative;
  display:flex;
  align-items:stretch;
}

.header-month-tile{
  width:190px;
  cursor:pointer;
  justify-content:flex-start;
}

.header-month-chevron{
  color:var(--muted);
  font-size:1.05rem;
  margin-left:auto;
  transition:transform .16s ease;
}

.header-month-tile[aria-expanded="true"] .header-month-chevron{
  transform:rotate(180deg);
}

.header-month-menu{
  position:absolute;
  top:calc(100% + 1px);
  right:0;
  z-index:95;
  width:330px;
  padding:0;
  background:var(--panel);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
  user-select:none;
  -webkit-user-select:none;
}

.header-month-menu-head{
  min-height:58px;
  display:grid;
  grid-template-columns:54px minmax(0,1fr) 54px;
  align-items:center;
  border-bottom:1px solid var(--line);
}

.month-menu-year{
  text-align:center;
  font-size:1rem;
  letter-spacing:.01em;
}

.month-year-nav{
  align-self:stretch;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--text);
  font-size:1.55rem;
  line-height:1;
  transition:background .15s ease,color .15s ease;
}

.month-year-nav:hover{
  background:var(--panel-2);
  color:var(--text);
}

.month-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  padding:7px;
}

.month-option{
  position:relative;
  min-height:60px;
  border:0;
  border-right:1px solid color-mix(in srgb,var(--line) 58%,transparent);
  border-bottom:1px solid color-mix(in srgb,var(--line) 58%,transparent);
  border-radius:0;
  background:transparent;
  color:var(--text);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  font-weight:720;
  transition:background .14s ease,color .14s ease,box-shadow .14s ease;
}

.month-option:nth-child(3n){border-right:0}
.month-option:nth-last-child(-n+3){border-bottom:0}

.month-option:hover{
  background:var(--panel-2);
}

.month-option.selected{
  background:var(--accent);
  color:var(--accent-ink);
  box-shadow:inset 0 -3px 0 rgba(0,0,0,.14);
}

.month-option.current:not(.selected){
  box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--accent) 75%,transparent);
}

.month-option small{
  font-size:.62rem;
  color:var(--muted);
  font-weight:700;
}

.month-option.selected small{
  color:color-mix(in srgb,var(--accent-ink) 68%,transparent);
}

.header-month-menu-foot{
  border-top:1px solid var(--line);
  padding:7px;
}

.month-today-btn{
  width:100%;
  min-height:42px;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--muted);
  font-weight:720;
  transition:background .15s ease,color .15s ease;
}

.month-today-btn:hover{
  background:var(--panel-2);
  color:var(--text);
}

.header-quick-tx{
  min-width:142px;
  justify-content:center;
  background:var(--accent);
  color:var(--accent-ink);
  font-weight:850;
}

.header-quick-tx:hover{
  background:var(--accent-2);
  box-shadow:inset 0 -4px 0 rgba(0,0,0,.16);
}

.header-quick-plus{
  font-size:1.18rem;
  line-height:1;
}

.content{padding:22px 24px 60px;max-width:1500px;width:100%;margin:0 auto}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:18px;
  box-shadow:0 3px 14px rgba(0,0,0,.025);
}

.card h2,.card h3{margin:0 0 12px}
.grid{display:grid;gap:16px}
.grid.cols4{grid-template-columns:repeat(4,minmax(0,1fr))}
.grid.cols3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid.cols2{grid-template-columns:repeat(2,minmax(0,1fr))}

.metric .label{color:var(--muted);font-size:.82rem}
.metric .value{
  font-size:1.7rem;
  font-weight:800;
  margin-top:8px;
  letter-spacing:-.035em;
}
.metric .hint{font-size:.78rem;color:var(--muted);margin-top:4px}
.value.positive{color:var(--good)}
.value.negative{color:var(--danger)}

.btn{
  border:1px solid var(--line);
  background:var(--panel-2);
  color:var(--text);
  padding:10px 14px;
  border-radius:7px;
  font-weight:760;
  transition:background .15s ease,border-color .15s ease,box-shadow .15s ease,transform .15s ease;
}
.btn:hover{filter:brightness(.98)}
html[data-theme="dark"] .btn:hover{filter:brightness(1.08)}
.btn.primary{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--accent-ink);
}
.btn.danger{
  background:color-mix(in srgb,var(--danger) 12%,transparent);
  border-color:color-mix(in srgb,var(--danger) 35%,transparent);
  color:var(--danger);
}
.btn.sm{padding:7px 10px;font-size:.82rem}

.icon-btn{
  width:38px;
  height:38px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
  color:var(--text);
  display:grid;
  place-items:center;
}

input,select,textarea{
  width:100%;
  background:var(--panel);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:11px;
  padding:10px 11px;
  outline:none;
}
input:focus,select:focus,textarea:focus{
  border-color:#D9BD00;
  box-shadow:0 0 0 3px rgba(242,211,0,.18);
}

label{display:grid;gap:6px;color:var(--text);font-size:.86rem}
.stack{display:grid;gap:13px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px}

.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:14px;
}
table{width:100%;border-collapse:collapse;min-width:760px}
th,td{
  padding:11px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  white-space:nowrap;
}
th{
  font-size:.76rem;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--muted);
  background:var(--panel-2);
  position:sticky;
  top:0;
}
tr:last-child td{border-bottom:0}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 8px;
  border-radius:999px;
  background:var(--panel-2);
  font-size:.78rem;
}
.dot{width:9px;height:9px;border-radius:50%}

.logo{
  width:40px;
  height:40px;
  flex:0 0 40px;
  display:block;
  border:0;
  border-radius:10px;
  background:transparent;
  object-fit:contain;
  object-position:center;
  padding:0;
}
.logo.placeholder{
  background:var(--panel-2);
  display:inline-grid;
  place-items:center;
  color:var(--muted);
  font-size:.72rem;
  padding:0;
}

.row{display:flex;align-items:center;gap:10px}
.between{justify-content:space-between}
.wrap{flex-wrap:wrap}

.section-title{
  margin:24px 0 11px;
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:end;
}
.section-title h2{font-size:1.04rem;margin:0}

.progress{
  height:9px;
  background:var(--panel-2);
  border-radius:99px;
  overflow:hidden;
}
.progress>span{display:block;height:100%;border-radius:99px}

.category-row{
  display:grid;
  grid-template-columns:minmax(140px,1fr) 2fr auto;
  gap:14px;
  align-items:center;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.category-row:last-child{border:0}

.advisor{border-left:4px solid var(--good)}
.advisor.warn{border-left-color:var(--warn)}
.advisor.danger{border-left-color:var(--danger)}
.advisor-main{font-size:2rem;font-weight:850}

.chart-card{min-height:360px}
.chart-box{position:relative;height:300px}


.autocomplete{position:relative}
.autocomplete-input-wrap{position:relative;display:flex;align-items:center}
.autocomplete-input-wrap input{
  min-height:48px;
  padding-left:54px;
  padding-right:42px;
}
.autocomplete-selected-logo{
  position:absolute;
  left:8px;
  z-index:2;
  width:38px;
  height:38px;
  display:grid;
  place-items:center;
  pointer-events:none;
}
.autocomplete-selected-logo:empty{display:none}
.autocomplete-selected-logo:empty + input{padding-left:11px}
.autocomplete-selected-logo .logo{
  width:38px;
  height:38px;
  flex-basis:38px;
  border-radius:9px;
}
.autocomplete-clear{
  position:absolute;
  right:7px;
  width:30px;
  height:30px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--muted);
  font-size:20px;
  line-height:1;
}
.autocomplete-clear:hover{background:var(--panel-2);color:var(--text)}
.autocomplete-results{
  position:absolute;
  z-index:120;
  left:0;
  right:0;
  top:calc(100% + 6px);
  max-height:310px;
  overflow:auto;
  padding:6px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:13px;
  box-shadow:var(--shadow);
}
.autocomplete-option{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  padding:8px 9px;
  border-radius:10px;
  display:flex;
  align-items:center;
  gap:10px;
  text-align:left;
}
.autocomplete-option:hover,.autocomplete-option:focus{background:var(--panel-2);outline:none}
.autocomplete-option-text{min-width:0;display:grid;gap:2px}
.autocomplete-option-text strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.autocomplete-option-text small{color:var(--muted)}
.autocomplete-empty{padding:12px;color:var(--muted);text-align:center}
.auto-category{
  margin-top:8px;
  display:flex;
  gap:6px;
  align-items:center;
  min-height:28px;
  padding:0 2px;
}
.partnerless-btn{
  margin-top:5px;
  padding:4px 2px;
  font-size:.8rem;
  justify-self:start;
}
.account-opening-note{
  margin:0;
  background:var(--panel-2);
  color:var(--muted);
  font-size:.82rem;
  line-height:1.45;
}

.modal{position:fixed;inset:0;z-index:100}
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(3px);
}
.modal-card{
  position:relative;
  margin:7vh auto 0;
  max-width:700px;
  max-height:86vh;
  overflow:auto;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:20px;
  box-shadow:var(--shadow);
  padding:18px;
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:15px;
}
.modal-head h2{margin:0;font-size:1.2rem}

.auth-screen,.setup-body{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
  background:
    radial-gradient(circle at 50% -10%,rgba(242,211,0,.23) 0,transparent 42%),
    var(--bg);
}
.auth-card{
  width:min(420px,100%);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:24px;
  padding:28px;
  box-shadow:var(--shadow);
}
.login-brand{min-height:76px;display:flex;align-items:center;justify-content:center;margin-bottom:10px}
.app-logo{max-height:76px;max-width:100%;object-fit:contain}
.auth-card h1{margin:0 0 6px}
.login-subtitle{text-align:center;margin:0 0 18px}

.alert{padding:11px 12px;border-radius:10px;margin-bottom:12px}
.alert.danger{background:color-mix(in srgb,var(--danger) 13%,transparent);color:var(--danger)}
.alert.success{background:color-mix(in srgb,var(--good) 12%,transparent);color:var(--good)}

.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:200;
  opacity:0;
  transform:translateY(12px);
  pointer-events:none;
  background:var(--panel);
  border:1px solid var(--line);
  padding:11px 14px;
  border-radius:12px;
  box-shadow:var(--shadow);
  transition:.2s;
}
.toast.show{opacity:1;transform:none}

.split-list{display:grid;gap:8px}
.split-item{
  display:flex;
  justify-content:space-between;
  gap:14px;
  padding:10px 0;
  border-bottom:1px solid var(--line);
}
.split-item:last-child{border:0}

.empty{padding:32px 12px;text-align:center;color:var(--muted)}
.muted{color:var(--muted)}
.small{font-size:.84rem}
.mobile-only{display:none}

@media(max-width:1050px){
  .grid.cols4{grid-template-columns:repeat(2,1fr)}
  .grid.cols3{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:760px){
  .app-shell{display:block}

  .sidebar{
    position:fixed;
    left:-280px;
    transition:.2s;
    width:258px;
    box-shadow:var(--shadow);
  }

  .sidebar.open{left:0}
  .mobile-only{display:grid}

  .topbar{
    min-height:0;
    padding:0;
    display:grid;
    grid-template-columns:52px minmax(0,1fr);
    gap:0;
    align-items:stretch;
  }

  .topbar-menu-btn{
    width:52px;
    min-height:62px;
    height:auto;
    border:0;
    border-right:1px solid var(--line);
    border-radius:0;
    background:transparent;
  }

  .topbar-title{
    min-width:0;
    min-height:62px;
    padding:9px 12px;
  }

  .topbar h1{font-size:1.1rem}

  .topbar #pageSubtitle{
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .top-actions{
    grid-column:1/-1;
    width:100%;
    min-height:54px;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 58px;
    border-top:1px solid var(--line);
  }

  .header-account-control{min-width:0}

  .header-account-btn,
  .header-month-tile,
  .header-quick-tx{
    width:100%;
    min-width:0;
    min-height:54px;
    padding:0 10px;
  }

  .header-account-btn{border-left:0}
  .header-tile-caption{font-size:.6rem}
  .header-tile-value{max-width:none;font-size:.8rem}
  .header-account-chevron{display:none}
  .account-color-dot{width:9px;height:9px}
  .header-month-chevron{display:none}

  .header-quick-tx{padding:0}
  .header-quick-label{display:none}
  .header-quick-plus{font-size:1.45rem}

  .header-account-menu{
    position:fixed;
    top:116px;
    left:8px;
    right:8px;
    width:auto;
    max-height:55vh;
  }

  .header-month-control{
    min-width:0;
  }

  .header-month-menu{
    position:fixed;
    top:116px;
    left:8px;
    right:8px;
    width:auto;
    max-height:calc(100vh - 126px);
    overflow:auto;
  }

  .header-month-menu-head{
    min-height:52px;
  }

  .month-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .month-option{
    min-height:54px;
  }

  .content{padding:14px 12px 50px}
  .grid.cols4,.grid.cols3,.grid.cols2,.form-grid{grid-template-columns:1fr}
  .metric .value{font-size:1.45rem}
  .category-row{grid-template-columns:1fr auto}
  .category-row .progress{grid-column:1/-1}
  .chart-card{min-height:300px}
  .chart-box{height:245px}
  .modal-card{margin:4vh 10px 0;max-height:92vh}
  .btn{padding:10px 12px}
}


@media(min-width:761px) and (max-width:1120px){
  .header-account-btn{min-width:190px}
  .header-month-tile{width:168px}
  .header-month-menu{width:310px}
  .header-quick-tx{min-width:118px}
  .header-tile{padding-left:13px;padding-right:13px}
  .header-tile-value{max-width:145px}
}


/* ===== Főzés ===== */
.food-hero{
  margin:8px 0 16px;
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px;
}
.food-hero h2{margin:0 0 4px}
.food-hero-actions{justify-content:flex-end}
.food-top-grid,.food-stock-grid{align-items:start}
.food-shopping-card,.food-stock-grid,.food-ingredients-card{margin-top:16px}
.food-card-head{margin-bottom:12px}
.food-card-head h2{margin:0 0 3px}
.food-card-head h3{margin:0}

.food-meal-list,.shopping-list{display:grid}
.food-meal-row,.shopping-row{
  display:grid;
  align-items:center;
  gap:12px;
  padding:11px 0;
  border-bottom:1px solid var(--line);
}
.food-meal-row{grid-template-columns:64px minmax(0,1fr) auto}
.shopping-row{grid-template-columns:minmax(0,1fr) auto}
.food-meal-row:last-child,.shopping-row:last-child{border-bottom:0}
.food-meal-date{display:grid;gap:2px;color:var(--text)}
.food-meal-date small{color:var(--muted)}
.food-meal-main,.shopping-main{min-width:0}
.food-meal-side{
  display:grid;
  justify-items:end;
  gap:6px;
}
.food-meal-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:6px;
}
.food-meal-cost,.shopping-buy{text-align:right}
.shopping-buy{min-width:150px}

.food-shopping-columns{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:22px;
}
.food-shopping-columns section{
  min-width:0;
  border:1px solid var(--line);
  border-radius:12px;
  padding:14px;
  background:color-mix(in srgb,var(--panel-2) 32%,transparent);
}
.food-shopping-columns h3{margin:0 0 6px}
.food-check-row .badge{justify-self:end}

.food-library-item{align-items:center}
.food-library-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  text-align:right;
  flex-wrap:wrap;
}
.food-header-actions{justify-content:flex-end}
.food-filter{width:min(260px,42vw)}

.food-form-section{
  display:grid;
  gap:11px;
  padding:14px;
  border:1px solid var(--line);
  background:color-mix(in srgb,var(--panel-2) 55%,transparent);
  border-radius:12px;
}
.food-package-grid{
  display:grid;
  grid-template-columns:1fr 1.15fr 1.2fr;
  gap:10px;
}
.food-conversion-details{
  border:1px solid var(--line);
  border-radius:12px;
  padding:11px 12px;
  background:color-mix(in srgb,var(--panel-2) 30%,transparent);
}
.food-conversion-details summary{cursor:pointer;font-weight:760;user-select:none}
.food-conversion-row{
  display:grid;
  grid-template-columns:minmax(145px,1fr) minmax(145px,1fr) minmax(160px,1fr) 38px;
  gap:8px;
  align-items:end;
}
.food-conversion-value{display:flex;align-items:center;gap:7px}
.food-conversion-value input{min-width:0}
.conversion-base-unit{color:var(--muted);min-width:32px}

.food-import-box{
  display:grid;
  gap:10px;
  padding:14px;
  border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));
  border-radius:12px;
  background:color-mix(in srgb,var(--accent) 7%,var(--panel));
}
.food-import-box textarea{resize:vertical;min-height:118px}

.food-recipe-row{
  position:relative;
  display:grid;
  grid-template-columns:minmax(220px,2fr) 108px 145px 38px;
  gap:8px;
  align-items:start;
}
.food-recipe-row .ri-hint{
  grid-column:1/-1;
  margin-top:-3px;
  min-height:17px;
}
.food-new-ing{color:var(--positive)}
.food-conversion-warning{color:#c47a00}
.ri-hint .link-btn{
  margin-left:8px;
  font-size:.8rem;
}
.ri-conversion-editor{
  grid-column:1/-1;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  padding:9px 10px;
  border:1px dashed color-mix(in srgb,#c47a00 55%,var(--line));
  border-radius:9px;
  background:color-mix(in srgb,#c47a00 6%,var(--panel));
  font-size:.84rem;
}
.ri-conversion-editor.hidden{display:none}
.ri-conversion-editor input{
  width:100px;
  min-width:80px;
}

.food-ingredient-autocomplete{position:relative;min-width:0}
.food-ingredient-results{
  position:absolute;
  z-index:40;
  top:calc(100% + 5px);
  left:0;
  right:0;
  max-height:260px;
  overflow:auto;
  overscroll-behavior:contain;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
  box-shadow:0 16px 38px rgba(0,0,0,.18);
}
.food-ingredient-result{
  width:100%;
  min-height:52px;
  display:grid;
  gap:2px;
  text-align:left;
  border:0;
  border-bottom:1px solid var(--line);
  border-radius:0;
  padding:9px 11px;
  background:transparent;
  color:var(--text);
}
.food-ingredient-result:last-child{border-bottom:0}
.food-ingredient-result:hover{background:var(--panel-2)}
.food-ingredient-result span{font-size:.78rem;color:var(--muted)}
.food-result-empty{padding:12px;color:var(--muted);font-size:.84rem}

.food-stock-entry-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1.3fr 1.2fr;
  gap:10px;
}
.food-stock-item{align-items:flex-start}
.food-stock-actions{justify-content:flex-end}
.food-waste-card .metric-inline{
  display:flex;
  align-items:baseline;
  gap:10px;
  flex-wrap:wrap;
  margin:12px 0 4px;
}
.food-waste-card .metric-inline strong{font-size:1.65rem}
.food-multiplier-input{display:flex;align-items:center;gap:10px}
.food-multiplier-input input{max-width:140px}

@media(max-width:760px){
  .food-hero{align-items:stretch;flex-direction:column}
  .food-hero-actions{width:100%}
  .food-hero-actions .btn{flex:1}
  .food-meal-row{grid-template-columns:52px minmax(0,1fr)}
  .food-meal-side{
    grid-column:2;
    justify-items:start;
  }
  .food-meal-actions{justify-content:flex-start}
  .food-meal-cost{text-align:left;color:var(--muted);font-size:.84rem}
  .shopping-row{grid-template-columns:1fr}
  .shopping-buy{text-align:left;min-width:0}
  .food-shopping-columns{grid-template-columns:1fr;gap:12px}
  .food-check-row .badge{justify-self:start}
  .food-library-item{align-items:flex-start;flex-direction:column}
  .food-library-actions{width:100%;justify-content:flex-start;text-align:left}
  .food-header-actions{width:100%;justify-content:stretch}
  .food-header-actions .btn{flex:1}
  .food-filter{width:100%;flex:1 1 100%}
  .food-package-grid,.food-stock-entry-grid{grid-template-columns:1fr}
  .food-conversion-row{
    grid-template-columns:1fr 1fr;
    border-bottom:1px solid var(--line);
    padding-bottom:10px;
  }
  .food-conversion-row .icon-btn{grid-column:2;justify-self:end}
  .food-recipe-row{
    grid-template-columns:minmax(0,1fr) 92px;
    padding:10px 0;
    border-bottom:1px solid var(--line);
  }
  .food-recipe-row .food-ingredient-autocomplete{grid-column:1/-1}
  .food-recipe-row .ri-unit{grid-column:1}
  .food-recipe-row .removeRecipeRow{grid-column:2;grid-row:2;justify-self:end}
  .food-recipe-row .ri-hint{grid-column:1/-1}
  .food-ingredient-results{position:relative;top:auto;margin-top:5px;max-height:230px}
  .food-stock-actions{justify-content:flex-start}
}

/* ===== Statisztikák 2.0 ===== */
.stats-main-title{
  align-items:center;
}
.stats-toggle-wrap{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.stats-segmented{
  display:inline-grid;
  grid-auto-flow:column;
  grid-auto-columns:minmax(54px,auto);
  border:1px solid var(--line);
  background:var(--panel);
  overflow:hidden;
}
.stats-segmented button{
  min-height:34px;
  border:0;
  border-right:1px solid var(--line);
  border-radius:0;
  padding:6px 11px;
  background:transparent;
  color:var(--muted);
  font-weight:760;
  transition:background .14s ease,color .14s ease,box-shadow .14s ease;
}
.stats-segmented button:last-child{
  border-right:0;
}
.stats-segmented button:hover{
  background:var(--panel-2);
  color:var(--text);
}
.stats-segmented button.active{
  background:var(--accent);
  color:var(--accent-ink);
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.14);
}
.stats-detail-title{
  margin-top:30px;
}
.stats-detail-card{
  min-height:390px;
}
.stats-chart-head{
  margin-bottom:8px;
}
.stats-chart-head h2{
  margin:0 0 4px;
}
.chart-box-tall{
  height:360px;
}

@media(max-width:760px){
  .stats-main-title{
    align-items:stretch;
  }
  .stats-toggle-wrap{
    width:100%;
    justify-content:space-between;
  }
  .stats-segmented{
    max-width:100%;
  }
  .stats-chart-head{
    align-items:flex-start;
    gap:10px;
  }
  .stats-chart-head .stats-segmented{
    width:100%;
    grid-template-columns:1fr 1fr;
    grid-auto-flow:unset;
  }
  .chart-box-tall{
    height:420px;
  }
}


/* ===== v0.44 mobil UX / kompakt műveletek ===== */

html,body{
  max-width:100%;
  /* A clip nem hoz létre új scroll-containert, így a sticky fejléc/menü működik. */
  overflow-x:clip;
}
html.modal-open,
html.modal-open body{
  overflow:hidden;
  overscroll-behavior:none;
}
.main,.content,.card,.section-title>div,.split-item>*{
  min-width:0;
}
.content{
  max-width:100%;
  overflow-x:hidden;
}
.table-wrap{
  width:100%;
  max-width:100%;
}
.section-title{
  flex-wrap:wrap;
}
.ui-icon{
  width:19px;
  height:19px;
  display:block;
  fill:currentColor;
}
.action-icon{
  width:34px;
  height:34px;
  min-width:34px;
  padding:0;
  border-radius:8px;
}
.action-icon.danger{
  color:var(--danger);
  border-color:color-mix(in srgb,var(--danger) 35%,var(--line));
}
.transactions-table .tx-note{
  width:28%;
  max-width:340px;
  white-space:normal;
  overflow-wrap:anywhere;
  line-height:1.35;
}
.transactions-table .tx-actions,
.planner-table .plan-actions{
  width:1%;
}
.planner-table .plan-actions .row,
.transactions-table .tx-actions{
  white-space:nowrap;
}

@media(max-width:760px){
  input,select,textarea{
    min-width:0;
    max-width:100%;
    font-size:16px;
    line-height:1.25;
    box-sizing:border-box;
  }

  input[type="date"]{
    min-width:0;
    width:100%;
  }

  .content{
    padding:10px 9px 42px;
  }
  .card{
    padding:13px;
    border-radius:13px;
  }
  .grid{
    gap:10px;
  }

  /* Az Áttekintés 4 nagy metrikája 2×2 legyen, ne négy teljes szélességű kártya. */
  .grid.cols4{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:10px;
  }
  .grid.cols3,.grid.cols2,.form-grid{
    grid-template-columns:1fr;
  }
  .metric .value{font-size:1.32rem}
  .metric .hint{font-size:.74rem}

  .section-title{
    margin:18px 0 9px;
    align-items:flex-start;
    gap:8px;
  }
  .section-title>div{
    flex:1 1 220px;
  }
  .section-title>.btn{
    flex:0 0 auto;
  }

  /* Full-screen mobilmodál; 100dvh követi a Safari/Chrome dinamikus böngészősávját. */
  .modal{
    overflow:hidden;
  }
  .modal-card{
    margin:0;
    width:100%;
    max-width:none;
    height:100vh;
    height:100dvh;
    max-height:100vh;
    max-height:100dvh;
    border:0;
    border-radius:0;
    padding:0 12px calc(94px + env(safe-area-inset-bottom));
    overflow-y:auto;
    overflow-x:hidden;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
  }
  .modal-card>*,
  .modal-card form,
  .modal-card details,
  .modal-card label,
  .modal-card .row{
    min-width:0;
    max-width:100%;
  }
  .modal-head{
    position:sticky;
    top:0;
    z-index:35;
    margin:0 -12px 12px;
    padding:12px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left));
    background:color-mix(in srgb,var(--panel) 96%,transparent);
    border-bottom:1px solid var(--line);
    backdrop-filter:blur(12px);
  }
  .modal-head h2{
    font-size:1.08rem;
  }
  .modal-card label.row{
    flex-wrap:wrap;
    align-items:flex-start;
  }
  .modal-card input[type="checkbox"],
  .modal-card input[type="radio"]{
    width:auto;
    flex:0 0 auto;
  }

  /* Mentés mindig a vizuális viewport alján, a telefon böngészősávja fölött. */
  .modal-card form.stack>.btn.primary:last-child{
    position:sticky;
    bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:30;
    width:100%;
    min-height:48px;
    margin-top:8px;
    box-shadow:0 -10px 22px color-mix(in srgb,var(--panel) 92%,transparent);
  }
  .modal-card form.stack>.modal-form-actions:last-child{
    position:sticky;
    bottom:calc(10px + env(safe-area-inset-bottom));
    z-index:30;
    gap:8px;
    margin-top:8px;
    padding:8px 0 0;
    background:linear-gradient(
      to bottom,
      transparent,
      var(--panel) 28%,
      var(--panel)
    );
  }
  .modal-card form.stack>.modal-form-actions:last-child .btn.primary{
    flex:1;
    min-height:48px;
  }
  .modal-card form.stack>.modal-form-actions:last-child .action-icon{
    width:48px;
    height:48px;
    flex:0 0 48px;
  }

  /* Partnerkereső: touchon normál, swipe-olható lista. */
  .autocomplete-results{
    position:relative;
    top:auto;
    left:auto;
    right:auto;
    margin-top:6px;
    max-height:min(42dvh,320px);
    overflow-y:auto;
    overscroll-behavior:contain;
    touch-action:pan-y;
    -webkit-overflow-scrolling:touch;
  }
  .autocomplete-option{
    min-height:50px;
  }

  /* Mobilon a két széles gazdasági táblázat kártyanézetté válik. */
  .transaction-table-wrap,
  .planner-table-wrap{
    overflow:visible;
    padding:0;
    border:0;
    background:transparent;
  }
  .mobile-card-table{
    display:block;
    width:100%;
    min-width:0;
  }
  .mobile-card-table thead{
    display:none;
  }
  .mobile-card-table tbody{
    display:grid;
    gap:9px;
  }
  .mobile-card-table tr{
    display:grid;
    min-width:0;
    padding:12px;
    border:1px solid var(--line);
    border-radius:13px;
    background:var(--panel);
  }
  .mobile-card-table td{
    min-width:0;
    padding:0;
    border:0;
    white-space:normal;
    overflow-wrap:anywhere;
  }

  .transactions-table tr{
    grid-template-columns:40px minmax(0,1fr) auto;
    gap:4px 9px;
    align-items:center;
  }
  .transactions-table .tx-logo{
    grid-column:1;
    grid-row:1/3;
  }
  .transactions-table .tx-logo .logo{
    width:36px;
    height:36px;
    flex-basis:36px;
  }
  .transactions-table .tx-partner{
    grid-column:2;
    grid-row:1;
    font-weight:760;
  }
  .transactions-table .tx-date{
    grid-column:2;
    grid-row:2;
    color:var(--muted);
    font-size:.78rem;
  }
  .transactions-table .tx-amount{
    grid-column:3;
    grid-row:1;
    text-align:right;
    font-weight:800;
  }
  .transactions-table .tx-actions{
    grid-column:3;
    grid-row:2;
    justify-self:end;
  }
  .transactions-table .tx-category{
    grid-column:1/4;
    grid-row:3;
    padding-top:6px;
  }
  .transactions-table .tx-account{
    grid-column:1/4;
    grid-row:4;
    color:var(--muted);
    font-size:.8rem;
  }
  .transactions-table .tx-note{
    grid-column:1/4;
    grid-row:5;
    width:auto;
    max-width:none;
    margin-top:3px;
    padding-top:7px;
    border-top:1px solid var(--line);
    font-size:.82rem;
  }
  .transactions-table .tx-note:empty{
    display:none;
  }

  .planner-table tr{
    grid-template-columns:minmax(0,1fr) auto;
    gap:7px 10px;
  }
  .planner-table .plan-title{
    grid-column:1;
    grid-row:1;
  }
  .planner-table .plan-amount{
    grid-column:2;
    grid-row:1;
    text-align:right;
  }
  .planner-table .plan-date{
    grid-column:1;
    grid-row:2;
    color:var(--muted);
    font-size:.8rem;
  }
  .planner-table .plan-status{
    grid-column:2;
    grid-row:2;
    justify-self:end;
  }
  .planner-table .plan-funding,
  .planner-table .plan-budget{
    grid-column:1/3;
    padding-top:7px;
    border-top:1px solid var(--line);
    font-size:.82rem;
  }
  .planner-table .plan-actions{
    grid-column:1/3;
    padding-top:3px;
  }
  .planner-table .plan-actions .row{
    justify-content:flex-end;
    flex-wrap:wrap;
  }

  /* Főzés kártyafejlécek se tudják egymást oldalra kitolni. */
  .food-card-head{
    align-items:flex-start;
    flex-wrap:wrap;
    gap:7px 10px;
  }
  .food-card-head>div{
    min-width:0;
    flex:1 1 220px;
  }
  .food-card-head>strong{
    flex:0 0 auto;
    max-width:100%;
  }
  .food-library-actions{
    gap:6px;
  }
  .food-library-actions .action-icon,
  .food-meal-actions .action-icon{
    width:34px;
    height:34px;
  }
}

@media(max-width:340px){
  .grid.cols4{
    grid-template-columns:1fr;
  }
}


/* ===== v0.45 Partnerfigyelő ===== */
.partner-identity-tile{
  width:100%;
  min-width:0;
  min-height:52px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 9px;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--text);
  text-align:left;
  transition:background .14s ease,border-color .14s ease,transform .14s ease;
}
button.partner-identity-tile{
  cursor:pointer;
}
button.partner-identity-tile:hover,
button.partner-identity-tile:focus-visible{
  background:var(--panel-2);
  border-color:var(--line);
  outline:none;
}
button.partner-identity-tile:active{
  transform:translateY(1px);
}
.partner-identity-tile.static{
  cursor:default;
}
.partner-identity-tile .logo{
  flex:0 0 40px;
}
.partner-identity-copy{
  min-width:0;
  flex:1;
  display:grid;
  gap:2px;
}
.partner-identity-copy strong,
.partner-identity-copy small{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.partner-identity-copy small{
  color:var(--muted);
  font-size:.76rem;
}
.partner-identity-arrow{
  flex:0 0 auto;
  color:var(--muted);
  font-size:1.25rem;
  line-height:1;
}
.tx-partner-cell{
  padding:0!important;
  min-width:190px;
}
.tx-partner-cell .partner-identity-tile{
  border-radius:0;
  min-height:58px;
}
.partner-settings-row{
  align-items:stretch;
  padding:3px 0;
}
.partner-settings-tile{
  flex:1;
  align-self:stretch;
}
.partner-settings-row>.action-icon{
  align-self:center;
  flex:0 0 34px;
}

.partner-watch-section{
  margin-top:34px;
  scroll-margin-top:92px;
}
.partner-watch-title{
  align-items:flex-start;
}
.partner-watch-selector-card{
  overflow:visible;
}
.partner-watch-selector-grid{
  display:grid;
  grid-template-columns:minmax(230px,.8fr) minmax(300px,1.2fr);
  gap:18px;
  align-items:end;
}
.partner-watch-current{
  min-width:0;
}
.partner-watch-profile-mini,
.partner-watch-profile-identity{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}
.partner-watch-profile-mini .logo,
.partner-watch-profile-identity .logo{
  width:52px;
  height:52px;
  flex-basis:52px;
  border-radius:12px;
}
.partner-watch-search{
  min-width:0;
}
.partner-watch-search>label{
  display:block;
  margin-bottom:6px;
  font-weight:700;
}
.partner-watch-search-wrap{
  position:relative;
  min-width:0;
}
.partner-watch-search-wrap input{
  width:100%;
  padding-right:42px;
}
.partner-watch-search-wrap>#partnerWatchClear{
  position:absolute;
  top:50%;
  right:7px;
  z-index:3;
  transform:translateY(-50%);
}
.partner-watch-results{
  position:absolute;
  z-index:80;
  top:calc(100% + 6px);
  left:0;
  right:0;
  max-height:330px;
  overflow:auto;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:5px;
}
.partner-watch-option{
  width:100%;
  min-height:54px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:7px 9px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
  text-align:left;
}
.partner-watch-option:hover,
.partner-watch-option:focus-visible{
  background:var(--panel-2);
  outline:none;
}
.partner-watch-option .logo{
  width:38px;
  height:38px;
  flex-basis:38px;
  border-radius:9px;
}
.partner-watch-option>span{
  min-width:0;
  display:grid;
  gap:2px;
}
.partner-watch-option small{
  color:var(--muted);
}
.partner-watch-empty{
  margin-top:14px;
}
.partner-watch-profile{
  margin-top:14px;
}
.partner-watch-profile-head,
.partner-watch-limit-status{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
}
.partner-watch-profile-identity h2,
.partner-watch-limits h2{
  margin:0 0 3px;
}
.partner-watch-ref{
  flex:0 0 auto;
}
.partner-watch-metrics{
  margin-top:16px;
}
.metric.compact{
  padding:12px;
}
.metric.compact .value{
  font-size:1.4rem;
}
.metric.compact .small-value{
  font-size:1.02rem;
  line-height:1.25;
}
.partner-watch-secondary-stats{
  display:flex;
  flex-wrap:wrap;
  gap:8px 18px;
  margin-top:13px;
  padding-top:12px;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:.84rem;
}
.partner-watch-secondary-stats strong{
  color:var(--text);
}
.partner-watch-limits{
  margin-top:14px;
}
.partner-watch-status-copy{
  max-width:520px;
  display:grid;
  justify-items:end;
  gap:3px;
  text-align:right;
}
.partner-budget-progress{
  width:100%;
  height:10px;
  margin-top:14px;
  overflow:hidden;
  border-radius:999px;
  background:var(--panel-2);
  border:1px solid var(--line);
}
.partner-budget-progress span{
  display:block;
  height:100%;
  background:var(--accent);
}
.partner-budget-progress.over span{
  background:var(--danger);
}
.partner-budget-progress-copy{
  margin-top:4px;
  text-align:right;
}
.partner-watch-limit-form{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(160px,1fr) auto;
  align-items:end;
  gap:12px;
  margin-top:14px;
}
.partner-watch-limit-form label{
  min-width:0;
}
.partner-watch-limit-form .btn{
  min-height:44px;
}
.partner-watch-chart-card{
  margin-top:14px;
}

@media(max-width:760px){
  .tx-partner-cell{
    grid-column:1/3;
    grid-row:1/3;
    min-width:0;
  }
  .transactions-table .tx-partner-cell .partner-identity-tile{
    min-height:60px;
    padding:5px 6px;
    border-radius:9px;
  }
  .transactions-table .tx-partner-cell .logo{
    width:38px;
    height:38px;
    flex-basis:38px;
  }
  .partner-settings-row{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:7px;
  }
  .partner-settings-tile{
    min-width:0;
  }
  .partner-watch-section{
    margin-top:24px;
    scroll-margin-top:78px;
  }
  .partner-watch-selector-grid{
    grid-template-columns:1fr;
    gap:10px;
  }
  .partner-watch-results{
    position:relative;
    top:auto;
    margin-top:5px;
    max-height:42dvh;
    touch-action:pan-y;
    -webkit-overflow-scrolling:touch;
  }
  .partner-watch-profile-head,
  .partner-watch-limit-status{
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
  }
  .partner-watch-ref{
    justify-self:start;
  }
  .partner-watch-status-copy{
    max-width:none;
    justify-items:start;
    text-align:left;
  }
  .partner-watch-limit-form{
    grid-template-columns:1fr;
  }
  .partner-watch-limit-form .btn{
    width:100%;
  }
  .partner-watch-profile-mini .logo,
  .partner-watch-profile-identity .logo{
    width:46px;
    height:46px;
    flex-basis:46px;
  }
  .partner-watch-chart-card .chart-box{
    height:280px;
  }
}


/* ===== v0.46 Partnerfigyelő UI + sticky javítás ===== */

.partner-watch-profile-shell{
  margin-top:14px;
  overflow:visible;
}

.partner-watch-profile-head-integrated{
  display:grid;
  grid-template-columns:minmax(240px,.8fr) minmax(320px,1.2fr);
  align-items:end;
  gap:18px;
}

.partner-watch-profile-placeholder{
  min-height:52px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:3px;
}

.partner-watch-profile-loading{
  margin-top:12px;
  padding:12px 0 2px;
  border-top:1px solid var(--line);
}

.partner-watch-profile-shell .partner-watch-metrics{
  margin-top:16px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

/* A régi külön keresőkártya már nincs használatban. */
.partner-watch-selector-card{
  display:none;
}

@media(max-width:760px){
  .partner-watch-profile-head-integrated{
    grid-template-columns:1fr;
    align-items:stretch;
    gap:12px;
  }

  .partner-watch-profile-shell .partner-watch-search{
    width:100%;
  }
}


/* ===== v0.47 Partnerfigyelő számlaszint + automatikus ajánlás ===== */
.partner-watch-scope-chip{
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  margin-top:5px;
  padding:3px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--panel-2);
  color:var(--muted);
  font-size:.76rem;
  line-height:1.2;
}
.partner-watch-auto-advice{
  margin-bottom:16px;
}
.partner-watch-advice-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.partner-watch-advice-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin-top:14px;
}
.partner-watch-advice-explain{
  margin-top:12px;
  padding-top:10px;
  border-top:1px solid var(--line);
}
.partner-watch-advice-empty{
  margin-top:12px;
}
@media(max-width:900px){
  .partner-watch-advice-grid{
    grid-template-columns:1fr;
  }
}


/* ===== Főzés: készlet, több kiszerelés/bolt, automatikus terv ===== */
.food-purchase-options-section{gap:12px}
.purchase-option-row{
  display:grid;
  grid-template-columns:minmax(145px,.8fr) minmax(180px,1.2fr) minmax(90px,.55fr) minmax(110px,.7fr) minmax(100px,.65fr) minmax(145px,.75fr) auto;
  gap:8px;
  align-items:end;
  padding:11px;
  border:1px solid var(--line);
  border-radius:11px;
  background:var(--panel-2);
}
.purchase-option-row label{min-width:0}
.purchase-option-help{grid-column:1/-1}
.purchase-option-row .action-icon{margin-bottom:2px}

.food-stock-mode-guide{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.food-stock-mode-guide>div{
  display:grid;
  gap:3px;
  padding:11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
}
.food-stock-mode-guide span{color:var(--muted);font-size:.82rem;line-height:1.35}
.food-stock-overview-row{align-items:center}
.food-leftover-form{
  display:grid;
  grid-template-columns:minmax(180px,1.2fr) minmax(150px,.8fr) minmax(160px,.8fr) minmax(180px,1fr) auto;
  gap:8px;
  align-items:end;
  margin-top:12px;
}
.food-leftover-form .btn{min-height:43px}
.food-repeat-input{display:flex;align-items:center;gap:8px}
.food-repeat-input input{flex:1}

.food-shop-summary{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:12px 0;
}
.food-shop-chip{
  display:grid;
  gap:2px;
  min-width:190px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
}
.food-shop-chip span{font-size:.78rem;color:var(--muted)}
.food-buy-alternatives{margin-top:4px;font-size:.78rem}
.food-buy-alternatives>div{padding:3px 0;color:var(--muted)}

.auto-plan-context{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:8px;
  margin:12px 0;
}
.auto-plan-context>div{
  display:grid;
  gap:3px;
  padding:10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel-2);
}
.auto-plan-context strong{font-size:1.05rem}
.auto-plan-day{
  padding:12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel-2);
}
.auto-plan-day.is-fixed{opacity:.82}
.auto-plan-day-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:9px;
}
.auto-plan-day-head>div{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.auto-plan-accept-check{font-size:.82rem}
.auto-plan-accept-check input{width:auto}
.auto-plan-choice{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:center;
  min-height:48px;
}
.auto-plan-choice-main{min-width:0}
.auto-plan-metrics{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  font-size:.78rem;
  color:var(--muted);
}
.auto-plan-day>.btn{margin-top:8px}

@media(max-width:1100px){
  .purchase-option-row{grid-template-columns:repeat(3,minmax(0,1fr)) auto}
  .purchase-option-help{grid-column:1/-1}
  .food-leftover-form{grid-template-columns:repeat(2,minmax(0,1fr))}
  .food-leftover-form .btn{grid-column:1/-1}
  .auto-plan-context{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media(max-width:760px){
  .food-hero-actions{
    width:100%;
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .food-hero-actions .btn{width:100%}
  .purchase-option-row{grid-template-columns:1fr 1fr;padding:10px}
  .purchase-option-row .action-icon{justify-self:end}
  .food-stock-mode-guide{grid-template-columns:1fr}
  .food-leftover-form{grid-template-columns:1fr}
  .food-leftover-form .btn{grid-column:auto}
  .auto-plan-context{grid-template-columns:1fr 1fr}
  .auto-plan-choice{grid-template-columns:1fr}
  .auto-plan-metrics{justify-content:flex-start}
  .auto-plan-day-head{align-items:flex-start}
}

@media(max-width:420px){
  .purchase-option-row,.auto-plan-context{grid-template-columns:1fr}
  .food-hero-actions{grid-template-columns:1fr 1fr}
}
.food-leftover-form-actions{
  align-self:end;
  justify-content:flex-end;
}
@media(max-width:1100px){
  .food-leftover-form-actions{grid-column:1/-1}
}
@media(max-width:760px){
  .food-leftover-form-actions{grid-column:auto;justify-content:stretch}
  .food-leftover-form-actions .btn{flex:1}
}


/* ===== Főzés / alapanyag-szerkesztő széles modál + termék/bolt picker ===== */

.modal-card.modal-card-wide{
  width:min(1180px,calc(100vw - 48px));
  max-width:1180px;
}

.ingredient-modal-card{
  overflow-x:hidden;
}

.food-ingredient-editor{
  gap:14px;
}

.food-ingredient-basics{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(320px,.8fr);
  gap:14px;
}

.food-purchase-options-head{
  align-items:flex-start;
  gap:14px;
}

.food-purchase-options-head>div:first-child{
  min-width:0;
  max-width:850px;
}

.purchase-option-list{
  gap:10px;
}

.purchase-option-row{
  display:block;
  padding:14px;
  min-width:0;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel-2);
}

.purchase-option-topline{
  display:grid;
  grid-template-columns:minmax(240px,1.15fr) minmax(300px,1fr) auto;
  gap:10px;
  align-items:end;
}

.purchase-option-fields{
  display:grid;
  grid-template-columns:minmax(160px,1fr) minmax(115px,.7fr) minmax(130px,.8fr) minmax(130px,.8fr) minmax(155px,.9fr);
  gap:10px;
  align-items:end;
  margin-top:10px;
}

.purchase-option-row label{
  display:grid;
  gap:6px;
  min-width:0;
}

.purchase-option-help{
  margin-top:9px;
  padding-top:8px;
  border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent);
}

.purchase-option-remove{
  align-self:end;
  margin-bottom:2px;
}

.purchase-option-shop-field{
  position:relative;
}

.purchase-option-shop-picker{
  position:relative;
  min-width:0;
}

.purchase-option-shop-trigger{
  width:100%;
  min-height:43px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:9px;
  background:var(--input);
  color:var(--text);
  text-align:left;
  cursor:pointer;
}

.purchase-option-shop-trigger:hover,
.purchase-option-shop-trigger:focus{
  border-color:color-mix(in srgb,var(--yellow) 68%,var(--line));
  outline:none;
}

.purchase-option-shop-current,
.purchase-shop-choice{
  min-width:0;
  display:flex;
  align-items:center;
  gap:9px;
}

.purchase-option-shop-current{
  flex:1;
}

.purchase-shop-copy{
  min-width:0;
  display:grid;
  gap:1px;
}

.purchase-shop-copy strong,
.purchase-shop-copy small{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.purchase-shop-copy small{
  color:var(--muted);
  font-size:.76rem;
}

.purchase-shop-logo{
  width:30px;
  height:30px;
  flex:0 0 30px;
  object-fit:contain;
  border-radius:7px;
  background:transparent;
}

.purchase-shop-logo.placeholder{
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:.72rem;
  background:var(--panel);
}

.purchase-shop-chevron{
  flex:0 0 auto;
  color:var(--muted);
  font-size:1rem;
}

.purchase-option-shop-menu{
  position:absolute;
  z-index:190;
  left:0;
  right:0;
  top:calc(100% + 6px);
  max-height:300px;
  overflow:auto;
  padding:6px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  box-shadow:var(--shadow);
}

.purchase-shop-choice{
  width:100%;
  padding:7px 8px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}

.purchase-shop-choice:hover,
.purchase-shop-choice:focus,
.purchase-shop-choice.selected{
  background:var(--panel-2);
  outline:none;
}

.ingredient-modal-actions{
  position:sticky;
  z-index:25;
  bottom:-18px;
  display:flex;
  justify-content:flex-end;
  gap:9px;
  margin:2px -18px -18px;
  padding:12px 18px 18px;
  border-top:1px solid var(--line);
  background:linear-gradient(
    to bottom,
    color-mix(in srgb,var(--panel) 92%,transparent),
    var(--panel) 28%
  );
  backdrop-filter:blur(8px);
}

.ingredient-modal-actions .btn.primary{
  min-width:230px;
}

.food-shop-chip-title{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}

.food-shop-chip-logo{
  width:26px;
  height:26px;
  flex:0 0 26px;
  object-fit:contain;
  border-radius:6px;
}

.food-shop-chip-logo.placeholder{
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  color:var(--muted);
  font-size:.7rem;
}

@media(max-width:1000px){
  .modal-card.modal-card-wide{
    width:min(920px,calc(100vw - 28px));
  }

  .food-ingredient-basics{
    grid-template-columns:1fr;
  }

  .purchase-option-topline{
    grid-template-columns:minmax(0,1fr) minmax(270px,1fr) auto;
  }

  .purchase-option-fields{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
}

@media(max-width:760px){
  .modal-card.modal-card-wide{
    width:100%;
    max-width:none;
  }

  .ingredient-modal-card{
    overflow-y:auto;
    overflow-x:hidden;
  }

  .food-ingredient-basics{
    display:grid;
    grid-template-columns:1fr;
  }

  .purchase-option-topline,
  .purchase-option-fields{
    grid-template-columns:1fr;
  }

  .purchase-option-remove{
    justify-self:end;
    margin:0;
  }

  .purchase-option-shop-menu{
    position:relative;
    top:auto;
    margin-top:6px;
    max-height:250px;
  }

  .modal-card form.stack>.ingredient-modal-actions:last-child{
    margin:8px 0 0;
    bottom:calc(10px + env(safe-area-inset-bottom));
  }

  .ingredient-modal-actions .btn{
    flex:1;
  }

  .ingredient-modal-actions .btn.primary{
    min-width:0;
  }
}


/* ===== Bolt / partner kereső az alapanyag vásárlási lehetőségeknél ===== */

.purchase-option-shop-autocomplete{
  width:100%;
}

.purchase-option-shop-autocomplete .autocomplete-input-wrap input{
  min-height:43px;
}

.purchase-option-shop-autocomplete .autocomplete-results{
  z-index:210;
}

.purchase-option-shop-autocomplete .autocomplete-option .logo{
  width:34px;
  height:34px;
  flex-basis:34px;
  border-radius:8px;
}

.purchase-option-shop-autocomplete .purchase-shop-logo.placeholder{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:8px;
}

@media(max-width:760px){
  .purchase-option-shop-autocomplete .autocomplete-results{
    position:relative;
    top:auto;
    margin-top:6px;
    max-height:250px;
  }
}


/* ===== Főzés: tömörebb UI + konkrét készlet-termék ===== */
.purchase-option-fields{
  grid-template-columns:minmax(150px,1.1fr) minmax(120px,.8fr) minmax(120px,.8fr) minmax(140px,.9fr);
}
.food-stock-product-line{
  display:flex;
  align-items:flex-start;
  gap:10px;
}
.food-stock-product-logo{
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 34px;
  border-radius:8px;
}
.food-conversion-base-line{margin-top:8px}
@media(max-width:760px){
  .purchase-option-fields{grid-template-columns:1fr 1fr}
}


/* ===== Főzés: alkalmi beszerzés + készlet-termék kereső ===== */
.purchase-option-fields{
  grid-template-columns:minmax(145px,1fr) minmax(110px,.75fr) minmax(110px,.75fr) minmax(130px,.85fr) auto;
}
.purchase-option-recommend{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
}
.purchase-option-recommend input{
  width:auto;
  margin:0;
}
.stock-product-autocomplete{width:100%}
.stock-product-option-logo{
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 34px;
  border-radius:8px;
}
.stock-product-selected-logo .stock-product-option-logo{
  width:30px;
  height:30px;
}
.stock-product-results{z-index:220}
@media(max-width:760px){
  .purchase-option-fields{grid-template-columns:1fr 1fr}
  .purchase-option-recommend{justify-content:flex-start}
  .stock-product-results{
    position:relative;
    top:auto;
    margin-top:6px;
    max-height:250px;
  }
}


/* ===== v0.58 letisztított felület ===== */

.section-title{
  margin-top:20px;
  margin-bottom:9px;
}

.stats-toolbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  min-height:34px;
  margin:0 0 10px;
}

.compact-details{
  margin:8px 0 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:var(--panel);
}

.compact-details > summary{
  cursor:pointer;
  padding:10px 13px;
  font-weight:700;
  list-style:none;
}

.compact-details > summary::-webkit-details-marker{
  display:none;
}

.compact-details > summary::before{
  content:'›';
  display:inline-block;
  margin-right:8px;
  transition:transform .15s ease;
}

.compact-details[open] > summary::before{
  transform:rotate(90deg);
}

.compact-details-body{
  padding:0 13px 12px;
  display:grid;
  gap:7px;
}

.compact-detail-list{
  display:grid;
  gap:4px;
}

.stats-critical-alert{
  margin-top:14px;
  margin-bottom:0;
}

.advisor-status{
  margin-top:12px;
  font-weight:600;
}

.advisor-next-income{
  margin-top:9px;
}

@media(max-width:760px){
  .stats-toolbar{
    justify-content:space-between;
  }

  .section-title{
    margin-top:16px;
    margin-bottom:8px;
  }
}
