:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-2: #f3ece4;
  --text: #2b2420;
  --muted: #7a6d64;
  --line: #e6dcd2;
  --accent: #b4532a;
  --accent-text: #ffffff;
  --accent-soft: #f6e3d8;
  --danger: #b3261e;
  --ok: #2e7d32;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(60, 40, 20, .08), 0 4px 14px rgba(60, 40, 20, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1714;
    --surface: #26201c;
    --surface-2: #312923;
    --text: #f1e9e2;
    --muted: #b3a59a;
    --line: #3d342d;
    --accent: #e0855a;
    --accent-text: #1b1714;
    --accent-soft: #42291c;
    --danger: #ef8a80;
    --ok: #81c784;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.loading { text-align: center; color: var(--muted); padding: 40vh 0; margin: 0; }
.hidden { display: none !important; }

/* ---------- raspored ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .wrap { display: flex; align-items: center; gap: 8px; min-height: 56px; }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  border: 0; background: transparent; width: 44px; height: 44px; border-radius: 50%;
  font-size: 22px; display: grid; place-items: center; cursor: pointer; flex: none; text-decoration: none; color: var(--text);
}
.icon-btn:active { background: var(--surface-2); }
main { padding: 12px 0 110px; }

/* ---------- dugmad i polja ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-align: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 10px 16px; min-height: 44px; cursor: pointer; font-weight: 600;
  text-decoration: none;
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }
.btn:disabled { opacity: .55; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.google-btn { gap: 10px; background: #fff; color: #1f1f1f; border-color: #dadce0; }
.google-btn svg { flex: none; }
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0 14px; color: var(--muted); font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.btn-row .btn { flex: 1 1 auto; }

label.field { display: block; margin: 14px 0; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
input[type=text], input[type=password], input[type=search], input[type=url], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 11px 12px; min-height: 46px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 120px; resize: vertical; line-height: 1.45; }
.check { display: flex; gap: 10px; align-items: center; margin: 14px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.error { color: var(--danger); font-weight: 600; }

/* ---------- pretraga ---------- */
.search { display: flex; gap: 8px; margin-bottom: 10px; }
.search input { flex: 1; font-size: 17px; }
.mode-toggle { display: flex; background: var(--surface-2); border-radius: 12px; padding: 3px; margin-bottom: 10px; }
.mode-toggle button {
  flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 8px; font-weight: 600; color: var(--muted); cursor: pointer;
}
.mode-toggle button[aria-pressed=true] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 14px; cursor: pointer; white-space: nowrap; scroll-snap-align: start;
}
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip .n { opacity: .7; margin-left: 4px; font-size: 12px; }
.filters { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.result-count { color: var(--muted); font-size: 14px; margin: 4px 0 10px; }

/* ---------- kartice ---------- */
.cards { display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius);
  padding: 10px; text-decoration: none; color: inherit; box-shadow: var(--shadow); border: 1px solid var(--line);
  min-width: 0;
}
.card .thumb {
  width: 68px; height: 68px; border-radius: 10px; flex: none; background: var(--surface-2) center/cover no-repeat;
  display: grid; place-items: center; font-size: 30px;
}
.card .body { min-width: 0; flex: 1; }
.card-fav {
  flex: none; align-self: flex-start; width: 44px; height: 44px; margin: -4px -4px 0 0; border: 0; border-radius: 50%;
  background: transparent; font-size: 24px; cursor: pointer; display: grid; place-items: center;
}
.card-fav:active { background: var(--surface-2); }
.stars-line { font-size: 13px; color: #c98a00; font-weight: 700; }
.card h3 { font-size: 16px; margin: 0 0 2px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card .meta { font-size: 13px; color: var(--muted); }
.badge { display: inline-block; font-size: 12px; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 8px; font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .big { font-size: 48px; }

.fab {
  position: fixed; right: max(16px, calc(50vw - 364px)); bottom: calc(20px + env(safe-area-inset-bottom));
  background: var(--accent); color: var(--accent-text); border: 0; border-radius: 18px;
  height: 60px; padding: 0 22px; font-size: 17px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  display: flex; align-items: center; gap: 8px; text-decoration: none; z-index: 20;
}

/* ---------- recept ---------- */
.photos { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scroll-snap-type: x mandatory; }
.photos img { height: 220px; width: auto; max-width: 85vw; object-fit: cover; border-radius: 12px; scroll-snap-align: start; cursor: zoom-in; }
.recipe-title { font-size: 26px; line-height: 1.2; margin: 4px 0 6px; }
.recipe-meta { color: var(--muted); font-size: 14px; display: flex; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 8px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.tag { font-size: 13px; background: var(--surface-2); border-radius: 999px; padding: 2px 10px; color: var(--muted); }
.section { background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin: 12px 0; border: 1px solid var(--line); }
.section h2 { font-size: 18px; margin: 0 0 8px; }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { padding: 9px 0 9px 34px; border-bottom: 1px solid var(--line); position: relative; cursor: pointer; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients li::before {
  content: ''; position: absolute; left: 2px; top: 11px; width: 20px; height: 20px; border: 2px solid var(--line); border-radius: 6px;
}
.ingredients li.done { color: var(--muted); text-decoration: line-through; }
.ingredients li.done::before { background: var(--accent); border-color: var(--accent); }
.steps { margin: 0; padding-left: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding: 8px 0 8px 40px; position: relative; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 8px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 14px;
}
.notes { white-space: pre-wrap; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-grid .btn { width: 100%; height: 50px; min-height: 0; padding: 0 10px; white-space: nowrap; font-size: 15px; }
.share-grid .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
details summary { cursor: pointer; color: var(--muted); font-weight: 600; }
pre.original { white-space: pre-wrap; font: 14px/1.45 ui-monospace, monospace; background: var(--surface-2); padding: 10px; border-radius: 10px; }

/* ---------- dodavanje ---------- */
.add-choices { display: grid; gap: 10px; margin: 10px 0 16px; }
.picked { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.picked .ph { position: relative; }
.picked img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
.picked .rm {
  position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: var(--text); color: var(--bg); font-size: 16px; cursor: pointer;
}
.scanning { text-align: center; padding: 30px 0; }
.spinner {
  width: 46px; height: 46px; border: 4px solid var(--accent-soft); border-top-color: var(--accent);
  border-radius: 50%; margin: 0 auto 14px; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- prijava ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: 10vh 16px 40px; }
.auth .logo { font-size: 56px; text-align: center; }
.auth h1 { text-align: center; margin: 4px 0 2px; }
.auth p.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); z-index: 60; display: grid; place-items: center; overflow: auto; }
.lightbox img { max-width: 100vw; max-height: 100vh; object-fit: contain; }

/* ---------- omiljeni i ocene ---------- */
.recipe-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 6px 0 10px; }
.fav-big {
  border: 2px solid var(--accent); background: var(--surface); color: var(--accent); border-radius: 999px;
  min-height: 48px; padding: 0 18px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.fav-big[aria-pressed=true] { background: var(--accent); color: var(--accent-text); }
.rating-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 14px; border-radius: 999px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
}
.stars { color: #e0a100; letter-spacing: 1px; }
.stars.big { font-size: 22px; }
.rating-summary { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
.star-input { display: flex; gap: 2px; margin-bottom: 10px; }
.star-input button {
  border: 0; background: transparent; font-size: 38px; line-height: 1; width: 52px; height: 52px; cursor: pointer;
  color: var(--line); padding: 0;
}
.star-input button.on { color: #e0a100; }
.rating-list { list-style: none; padding: 0; margin: 14px 0 0; border-top: 1px solid var(--line); }
.rating-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.rating-list li:last-child { border-bottom: 0; }

/* ---------- profil ---------- */
.avatar {
  border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center;
  color: #fff; font-weight: 700; vertical-align: middle; line-height: 1;
}
.author-link { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; font-weight: 600; }
.profile-head { text-align: center; padding: 12px 0 4px; }
.profile-head .avatar { margin: 0 auto; box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--accent-soft); }
.profile-head h2 { font-size: 24px; margin: 12px 0 2px; }
.profile-city { color: var(--muted); margin: 0; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0;
}
.profile-stats div {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 6px; text-align: center;
}
.profile-stats b { display: block; font-size: 20px; }
.profile-stats span { font-size: 12px; color: var(--muted); }
.avatar-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
details.section summary { font-size: 17px; color: var(--text); }

/* ---------- administracija ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.admin-user-head { display: flex; gap: 12px; align-items: center; }
.admin-user-head a { color: inherit; text-decoration: none; }
.notice {
  display: block; background: var(--accent-soft); color: var(--text); border-radius: 12px; padding: 10px 14px;
  margin-bottom: 12px; text-decoration: none; font-size: 14px; font-weight: 600;
}
.ok-msg { color: var(--ok); font-weight: 600; }
input[type=email] {
  width: 100%; border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 11px 12px; min-height: 46px; outline: none;
}
.admin-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 14px; }
@media (max-width: 560px) { .admin-tabs { grid-template-columns: 1fr 1fr; } }
.admin-tabs .chip { text-decoration: none; white-space: nowrap; justify-content: center; text-align: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 13px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 4px 6px 6px 0; }
.admin-table td { border-top: 1px solid var(--line); padding: 7px 6px 7px 0; vertical-align: top; }
.badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); }
.badge.bad { color: var(--danger); }
.admin-user.is-blocked { opacity: .75; }
.admin-row { display: flex; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.admin-row a { color: inherit; }
.btn.small { min-height: 38px; padding: 6px 10px; flex: 0 0 auto; }

/* ---------- početna ---------- */
.hero {
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 40%, var(--surface)));
  border-radius: 20px; padding: 18px 16px 14px; margin: 4px 0 12px; border: 1px solid var(--line);
}
.hero-hi { margin: 0; color: var(--muted); font-weight: 600; font-size: 15px; }
.hero-q { margin: 2px 0 12px; font-size: 24px; line-height: 1.2; }
.hero .search { margin-bottom: 10px; }
.hero .search input { background: var(--surface); }
.hero .mode-toggle { margin-bottom: 0; background: color-mix(in srgb, var(--surface) 55%, transparent); }
.home-h { font-size: 18px; margin: 20px 0 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 560px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: center; min-width: 0;
}
.cat-tile:active { transform: scale(.97); }
.cat-tile .ic { font-size: 26px; line-height: 1; color: var(--accent); margin-bottom: 4px; }
.cat-tile .nm { font-size: 13px; font-weight: 600; line-height: 1.2; overflow-wrap: anywhere; }
.cat-tile .ct { font-size: 12px; color: var(--muted); }
.tall-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 8px; margin: 0 -16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.tall-row::-webkit-scrollbar { display: none; }
.tall-card {
  flex: 0 0 150px; scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.tall-img { height: 110px; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; font-size: 40px; }
.tall-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.tall-body b { font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- donja navigacija ---------- */
#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.nav-in { max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; }
#nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 7px 0 8px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; min-height: 56px; justify-content: center;
}
#nav a .ic { font-size: 22px; line-height: 1; }
#nav a.on { color: var(--accent); }
#nav a.nav-add { color: var(--accent); }
#nav a.nav-add .ic {
  width: 52px; height: 52px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-text);
  background: var(--accent); box-shadow: 0 4px 14px rgba(180, 83, 42, .35); font-size: 24px; border: 3px solid var(--bg);
}
main, main.wrap { padding-top: 12px; padding-bottom: calc(110px + env(safe-area-inset-bottom)); }

/* ---------- zaštita od spama ---------- */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.badge.warn { color: #9a6700; background: #fff3cd; }
.sus { background: #fff3cd; color: #7a5200; border-radius: 10px; padding: 8px 10px; font-size: 13px; font-weight: 600; margin: 10px 0 0; }
.user-actions { margin-top: 10px; }
@media (prefers-color-scheme: dark) {
  .badge.warn, .sus { background: #3d3115; color: #f1c96b; }
}
.badge.ok { color: var(--ok); }
.missing { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- slike jela ---------- */
.card .thumb.ph, .tall-img { color: var(--muted); }
.dish-hero { position: relative; margin: 0 -16px 12px; }
.dish-hero img { width: 100%; aspect-ratio: 4 / 3; max-height: 420px; object-fit: cover; cursor: zoom-in; }
@media (min-width: 760px) { .dish-hero { margin: 0 0 12px; } .dish-hero img { border-radius: var(--radius); } }
.dish-hero.ph {
  aspect-ratio: 16 / 9; max-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px; text-align: center;
}
@media (min-width: 760px) { .dish-hero.ph { border-radius: var(--radius); } }
.dish-hero.ph .ic { font-size: 56px; line-height: 1; }
.dish-hero.ph .hint { color: rgba(0, 0, 0, .6); }
.dish-hero .hero-add { position: absolute; right: 12px; bottom: 12px; box-shadow: var(--shadow); }
.dish-thumbs { display: flex; gap: 8px; overflow-x: auto; margin: -4px 0 12px; scrollbar-width: none; }
.dish-thumbs .dt { position: relative; flex: none; }
.dish-thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; cursor: zoom-in; }
.dt-act { display: flex; justify-content: space-between; margin-top: 2px; }
.dt-act button, .dt-act span { border: 0; background: transparent; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.dt-act span { opacity: .9; }
.field .lbl { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.cover-tag { position: absolute; left: 4px; bottom: 4px; background: var(--accent); color: var(--accent-text); font-size: 11px; padding: 1px 6px; border-radius: 6px; }
.original-box summary { cursor: pointer; font-weight: 600; }
.original-box .photos { margin-top: 10px; }
details.original-box { margin: 14px 0; }
/* da dugme ili polje pri skrolovanju nikad ne ostane ispod donjeg menija */
html { scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ---------- izbor mesta ---------- */
.place-field { position: relative; }
.place-row { display: flex; gap: 8px; }
.place-row input { flex: 1; }
.place-row .btn { flex: none; padding: 0 14px; }
.place-list {
  position: absolute; left: 0; right: 0; z-index: 15; margin-top: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); overflow: hidden;
}
.place-list button {
  display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 12px; cursor: pointer;
  border-top: 1px solid var(--line);
}
.place-list button:first-child { border-top: 0; }
.place-list button:active, .place-list button:hover { background: var(--surface-2); }
.place-list span { display: block; font-size: 13px; color: var(--muted); }
.profile-city a { color: inherit; text-decoration: none; }

/* ---------- kuvar (PDF) ---------- */
.cookbook { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.cb-cover { text-align: center; padding: 30px 0 20px; }
.cb-logo { font-size: 56px; }
.cb-cover h1 { font-size: 34px; margin: 6px 0; }
.cb-small { color: var(--muted); font-size: 13px; }
.cb-toc h3 { font-size: 15px; margin: 14px 0 4px; }
.cb-toc ol { margin: 0; padding-left: 22px; columns: 2; column-gap: 24px; }
.cb-toc a { color: inherit; text-decoration: none; }
.cb-cat-title { font-size: 24px; border-bottom: 3px solid var(--accent); padding-bottom: 6px; margin: 28px 0 8px; }
.cb-recipe { padding: 14px 0; border-bottom: 1px solid var(--line); }
.cb-recipe h3 { font-size: 21px; margin: 0 0 2px; }
.cb-meta { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.cb-photo { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.cb-cols { display: grid; gap: 10px 22px; }
@media (min-width: 620px) { .cb-cols { grid-template-columns: 1fr 1.6fr; } }
.cb-cols h4 { margin: 4px 0; color: var(--accent); }
.cb-cols ul, .cb-cols ol { margin: 0; padding-left: 20px; }
.cb-cols li { margin: 2px 0; }
.cb-notes { font-size: 14px; }

@media print {
  @page { margin: 14mm 14mm 16mm; }
  :root { --bg: #fff; --surface: #fff; --text: #222; --muted: #666; --line: #ddd; --accent: #b4532a; }
  body { background: #fff !important; color: #222; font-size: 12.5pt; padding: 0; }
  .cb-recipe h3 { font-size: 19pt; }
  .cb-cat-title { font-size: 24pt; }
  .cb-toc h2 { font-size: 22pt; }
  .cb-toc h3 { font-size: 14pt; }
  .cb-meta, .cb-small { font-size: 10.5pt; }
  .topbar, #nav, .no-print, #toast { display: none !important; }
  main, main.wrap { padding: 0 !important; max-width: none; }
  .cookbook { border: 0; padding: 0; }
  .cb-cover { height: 85vh; display: flex; flex-direction: column; justify-content: center; break-after: page; }
  .cb-cover h1 { font-size: 44pt; }
  .cb-toc { break-after: page; }
  .cb-toc ol { columns: 2; }
  .cb-cat { break-before: page; }
  .cb-cat-title { margin-top: 0; }
  .cb-cols { grid-template-columns: 1fr 1.6fr; }
  .cb-recipe { break-inside: avoid-page; }
  .cb-photo { max-height: 70mm; }
  a { color: inherit; text-decoration: none; }
}

/* ---------- linijske ikonice ---------- */
.i { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -.2em; flex: none; }
.i svg { width: 100%; height: 100%; display: block; }
.i-starfill { color: #c8961e; }
.i-heartfill { color: #c0392b; }
.i-check { color: var(--ok); }
.i-x, .i-ban { color: var(--danger); }
.i-alert { color: #b7791f; }
.btn .i, button .i { margin-right: .1em; }
.icon-btn .i { width: 22px; height: 22px; vertical-align: middle; }
.tall-img .i, .thumb .i, .dish-hero .i { width: 1em; height: 1em; opacity: .75; }
#nav a.on .i-heart svg { fill: currentColor; }

/* ---------- boje ikonica ---------- */
.cat-tile .ic {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 6px; font-size: 25px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
}
.cat-tile .ic .i { width: 1em; height: 1em; }
.btn:not(.primary):not(.brand):not(.danger) .i { color: var(--accent); }
.btn.brand { color: #fff; border-color: transparent; font-weight: 700; }
.btn.brand .i { width: 1.35em; height: 1.35em; }
.btn.wa { background: #1f9e55; }
.btn.viber { background: #7360f2; }
.btn.brand:active { filter: brightness(.92); }
.chip .i { margin-right: 2px; }
#nav a:not(.nav-add) .ic { padding: 3px 16px; border-radius: 14px; transition: background .15s; }
#nav a.on:not(.nav-add) .ic { background: var(--accent-soft); }

/* ---------- sastojci i izmena recepta ---------- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sec-head h2 { margin: 0; }
.sec-hint { font-size: 12.5px; color: var(--muted); text-align: right; line-height: 1.3; }
.link-btn { background: none; border: 0; padding: 4px 2px; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.ingredients li.done::after {
  content: ''; position: absolute; left: 9px; top: 14px; width: 6px; height: 11px;
  border: solid var(--accent-text); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* ---------- kupovina, kuvanje, uvoz sa linka ---------- */
.topbar .icon-btn .i { width: 23px; height: 23px; }
.cart-btn { position: relative; }
.badge-n {
  position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 800; display: grid; place-items: center;
}
.badge-n[hidden] { display: none; }
.recipe-buttons { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 4px 0 2px; }
.recipe-buttons:empty { display: none; }
.recipe-buttons .btn { width: 100%; min-height: 48px; }
.shop-btn { width: 100%; margin-top: 10px; }
.shop-btn .i, .shop-link .i { color: var(--accent); }
.shop-link { width: 100%; margin-bottom: 12px; min-height: 48px; }
.shop-add { display: flex; gap: 8px; margin-bottom: 12px; }
.shop-add input { flex: 1; min-width: 0; }
.shop-add .btn { flex: none; }
.ingredients.shop li { display: flex; align-items: center; gap: 8px; padding-right: 0; }
.ingredients.shop .tx { flex: 1; }
.ingredients.shop .rm { border: 0; background: none; color: var(--muted); font-size: 22px; width: 40px; height: 36px; cursor: pointer; }
.empty .big .i { width: 1em; height: 1em; }
.spinner.small { display: inline-block; width: 14px; height: 14px; border-width: 2px; margin: 0 6px -2px 0; }
.url-import { margin-top: 18px; }
.url-import h2 .i { color: var(--accent); }
.url-import .hint { margin-bottom: 0; }

.cook { min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.cook-top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; padding-top: max(8px, env(safe-area-inset-top)); }
.cook-title { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: center; }
.cook-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cook-title span { font-size: 13px; color: var(--muted); }
.cook-progress { height: 4px; background: var(--surface-2); margin: 0 16px; border-radius: 2px; overflow: hidden; }
.cook-progress i { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.cook-main { flex: 1; padding: 20px 18px; max-width: 760px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.cook-step { display: flex; gap: 14px; align-items: flex-start; }
.cook-n {
  flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: 20px; display: grid; place-items: center;
}
.cook-step p { margin: 4px 0 0; font-size: clamp(21px, 5.6vw, 30px); line-height: 1.45; }
.cook-timers { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 58px; }
.cook-timers .i { color: var(--accent); }
.cook-nav { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; padding: 8px 16px; max-width: 760px; width: 100%; margin: 0 auto; }
.cook-nav .btn { min-height: 58px; }
.cook-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin: 0 16px 12px; }
.cook-sheet { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .35); display: flex; align-items: flex-end; }
.cook-sheet[hidden] { display: none; }
.sheet-in {
  background: var(--surface); width: 100%; max-height: 75dvh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); max-width: 760px; margin: 0 auto;
}
.sheet-in .ingredients li { font-size: 18px; }

#timerBar {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; gap: 6px;
  bottom: calc(84px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 24px));
}
.tmr {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px 8px 12px; border-radius: 14px;
  background: var(--text); color: var(--bg); box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.tmr .tn { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; }
.tmr b { font-variant-numeric: tabular-nums; font-size: 17px; }
.tmr button { border: 0; background: none; color: inherit; font-size: 22px; width: 36px; height: 32px; cursor: pointer; }
.tmr.ring { background: var(--accent); color: var(--accent-text); animation: ring 1s infinite; }
@keyframes ring { 50% { transform: scale(1.03); } }
#timerBar.in-cook { bottom: auto; top: calc(64px + env(safe-area-inset-top)); }
.cook-top .i { color: var(--text); }

/* ---------- ishrana i kalorije ---------- */
.diet-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.diet-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: color-mix(in srgb, #3f9150 14%, var(--surface)); color: #2f7a40;
}
.diet-badge .i { width: 15px; height: 15px; }
.dmarks { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.dmarks span { font-size: 11px; font-weight: 700; color: #2f7a40; background: color-mix(in srgb, #3f9150 12%, var(--surface)); padding: 1px 7px; border-radius: 999px; }
.diet-chip .i { color: #3f9150; }
.diet-chip[aria-pressed="true"] .i { color: inherit; }
.nutri-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 8px; }
.nutri-grid div { background: var(--surface-2); border-radius: 12px; padding: 10px 4px; text-align: center; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nutri-grid b { font-size: 17px; }
.nutri-grid span { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.diet-field { border: 0; padding: 0; margin: 0 0 12px; }
.diet-field .check { margin: 4px 0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .diet-badge, :root:not([data-theme="light"]) .dmarks span { color: #7cc68a; }
}

#offlineBar {
  position: sticky; top: 0; z-index: 25; background: var(--text); color: var(--bg); text-align: center;
  font-size: 13px; font-weight: 600; padding: 6px 12px; padding-top: max(6px, env(safe-area-inset-top));
}

.home-pill { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft, #f6e3d9);
  color: var(--accent, #b5552b); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.home-pill .i { width: 19px; height: 19px; }

.site-footer { text-align: center; color: var(--muted); font-size: 13px; margin: 28px 0 8px; line-height: 1.6; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); }
.consent { margin: 4px 0 12px; }
.legal h2 { font-size: 17px; margin: 18px 0 6px; }
.legal h2:first-of-type { margin-top: 8px; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 20px; margin: 6px 0; }
.legal-note { margin-top: 18px; font-style: italic; }
.danger-zone summary { cursor: pointer; color: var(--danger); font-weight: 600; }
.danger-zone[open] summary { margin-bottom: 8px; }
.danger-zone { margin-top: 12px; }

/* × za brisanje polja */
.clr-wrap { position: relative; display: block; flex: 1; min-width: 0; width: 100%; }
.clr-wrap > input { padding-right: 42px; }
.clr-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); display: none; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.clr-btn .i { width: 18px; height: 18px; color: var(--muted); }
.clr-btn:active { background: var(--accent-soft); }
.clr-wrap.has-val .clr-btn { display: inline-flex; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.search-go { flex: none; width: 50px; min-height: 46px; padding: 0; border-radius: 12px; }
.search-go .i { width: 22px; height: 22px; }

/* dok kucate na telefonu, donji meni ne prekriva polje */
body.kb-open #nav { display: none; }

.topbar h1:has(.brand-logo) { display: flex; align-items: center; gap: 9px; }
.brand-logo { display: block; flex: none; width: 32px; height: 32px; border-radius: 9px; }
.auth .logo img { display: inline-block; border-radius: 20px; box-shadow: 0 6px 18px rgba(80, 40, 20, .18); }
