:root {
  --brand: #c2410c;
  --brand-dark: #9a3412;
  --bg: #faf7f4;
  --card: #ffffff;
  --text: #17201e;
  --muted: #5f6b68;
  --line: #ece4dc;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--brand); }
img { max-width: 100%; }

.icon {
  width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { border-radius: 8px; }
.bell { color: #fff; text-decoration: none; font-size: 22px; display: inline-flex; }

.container { max-width: 760px; margin: 0 auto; padding: 16px; }

.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input {
  flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; background: var(--card);
}
.search button, .btn {
  display: inline-block; padding: 12px 18px; border: 0; border-radius: var(--radius);
  background: var(--brand); color: #fff; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn:active, .search button:active { background: var(--brand-dark); }
.btn:disabled { opacity: .6; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 8px 14px; font-size: 14px; }
.btn.danger { background: var(--danger); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px;
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px;
}
.banner[hidden] { display: none; }
.banner p { margin: 0; font-size: 14px; }

.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.job {
  display: block; padding: 14px 16px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: inherit; text-decoration: none;
}
.job:active { background: #f9fbfa; }
.job h2 { font-size: 17px; margin: 6px 0 4px; line-height: 1.3; }
.tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--brand-dark); background: #ffedd5;
  padding: 2px 10px; border-radius: 999px; text-decoration: none;
}
.meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.meta.small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

.pager { display: flex; justify-content: space-between; margin: 16px 0; }

.detail, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.detail h1, .card h1 { font-size: 22px; line-height: 1.3; margin: 8px 0; }
.body h3 { font-size: 16px; margin: 20px 0 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.note {
  margin-top: 18px; padding: 10px 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; font-size: 14px;
}
.prose h2 { font-size: 18px; margin-top: 24px; }

.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 14px 0 18px; }
.checks label {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.checks .icon { color: var(--brand); }
.checks label { font-size: 14px; line-height: 1.3; gap: 6px; padding: 10px; }
.checks input { flex: none; width: 18px; height: 18px; accent-color: var(--brand); }
.status { font-weight: 600; min-height: 1.5em; }
.status.ok { color: var(--brand-dark); }
.status.err { color: var(--danger); }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; background: var(--card);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 0 10px;
  color: var(--muted); text-decoration: none; font-size: 12px;
}
.bottomnav .icon { width: 24px; height: 24px; margin-bottom: 2px; }
.bottomnav a.on .icon { stroke-width: 2.4; }
.bottomnav a.on { color: var(--brand); font-weight: 600; }

.offline { text-align: center; padding-top: 80px; }

/* ---------- Admin ---------- */
.admin body, body.admin { padding-bottom: 20px; }
.admin .container { max-width: 960px; }
.admin table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.admin th, .admin td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
.admin th { background: #f7f1ec; }
.admin form.inline { display: inline; }
.admin label.field { display: block; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.admin label.field input, .admin label.field select, .admin label.field textarea {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; font: inherit; font-weight: 400; background: #fff;
}
.admin textarea { min-height: 140px; resize: vertical; }
.admin .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin .flash { padding: 10px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; margin-bottom: 14px; }
.admin .flash.err { background: #fef2f2; border-color: #fecaca; }
.admin .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.admin .stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.admin .stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.admin .stat b { display: block; font-size: 20px; }
.admin .table-wrap { overflow-x: auto; }
@media (max-width: 600px) { .admin .row { grid-template-columns: 1fr; } }

/* ---------- Mapishi ---------- */
.hero {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px;
  color: #fff; text-decoration: none; aspect-ratio: 4 / 3; max-height: 420px; width: 100%; background: #fde8d7;
}
.hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-text {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.hero-text h1 { margin: 6px 0 2px; font-size: 22px; line-height: 1.25; }
.hero-text p { margin: 0; font-size: 14px; opacity: .9; }
.badge { display: inline-block; background: var(--brand); padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.rcard {
  display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: inherit; text-decoration: none;
}
.rcard img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; background: #fde8d7; }
.rbody { padding: 8px 10px 10px; }
.rbody h2 { font-size: 15px; line-height: 1.3; margin: 4px 0 2px; }
.rbody .meta { gap: 2px 10px; }

.recipe .rimg { position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 12px; background: #fde8d7; }
.recipe .rimg img { display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; }
.fav {
  position: absolute; top: 10px; right: 10px; width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); color: var(--brand); font-size: 24px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.fav { display: grid; place-items: center; padding: 0; }
.fav.on { color: #e11d48; }
.fav.on .icon { fill: currentColor; }
.lead { color: var(--muted); margin: 0 0 12px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 14px 0 6px; }
.facts div { background: #fff7ed; border-radius: 10px; padding: 8px 10px; font-size: 12px; color: var(--muted); text-align: center; }
.facts .icon { width: 20px; height: 20px; color: var(--brand); }
.facts b { display: block; font-size: 15px; color: var(--text); }
.recipe h2 { font-size: 18px; margin: 22px 0 8px; }
.section-title { font-size: 18px; margin: 22px 0 10px; }
.ingredients { list-style: none; padding: 0; margin: 0; }
.ingredients li { border-bottom: 1px dashed var(--line); }
.ingredients label { display: flex; gap: 10px; align-items: flex-start; padding: 9px 2px; cursor: pointer; }
.ingredients input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
.ingredients input:checked + span { text-decoration: line-through; color: var(--muted); }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.steps li {
  counter-increment: s; position: relative; padding: 10px 10px 10px 48px; margin-bottom: 8px;
  background: #fffaf6; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.steps li::before {
  content: counter(s); position: absolute; left: 10px; top: 9px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 14px;
}
.steps li.done { color: var(--muted); background: #f5f5f4; }
.steps li.done::before { content: ""; background: #a8a29e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.tips { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 4px 14px; margin-top: 18px; }
.tips h2 { margin-top: 12px; }
.tips ul { padding-left: 20px; }
.toggle { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; cursor: pointer; }
.toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.card h3 { margin: 20px 0 4px; font-size: 16px; }
.admin .thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.admin .preview { max-width: 260px; border-radius: 10px; display: block; margin: 6px 0; }

/* ---------- Mipangilio ---------- */
.contacts { list-style: none; padding: 0; display: grid; gap: 10px; }
.contacts .icon { color: var(--brand); }
.admin .topbar { flex-wrap: wrap; gap: 8px 14px; }
.adminnav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 14px; }
.adminnav a { color: #fff; }
.admin .hint { display: block; font-weight: 400; font-size: 13px; color: var(--muted); margin-top: 4px; }
.admin label.field input[type=color] { width: 80px; height: 44px; padding: 4px; }
.admin label.field input[type=file] { padding: 8px; }
.admin label.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 14px; font-weight: 600; font-size: 14px; }
.admin label.check input { width: 20px; height: 20px; flex: none; accent-color: var(--brand); }
.admin .tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; }
.admin .listrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.admin .listrow input { flex: 1 1 160px; min-width: 0; }
.admin .listrow input, .admin .listrow select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; }
.admin .listrow button { padding: 8px 10px; }
.admin .listrow .pick { display: flex; align-items: center; gap: 6px; color: var(--brand); }
.admin .state { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: 14px; }
.admin .state .yes .icon { color: #15803d; }
.admin .state .no .icon { color: var(--warn); }
.admin code { background: #f7f1ec; padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.adminnav a { text-decoration: none; }
.admin .thumb { min-width: 64px; }
.admin .tabs { scrollbar-width: thin; }
@media (max-width: 600px) { .adminnav { width: 100%; gap: 6px 12px; font-size: 13px; } .adminnav form { margin-left: auto; } .adminnav .btn.small { padding: 6px 8px; font-size: 13px; } }
