/* ==========================================================================
   Sütimanó – a családi receptes könyv stíluslapja.
   Mobilról indul (Android telefon a fő nézet), onnan nő fel tablet/asztali gépre.
   Minden szín token, hogy a nappali/esti mód egy helyen dőljön el.
   ========================================================================== */

/* ---------- betűk (helyben tárolva, nulla idegen kérés) ---------- */
@font-face {
  font-family: 'Baloo 2'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url('/fonts/baloo2-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo 2'; font-style: normal; font-weight: 500 800; font-display: swap;
  src: url('/fonts/baloo2-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/nunito-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url('/fonts/caveat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Caveat'; font-style: normal; font-weight: 500 700; font-display: swap;
  src: url('/fonts/caveat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- színek: nappali ---------- */
:root {
  --cream:      #fff7ee;
  --cream-deep: #fdeedd;
  --paper:      #ffffff;
  --paper-warm: #fffaf4;
  --ink:        #4a3226;
  --ink-soft:   #7b6151;
  --ink-faint:  #a08b7c;
  --line:       #f0dfcc;
  --line-soft:  #f8ecdf;

  --berry:      #e2725b;   /* fő szín: sült-terrakotta */
  --berry-dark: #c85a45;
  --berry-soft: #fde6df;
  --pink:       #ec7a9c;
  --pink-soft:  #fde4ec;
  --honey:      #f0b429;
  --honey-soft: #fdf0d0;
  --mint:       #6fae8f;
  --mint-soft:  #e0f2e8;
  --cocoa:      #a2704e;
  --cocoa-soft: #f3e3d5;

  --shadow-sm: 0 2px 6px rgba(120, 78, 52, .08);
  --shadow:    0 6px 18px rgba(120, 78, 52, .12);
  --shadow-lg: 0 14px 34px rgba(120, 78, 52, .18);
  --radius:    22px;
  --radius-sm: 14px;
  --radius-lg: 30px;

  --font-display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: 'Caveat', 'Segoe Script', cursive;

  /* A telefon alsó sávja (gesztus-csík) alá ne csússzon tartalom. */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-h: calc(64px + var(--safe-bottom));
}

/* ---------- színek: esti mód ---------- */
:root[data-theme='dark'] {
  --cream:      #241a16;
  --cream-deep: #2c211b;
  --paper:      #2f231d;
  --paper-warm: #352721;
  --ink:        #f6e7da;
  --ink-soft:   #cbb1a0;
  --ink-faint:  #9c8474;
  --line:       #44332a;
  --line-soft:  #3b2c25;

  --berry:      #f08b73;
  --berry-dark: #e2725b;
  --berry-soft: #4a2e26;
  --pink:       #f294b1;
  --pink-soft:  #4a2c37;
  --honey:      #f5c451;
  --honey-soft: #4a3a1c;
  --mint:       #86c4a4;
  --mint-soft:  #263a30;
  --cocoa:      #c99169;
  --cocoa-soft: #3d2e26;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .3);
  --shadow:    0 6px 18px rgba(0, 0, 0, .38);
  --shadow-lg: 0 14px 34px rgba(0, 0, 0, .5);
}

/* ---------- alap ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 17px;                 /* konyhában, lisztes kézzel is olvasható */
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  /* Szórócukor-minta: apró, elforgatott pöttyök. Beágyazott SVG, nulla kérés. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23e2725b' stroke-width='3' stroke-linecap='round' opacity='.13'%3E%3Cpath d='M14 20l6-3'/%3E%3Cpath d='M92 12l3 6'/%3E%3Cpath d='M58 44l6 2'/%3E%3Cpath d='M104 62l-2 6'/%3E%3Cpath d='M30 78l5-4'/%3E%3Cpath d='M78 96l6 1'/%3E%3Cpath d='M18 104l1 6'/%3E%3C/g%3E%3Cg fill='none' stroke='%23f0b429' stroke-width='3' stroke-linecap='round' opacity='.16'%3E%3Cpath d='M46 14l-4 5'/%3E%3Cpath d='M84 46l5-3'/%3E%3Cpath d='M12 60l6 1'/%3E%3Cpath d='M62 82l-3 6'/%3E%3Cpath d='M100 100l-5 3'/%3E%3C/g%3E%3Cg fill='none' stroke='%236fae8f' stroke-width='3' stroke-linecap='round' opacity='.14'%3E%3Cpath d='M70 26l4 4'/%3E%3Cpath d='M26 46l-5 2'/%3E%3Cpath d='M92 76l3-5'/%3E%3Cpath d='M44 108l5-2'/%3E%3C/g%3E%3C/svg%3E");
  padding-bottom: calc(var(--nav-h) + 12px);
}

@media (min-width: 860px) {
  body { padding-bottom: 40px; }
}

img { max-width: 100%; display: block; }

a { color: var(--berry-dark); text-decoration-color: color-mix(in srgb, var(--berry) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--berry); }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; margin: 0 0 .4em; letter-spacing: .2px; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

:focus-visible {
  outline: 3px solid var(--honey);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { width: min(1120px, 100% - 28px); margin-inline: auto; }
.wrap-narrow { width: min(680px, 100% - 28px); margin-inline: auto; }

.hand { font-family: var(--font-hand); font-size: 1.35em; line-height: 1.2; color: var(--cocoa); }
.muted { color: var(--ink-soft); }
.tiny { font-size: .82rem; }
.center { text-align: center; }
.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon { width: 1.35em; height: 1.35em; flex: none; vertical-align: -.3em; }
.icon-sm { width: 1.05em; height: 1.05em; }
.icon-lg { width: 2rem; height: 2rem; }

/* ==========================================================================
   Fejléc
   ========================================================================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: linear-gradient(135deg, var(--berry) 0%, var(--pink) 78%, var(--honey) 160%);
  color: #fff;
  box-shadow: var(--shadow);
}
:root[data-theme='dark'] .topbar {
  background: linear-gradient(135deg, #7b3628 0%, #6f3244 80%, #6a4c14 160%);
}

.topbar-inner {
  display: flex; align-items: center; gap: 10px;
  min-height: 60px; padding-block: 8px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.3rem;
  color: #fff; text-decoration: none; letter-spacing: .3px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .18);
}
.brand:hover { text-decoration: none; }
.brand svg { width: 38px; height: 38px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)); }
.brand-tag {
  display: none; font-family: var(--font-hand); font-size: 1.15rem; font-weight: 500;
  opacity: .92; margin-left: 4px; padding-top: 5px;
}
@media (min-width: 1080px) { .brand-tag { display: block; } }

.topbar-spacer { flex: 1; }

.topbar-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 42px; height: 42px; padding-inline: 11px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff;
  font: inherit; font-weight: 700; font-size: .95rem;
  text-decoration: none; transition: background .15s, transform .12s;
}
.topbar-btn:hover { background: rgba(255, 255, 255, .3); text-decoration: none; }
.topbar-btn:active { transform: scale(.94); }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 999px;
  background: #fff; color: var(--berry-dark);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
  text-decoration: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
}
.avatar-sm { width: 26px; height: 26px; font-size: .8rem; }

/* Hullámos alsó perem – ettől lesz „sütis" a fejléc. */
.topbar-wave { display: block; width: 100%; height: 18px; margin-bottom: -1px; }
.topbar-wave path { fill: var(--cream); }

/* Asztali menü */
.mainnav { display: none; gap: 4px; }
@media (min-width: 860px) { .mainnav { display: flex; } }
.mainnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  color: #fff; font-weight: 700; text-decoration: none; font-size: .97rem;
  transition: background .15s; white-space: nowrap;
}
.mainnav a:hover { background: rgba(255, 255, 255, .2); text-decoration: none; }
.mainnav a.active { background: rgba(255, 255, 255, .28); }

/* ==========================================================================
   Alsó sáv (telefon)
   ========================================================================== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -4px 20px rgba(120, 78, 52, .1);
}
@media (min-width: 860px) { .tabbar { display: none; } }

.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 8px 2px 6px; min-height: 62px;
  color: var(--ink-faint); text-decoration: none;
  font-size: .68rem; font-weight: 700; letter-spacing: .2px;
  transition: color .15s;
}
.tabbar a .icon { width: 24px; height: 24px; }
.tabbar a.active { color: var(--berry); }
.tabbar a:active { transform: scale(.93); }

/* A középső, kiemelt „új recept" gomb */
.tabbar .tab-add { position: relative; color: #fff; }
.tabbar .tab-add span:last-child { color: var(--ink-faint); }
.tabbar .tab-add .tab-add-circle {
  display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px;
  border-radius: 999px; color: #fff;
  background: linear-gradient(140deg, var(--berry), var(--pink));
  box-shadow: 0 6px 14px rgba(226, 114, 91, .45);
  border: 3px solid var(--paper);
}
.tabbar .tab-add .icon { width: 22px; height: 22px; }

/* ==========================================================================
   Kártyák, dobozok
   ========================================================================== */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card + .card { margin-top: 16px; }

.section { margin-top: 28px; }
.section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 9px; }
.section-head h2 .icon { color: var(--berry); }
.section-head .spacer { flex: 1; }
.section-head .more {
  font-weight: 700; font-size: .9rem; text-decoration: none;
  color: var(--berry-dark); white-space: nowrap;
}

/* Kis címke a szakaszok fölé, kézírással */
.eyebrow {
  font-family: var(--font-hand); font-size: 1.25rem; color: var(--cocoa);
  transform: rotate(-1.5deg); display: inline-block; margin-bottom: -4px;
}

/* ==========================================================================
   Gombok
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; min-height: 48px;
  border: 0; border-radius: 999px; cursor: pointer;
  font: inherit; font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  text-decoration: none; text-align: center;
  background: var(--cocoa-soft); color: var(--ink);
  transition: transform .12s, box-shadow .18s, background .15s, filter .15s;
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: scale(.96); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

.btn-primary {
  background: linear-gradient(140deg, var(--berry), var(--pink));
  color: #fff; box-shadow: 0 6px 16px rgba(226, 114, 91, .38);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(226, 114, 91, .48); filter: none; }

.btn-ghost { background: transparent; color: var(--ink-soft); border: 2px dashed var(--line); }
.btn-ghost:hover { border-color: var(--berry); color: var(--berry-dark); }

.btn-soft { background: var(--berry-soft); color: var(--berry-dark); }
.btn-mint { background: var(--mint-soft); color: #3d6b52; }
.btn-honey { background: var(--honey-soft); color: #8a6212; }

.btn-danger { background: #fbe2e2; color: #b3352f; }
:root[data-theme='dark'] .btn-danger { background: #4b2523; color: #ffb4ad; }

.btn-sm { padding: 8px 14px; min-height: 38px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; min-width: 46px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   Űrlapok
   ========================================================================== */
.field { margin-bottom: 16px; }
.field > label, .label {
  display: block; margin-bottom: 6px;
  font-family: var(--font-display); font-weight: 700; font-size: .98rem; color: var(--ink);
}
.field .hint { display: block; margin-top: 5px; font-size: .84rem; color: var(--ink-faint); }

input[type=text], input[type=email], input[type=password], input[type=search],
input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; padding: 12px 14px; min-height: 48px;
  font: inherit; color: var(--ink);
  background: var(--paper-warm);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s, background .15s;
  /* 16px alatt az Android/iOS beleközelít a mezőbe – ezt kerüljük el. */
  font-size: max(16px, 1rem);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--berry);
  box-shadow: 0 0 0 4px var(--berry-soft);
  background: var(--paper);
}
input::placeholder, textarea::placeholder { color: var(--ink-faint); opacity: .8; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b6151' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}

.grid-2 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.grid-3 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

/* Rádió-csempék (kategória, nehézség) */
.choice-grid { display: flex; flex-wrap: wrap; gap: 9px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice span {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px; cursor: pointer;
  background: var(--paper-warm); border: 2px solid var(--line);
  font-weight: 700; font-size: .93rem; transition: all .15s;
}
.choice input:checked + span {
  background: var(--berry-soft); border-color: var(--berry); color: var(--berry-dark);
}
.choice input:focus-visible + span { outline: 3px solid var(--honey); outline-offset: 2px; }
.choice span .icon { color: currentColor; }

/* Színválasztó pöttyök. A kiválasztottat gyűrű jelzi – a keret nem lenne elég,
   mert a pötty saját színe felülírná. */
.choice span.swatch { width: 42px; height: 42px; padding: 0; border-radius: 999px; border: 3px solid var(--paper); }
.choice input:checked + span.swatch {
  box-shadow: 0 0 0 3px var(--ink); transform: scale(1.08);
}

/* Pipa / kapcsoló */
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; padding: 6px 0; }
.check input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--berry); flex: none; }

/* ==========================================================================
   Üzenetek
   ========================================================================== */
.flash {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 18px;
  font-weight: 600; border: 2px solid transparent;
}
.flash .icon { flex: none; margin-top: 2px; }
.flash-ok   { background: var(--mint-soft); color: #33654c; border-color: #b5ddc8; }
.flash-err  { background: #fce7e6; color: #a83029; border-color: #f3c3bf; }
.flash-info { background: var(--honey-soft); color: #85610f; border-color: #f0dca6; }
:root[data-theme='dark'] .flash-err { background: #4a2724; color: #ffb9b3; border-color: #6d3a35; }

/* ==========================================================================
   Receptcsempék
   ========================================================================== */
.recipe-grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
@media (max-width: 460px) {
  .recipe-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
}

.recipe-card {
  position: relative; display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.3), box-shadow .18s;
}
.recipe-card:hover { transform: translateY(-4px) rotate(-.5deg); box-shadow: var(--shadow-lg); text-decoration: none; }
.recipe-card:active { transform: scale(.98); }

.recipe-card .thumb {
  position: relative; aspect-ratio: 4 / 3; background: var(--cream-deep);
  display: grid; place-items: center; overflow: hidden;
}
.recipe-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .thumb .placeholder { width: 46%; max-width: 90px; opacity: .35; color: var(--cocoa); }
.recipe-card:hover .thumb img { transform: scale(1.04); }
.recipe-card .thumb img { transition: transform .35s ease; }

.recipe-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recipe-card .title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.25;
  /* Két sor után három pont – így a csempék egy magasak maradnak. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.recipe-card .meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: .8rem; color: var(--ink-faint); font-weight: 600; margin-top: auto;
}
.recipe-card .meta span { display: inline-flex; align-items: center; gap: 4px; }

/* A Kincstárban sose lesz fotó: alacsonyabb fejléc, hogy több recept férjen ki. */
.recipe-card .thumb.is-empty { aspect-ratio: 5 / 2; }
.recipe-card .thumb.is-empty .placeholder { max-width: 54px; }

/* Kategória-szalag a kép sarkában */
.ribbon {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, .93); color: var(--ink);
  font-size: .74rem; font-weight: 800; letter-spacing: .2px;
  box-shadow: var(--shadow-sm); backdrop-filter: blur(3px);
}
.ribbon .icon { width: 14px; height: 14px; }

/* Szív a csempén */
.fav-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 999px; background: rgba(255, 255, 255, .92);
  color: var(--pink); box-shadow: var(--shadow-sm);
}
.fav-badge .icon { width: 18px; height: 18px; }

/* ==========================================================================
   Kategória-csempék a főoldalon
   ========================================================================== */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }

.cat-tile {
  display: flex; align-items: center; gap: 11px;
  padding: 13px 14px; border-radius: var(--radius);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.cat-tile .bubble {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 999px; background: var(--c, var(--berry-soft)); color: var(--cc, var(--berry-dark));
}
.cat-tile .bubble .icon { width: 24px; height: 24px; }
.cat-tile .name { font-family: var(--font-display); font-weight: 700; font-size: .98rem; line-height: 1.2; }
.cat-tile .count { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }

/* ==========================================================================
   Címkék, jelvények
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--cocoa-soft); color: var(--ink-soft);
  font-size: .82rem; font-weight: 700; text-decoration: none;
  border: 1px solid transparent; transition: all .15s;
}
a.chip:hover { background: var(--berry-soft); color: var(--berry-dark); text-decoration: none; }
.chip.is-on { background: var(--berry); color: #fff; }
.chip .icon { width: 14px; height: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 800;
  background: var(--honey-soft); color: #8a6212;
}

/* Nehézség: 1-3 kis kifli */
.diff { display: inline-flex; gap: 2px; align-items: center; }
.diff .icon { width: 15px; height: 15px; color: var(--line); }
.diff .icon.on { color: var(--honey); }

/* Csillagos értékelés */
.stars { display: inline-flex; gap: 2px; align-items: center; }
.stars .icon { width: 17px; height: 17px; color: #e6d5c2; }
.stars .icon.on { color: var(--honey); }

.rate-form { display: inline-flex; gap: 2px; }
.rate-form button {
  background: none; border: 0; padding: 3px; cursor: pointer; color: #e6d5c2;
  transition: transform .12s, color .12s;
}
.rate-form button .icon { width: 26px; height: 26px; }
.rate-form button.on { color: var(--honey); }
.rate-form:hover button { color: #e6d5c2; }
.rate-form button:hover, .rate-form button:hover ~ button { color: var(--honey); }
.rate-form button:active { transform: scale(.85); }
/* A jobbról balra sorrend teszi lehetővé a „minden korábbi csillag világít" hatást. */
.rate-form { flex-direction: row-reverse; }

/* ==========================================================================
   Kereső
   ========================================================================== */
.searchbox { position: relative; }
.searchbox input {
  padding-left: 46px; border-radius: 999px; background: var(--paper);
  border-width: 2px; min-height: 52px;
}
.searchbox .icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); width: 20px; height: 20px; pointer-events: none;
}
.searchbox .clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; padding: 8px; cursor: pointer; color: var(--ink-faint);
}

.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-bar > * { flex: none; }

/* ==========================================================================
   Üres állapot
   ========================================================================== */
.empty {
  text-align: center; padding: 40px 20px;
  background: var(--paper-warm); border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
}
.empty svg { width: 110px; height: 110px; margin: 0 auto 12px; opacity: .85; }
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--ink-soft); max-width: 42ch; margin-inline: auto; }

/* ==========================================================================
   Recept részletes nézet
   ========================================================================== */
.hero {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--cream-deep); box-shadow: var(--shadow);
  aspect-ratio: 16 / 10; max-height: 420px;
}
/* Fotó nélkül ne tátongjon egy nagy üres doboz: alacsony, díszes szalag lesz. */
.hero.is-empty { aspect-ratio: auto; height: 132px; box-shadow: var(--shadow-sm);
  background: linear-gradient(135deg, var(--berry-soft), var(--honey-soft) 60%, var(--mint-soft)); }
.hero.is-empty .placeholder svg { width: 72px; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cocoa); opacity: .3; }
.hero .placeholder svg { width: 40%; max-width: 160px; }

.recipe-title { margin-top: 18px; font-size: clamp(1.7rem, 6vw, 2.5rem); }

.meta-row {
  display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 18px;
}
.meta-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--paper); border: 1px solid var(--line);
  font-weight: 700; font-size: .9rem; box-shadow: var(--shadow-sm);
}
.meta-pill .icon { width: 17px; height: 17px; color: var(--berry); }
/* A nehézség-lángok és a csillagok SAJÁT színt visznek: a fenti szabály azonos
   erősségű, és mivel később áll, enélkül elnyomná a halvány (kikapcsolt) állapotot. */
.meta-pill .diff .icon,
.meta-pill .stars .icon { color: #e6d5c2; }
.meta-pill .diff .icon.on { color: var(--honey); }
.meta-pill .stars .icon.on { color: var(--honey); }
.meta-pill b { font-family: var(--font-display); }

.recipe-layout { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .recipe-layout { grid-template-columns: minmax(280px, 360px) 1fr; align-items: start; }
}

/* Hozzávalók */
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li {
  display: flex; align-items: baseline; gap: 10px;
  padding: 10px 2px; border-bottom: 1px dashed var(--line);
}
.ingredients li:last-child { border-bottom: 0; }
.ingredients .qty {
  font-family: var(--font-display); font-weight: 800; color: var(--berry-dark);
  min-width: 68px; flex: none; text-align: right;
}
.ingredients .nm { flex: 1; }
.ingredients .nt { color: var(--ink-faint); font-size: .85em; }
.ing-section {
  font-family: var(--font-hand); font-size: 1.3rem; color: var(--cocoa);
  margin-top: 12px; padding-top: 8px;
}
.ing-section:first-child { margin-top: 0; padding-top: 0; }

/* Adagolás-átszámoló */
.servings-tuner {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 10px; margin-bottom: 6px;
  background: var(--honey-soft); border-radius: var(--radius-sm);
}
.servings-tuner button {
  width: 40px; height: 40px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--paper); color: var(--berry-dark); box-shadow: var(--shadow-sm);
  font-size: 1.4rem; font-weight: 800; line-height: 1; display: grid; place-items: center;
  transition: transform .12s;
}
.servings-tuner button:active { transform: scale(.9); }
.servings-tuner .value { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; min-width: 88px; text-align: center; }

/* Lépések */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li {
  position: relative; display: flex; gap: 14px;
  padding: 16px 0; border-bottom: 1px dashed var(--line);
}
.steps li:last-child { border-bottom: 0; }
.steps .num {
  counter-increment: step; flex: none;
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  background: linear-gradient(140deg, var(--berry), var(--pink)); color: #fff;
  font-family: var(--font-display); font-weight: 800;
  box-shadow: 0 3px 8px rgba(226, 114, 91, .35);
}
.steps .num::before { content: counter(step); }
.steps .txt { flex: 1; }
.steps .txt p { margin: 0 0 .5em; }
.steps li.done .txt { opacity: .5; text-decoration: line-through; text-decoration-thickness: 1px; }
.steps li.done .num { background: var(--mint); box-shadow: none; }

/* ==========================================================================
   Recept-szerkesztő sorai
   ========================================================================== */
.row-list { display: flex; flex-direction: column; gap: 10px; }
.row-item {
  display: grid; gap: 8px; align-items: start;
  padding: 12px; background: var(--paper-warm);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  grid-template-columns: 1fr auto;
}
.row-item .row-grip {
  display: grid; place-items: center; width: 34px; height: 34px;
  color: var(--ink-faint); cursor: grab;
}
.row-item .row-del {
  border: 0; background: none; color: var(--ink-faint); cursor: pointer;
  padding: 8px; border-radius: 999px; transition: color .15s, background .15s;
}
.row-item .row-del:hover { color: #b3352f; background: #fbe2e2; }
.ing-fields { display: grid; gap: 8px; grid-template-columns: 74px 84px 1fr; }
@media (max-width: 420px) { .ing-fields { grid-template-columns: 68px 1fr; } .ing-fields .ing-name { grid-column: 1 / -1; } }

/* Fotó-rács a szerkesztőben */
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.photo-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid var(--line); }
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-item .photo-actions { position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; padding: 5px; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.photo-item .photo-actions button {
  flex: 1; border: 0; border-radius: 8px; padding: 5px; cursor: pointer;
  background: rgba(255, 255, 255, .9); font-size: .72rem; font-weight: 800; color: var(--ink);
}
.photo-item.is-cover { border-color: var(--honey); }
.photo-item .cover-flag {
  position: absolute; top: 6px; left: 6px; padding: 3px 8px; border-radius: 999px;
  background: var(--honey); color: #4a3226; font-size: .68rem; font-weight: 800;
}

.dropzone {
  display: grid; place-items: center; gap: 8px; padding: 26px 16px; cursor: pointer;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--paper-warm);
  color: var(--ink-soft); text-align: center; transition: all .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--berry); background: var(--berry-soft); color: var(--berry-dark); }
.dropzone .icon { width: 32px; height: 32px; }

/* ==========================================================================
   Belépő / regisztrációs lap
   ========================================================================== */
.auth-page { display: grid; place-items: center; min-height: 78dvh; padding: 26px 0; }
.auth-card {
  width: min(430px, 100% - 28px);
  background: var(--paper); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 30px 26px;
  border: 1px solid var(--line); text-align: center;
}
.auth-card .mascot { width: 96px; height: 96px; margin: 0 auto 8px; }
.auth-card h1 { font-size: 1.7rem; margin-bottom: 2px; }
.auth-card form { text-align: left; margin-top: 20px; }
.auth-links { margin-top: 18px; font-size: .92rem; color: var(--ink-soft); }

/* ==========================================================================
   Nyomtatás – a recept papíron is szép legyen
   ========================================================================== */
@media print {
  .topbar, .tabbar, .no-print, .btn, .filter-bar, .servings-tuner { display: none !important; }
  body { background: #fff; color: #000; padding: 0; font-size: 12pt; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  .hero { max-height: 60mm; }
  .recipe-layout { grid-template-columns: 1fr 1.4fr; gap: 10mm; }
  a { color: #000; text-decoration: none; }
  .steps li { break-inside: avoid; }
  /* A konyhában kipipált lépések papíron NE legyenek áthúzva: a nyomtatott
     recept mindig a teljes leírás. */
  .steps li.done .txt { opacity: 1; text-decoration: none; }
  .steps li.done .num { background: #444; }
}

/* ==========================================================================
   Mozgás – aki kikapcsolta, annak nincs
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
.pop { animation: pop .4s ease; }

@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
.floaty { animation: floaty 4s ease-in-out infinite; }

/* ==========================================================================
   Sütés mód – nagyobb betű a konyhapulton, a képernyő nem alszik el (app.js)
   ========================================================================== */
body.cook-mode { font-size: 20px; }
body.cook-mode .steps .txt { font-size: 1.12em; }
body.cook-mode .ingredients li { padding: 14px 2px; font-size: 1.08em; }
body.cook-mode .recipe-card, body.cook-mode .hero { display: none; }
body.cook-mode .recipe-layout { grid-template-columns: 1fr; }

/* ==========================================================================
   Konyhai időzítők – lebegő sáv az alsó menü fölött
   ========================================================================== */
.timer-bar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(var(--nav-h) + 10px);
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  width: min(560px, calc(100% - 24px));
}
@media (min-width: 860px) { .timer-bar { bottom: 18px; } }

.timer-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 10px 10px 18px; border-radius: 999px;
  background: var(--ink); color: var(--cream);
  font-family: var(--font-display); font-weight: 700; font-size: .98rem;
  box-shadow: var(--shadow-lg);
}
.timer-chip button {
  width: 30px; height: 30px; border-radius: 999px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: inherit; font-size: 1.1rem; line-height: 1;
}
.timer-chip.is-done {
  background: linear-gradient(140deg, var(--berry), var(--pink)); color: #fff;
  animation: pop .5s ease 3;
}

/* ==========================================================================
   Ötletfal – bementett receptlinkek képes kártyaként
   ========================================================================== */
.idea-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
@media (max-width: 520px) { .idea-grid { grid-template-columns: 1fr; } }

.idea-wrap {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
}

.idea-card { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.idea-card.is-done { opacity: .55; }

.idea-thumb {
  flex: none; width: 84px; height: 84px; border-radius: var(--radius-sm);
  overflow: hidden; background: var(--cream-deep);
  display: grid; place-items: center; text-decoration: none;
}
.idea-thumb img { width: 100%; height: 100%; object-fit: cover; }
.idea-thumb .placeholder { width: 30px; height: 30px; color: var(--cocoa); opacity: .5; }

.idea-body { min-width: 0; }
.idea-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.25;
  color: var(--ink); text-decoration: none;
  /* Három sor után elvágjuk – a webes címek gyakran nagyon hosszúak. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.idea-title:hover { color: var(--berry-dark); }

.idea-actions {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  padding: 0 12px 12px; margin-top: auto;
}
.idea-actions form { display: inline-flex; }
