:root {
  --bg: #07080d;
  --bg-2: #10131c;
  --card: rgba(18, 21, 32, 0.78);
  --card-solid: #141824;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f6f3ea;
  --muted: #9aa3b8;
  --lime: #c8f542;
  --lime-dim: rgba(200, 245, 66, 0.14);
  --copper: #ffb35c;
  --mint: #7dffc3;
  --rose: #ff7a8a;
  --danger: #ff5d6c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --nav-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Rubik", "Noto Sans Hebrew", "Assistant", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100%;
}
body {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(200, 245, 66, 0.08), transparent 50%),
    radial-gradient(900px 500px at -10% 20%, rgba(125, 255, 195, 0.07), transparent 45%),
    radial-gradient(700px 400px at 80% 120%, rgba(255, 179, 92, 0.07), transparent 40%),
    var(--bg);
  overflow-x: hidden;
}
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
}

/* top */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 8px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(to bottom, rgba(7,8,13,0.92), rgba(7,8,13,0.72) 70%, transparent);
  backdrop-filter: blur(10px);
}
.brand { display: flex; flex-direction: column; gap: 0; }
.brand h1 {
  margin: 0; font-weight: 650; font-size: 1.55rem; letter-spacing: -0.02em;
}
.brand h1 span { color: var(--lime); }
.brand .sub { color: var(--muted); font-size: 0.78rem; }

.icon-btn, .chip, .btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  min-height: 42px;
}
.icon-btn {
  width: 42px; min-width: 42px; display: grid; place-items: center;
  color: var(--text);
}
.icon-btn:active, .btn:active, .card:active.tappable { transform: scale(0.98); }

.search-wrap { padding: 0 16px 12px; }
.search-wrap input, .field, textarea.field {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  outline: none;
}
.search-wrap input:focus, .field:focus { border-color: rgba(200,245,66,0.45); }

.filters {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 14px;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  padding: 0 14px; white-space: nowrap; color: var(--muted); font-size: 0.9rem;
  background: rgba(255,255,255,0.03);
}
.chip.on { color: #10140a; background: var(--lime); border-color: transparent; font-weight: 600; }

/* recipe cards */
.grid { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.recipe-card { display: grid; grid-template-columns: 112px 1fr; min-height: 112px; }
.recipe-card .thumb {
  background:
    linear-gradient(160deg, rgba(200,245,66,0.2), rgba(255,179,92,0.08) 50%, #1a1e2b);
  position: relative;
}
.recipe-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .body { padding: 12px 14px 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.recipe-card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.3; }
.meta { color: var(--muted); font-size: 0.8rem; display: flex; gap: 8px; flex-wrap: wrap; }
.fav { color: var(--copper); }

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty .orb {
  width: 92px; height: 92px; margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e9ff8a, #7dffc3 40%, transparent 70%),
              linear-gradient(160deg, #1c2230, #0b0d14);
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(200,245,66,0.15);
}
.empty h2 { color: var(--text); margin: 0 0 8px; font-weight: 600; }

/* screens overlay */
.screen {
  position: fixed; inset: 0; z-index: 40;
  background: var(--bg);
  max-width: 480px; margin: 0 auto;
  overflow: auto;
  padding-bottom: 24px;
  animation: rise 0.28s ease;
}
@keyframes rise {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.screen-head {
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
  position: sticky; top: 0; z-index: 5;
  background: rgba(7,8,13,0.9); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.screen-head h2 { margin: 0; font-size: 1.15rem; flex: 1; }
.screen-body { padding: 16px; }

.hero {
  border-radius: 24px; overflow: hidden; margin: 0 16px 16px;
  min-height: 200px; position: relative;
  background: linear-gradient(160deg, #1c2433, #0d1018);
  border: 1px solid var(--line);
}
.hero img { width: 100%; height: 240px; object-fit: cover; }
.hero .grad {
  position: absolute; inset: auto 0 0; padding: 40px 16px 14px;
  background: linear-gradient(to top, rgba(7,8,13,0.95), transparent);
}
.hero h2 { margin: 0; font-size: 1.55rem; }

.kv { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px 8px; }
.pill {
  background: var(--lime-dim); color: var(--lime);
  border-radius: 999px; padding: 6px 10px; font-size: 0.8rem;
}
.section { padding: 8px 16px 16px; }
.section h3 {
  margin: 0 0 10px; font-size: 0.85rem; letter-spacing: 0.08em;
  color: var(--muted); text-transform: uppercase;
}
.ing, .step {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.ing .dot, .step .num {
  width: 28px; min-width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 600;
  background: var(--lime-dim); color: var(--lime);
}
.step .num { border-radius: 10px; }
.timer-mini {
  margin-top: 6px; border: 0; background: rgba(255,179,92,0.15);
  color: var(--copper); border-radius: 999px; padding: 4px 10px; font-size: 0.8rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 16px; min-height: 46px; font-weight: 600; font-size: 1rem;
}
.btn.primary { background: var(--lime); color: #14180c; border: 0; }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.danger { background: rgba(255,93,108,0.15); color: var(--rose); border-color: transparent; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* cook mode */
.cook {
  background: #05060a;
  display: flex; flex-direction: column;
  min-height: 100dvh;
}
.cook .progress {
  height: 4px; background: #1b1e28; margin: 0 16px 8px; border-radius: 4px; overflow: hidden;
}
.cook .progress > span { display: block; height: 100%; background: var(--lime); width: 0; }
.cook-step {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  padding: 12px 22px 16px; text-align: right;
}
.cook-step .n { color: var(--lime); font-weight: 650; letter-spacing: 0.08em; font-size: 0.85rem; }
.cook-step p { font-size: 1.65rem; line-height: 1.4; font-weight: 500; margin: 10px 0 18px; }
.cook-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  padding: 0 16px calc(16px + var(--safe-b));
}
.cook-nav .btn { min-height: 56px; font-size: 1.1rem; }
.timers {
  display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px;
}
.timer-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #12151e; border-radius: 14px; padding: 10px 14px;
  border: 1px solid var(--line);
}
.timer-row b { font-variant-numeric: tabular-nums; font-size: 1.2rem; color: var(--copper); }

/* bottom nav */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr;
  align-items: end;
  padding: 8px 10px calc(8px + var(--safe-b));
  background: rgba(8, 10, 16, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  z-index: 30;
}
.nav button {
  background: none; border: 0; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 0.7rem; min-height: 48px; justify-content: center;
}
.nav button.on { color: var(--lime); }
.nav .fab {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--lime); color: #14180c;
  font-size: 2rem; font-weight: 500; line-height: 1;
  box-shadow: 0 8px 24px rgba(200,245,66,0.28);
  margin-top: -22px;
}

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet .panel {
  width: 100%; max-width: 480px;
  background: #12151e;
  border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(20px + var(--safe-b));
  border: 1px solid var(--line);
  animation: rise 0.25s ease;
}
.sheet .grab { width: 42px; height: 4px; background: #3a3f4e; border-radius: 4px; margin: 4px auto 12px; }
.sheet button.item {
  width: 100%; text-align: right; background: none; border: 0;
  padding: 14px 6px; border-bottom: 1px solid var(--line);
  font-size: 1.05rem;
}

footer.credit {
  text-align: center; color: var(--muted); font-size: 0.75rem;
  padding: 8px 8px 4px;
}
.banner {
  position: fixed; top: env(safe-area-inset-top, 0px); left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 456px;
  background: var(--lime); color: #14180c;
  border-radius: 14px; padding: 12px 14px; z-index: 80;
  font-weight: 650; text-align: center; box-shadow: var(--shadow);
}
.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  left: 50%; transform: translateX(-50%);
  background: #1c2030; border: 1px solid var(--line);
  color: var(--text); padding: 10px 16px; border-radius: 14px;
  z-index: 90; max-width: 90%; font-size: 0.92rem;
}

.scale-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 16px 16px;
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper b { min-width: 2ch; text-align: center; }

.photo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.photo-grid .pic {
  background: #10131c; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); text-align: right;
}
.photo-grid .pic img { height: 110px; width: 100%; object-fit: cover; }
.photo-grid .pic small { display: block; padding: 6px 8px 8px; color: var(--muted); font-size: 0.7rem; }

.shop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.shop-item.done span { text-decoration: line-through; color: var(--muted); }
.check {
  width: 24px; height: 24px; min-width: 24px; border-radius: 8px;
  border: 1.5px solid var(--lime); background: transparent;
}
.shop-item.done .check { background: var(--lime); }

.code-box {
  font-size: 1.8rem; letter-spacing: 0.18em; text-align: center;
  background: #0c0f16; border: 1px dashed rgba(200,245,66,0.35);
  border-radius: 16px; padding: 16px; font-weight: 650; color: var(--lime);
}

label.lbl { display: block; color: var(--muted); font-size: 0.8rem; margin: 12px 0 6px; }
.hidden-file { position: absolute; opacity: 0; width: 0; height: 0; }

.busy {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 16px; color: var(--muted);
}
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid #2a2f3d; border-top-color: var(--lime);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tag-edit { display: flex; flex-wrap: wrap; gap: 8px; }
