:root {
  --saffron: #e8730c; --saffron-d: #c25a00; --saffron-l: #fff1e0;
  --bg: #fffaf3; --card: #ffffff; --ink: #3a1f0d; --muted: #7a6455; --line: #f0dfcb;
  --ok: #1f7a3d; --err: #b3261e; --shadow: 0 2px 10px rgba(120, 60, 0, .08);
  --r: 14px; --font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1c1108; --card: #2a1a0d; --ink: #fbeedd; --muted: #c2a68c; --line: #4a3120; --saffron-l: #3a2412; --shadow: none; --ok: #5ec27f; --err: #ff8a80; }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.55 var(--font); background: var(--bg); color: var(--ink); }
h1, h2, h3 { font-family: var(--font); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); } h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); } h3 { font-size: 1.1rem; }
a { color: var(--saffron-d); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
section { padding: 40px 0; }
.muted { color: var(--muted); }

header.site { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 12px; }
.brand { font: 700 1.3rem var(--font); color: var(--saffron-d); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand img.logo { width: 28px; height: 28px; display: inline-block; }
nav.main { display: flex; gap: 4px; }
nav.main a { padding: 10px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
nav.main a:hover { background: var(--saffron-l); }
nav.main a.active { background: var(--saffron); color: #fff; }

.sp-icon { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; vertical-align: -0.15em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--saffron); background: var(--saffron); color: #fff; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--saffron-d); border-color: var(--saffron-d); }
.btn.ghost { background: transparent; color: var(--saffron-d); }
.btn.ghost:hover { background: var(--saffron-l); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.btn[disabled] { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #2b6cff; outline-offset: 2px; }

.hero { background: linear-gradient(160deg, var(--saffron-l), var(--bg) 70%); padding: 56px 0 44px; text-align: center; }
.hero .hero-logo { width: 120px; height: 120px; margin: 0 auto 8px; display: block; }
.hero .tagline { margin: 0 0 20px; font-weight: 700; letter-spacing: .06em; color: var(--saffron-d); font-size: 1.3rem; }
.hero .tagline span { display: block; font-weight: 600; letter-spacing: .03em; color: var(--muted); font-size: .78rem; text-transform: uppercase; margin-top: 2px; }
.hero p.lead { max-width: 560px; margin: 0 auto 24px; color: var(--muted); font-size: 1.1rem; }
.searchbox { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; grid-template-columns: 1fr; max-width: 820px; margin: 0 auto; text-align: left; }
@media (min-width: 720px) { .searchbox { grid-template-columns: 180px 1fr auto; align-items: end; } .searchbox.four { grid-template-columns: 160px 1fr 1fr auto; } }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; }
input[type="file"] { display: flex; align-items: center; padding: 8px; color: var(--muted); cursor: pointer; }
input[type="file"]::file-selector-button, input[type="file"]::-webkit-file-upload-button {
  font: 600 .9rem var(--font); color: var(--saffron-d); background: var(--saffron-l); border: 1.5px solid var(--saffron);
  border-radius: 999px; padding: 8px 18px; margin-right: 12px; cursor: pointer; transition: background .15s, color .15s;
}
input[type="file"]::file-selector-button:hover, input[type="file"]::-webkit-file-upload-button:hover { background: var(--saffron); color: #fff; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--saffron); outline: none; box-shadow: 0 0 0 3px rgba(232, 115, 12, .25); }
.field { margin-bottom: 16px; } .field.invalid input, .field.invalid select, .field.invalid .cat-trigger { border-color: var(--err); }
.err { color: var(--err); font-size: .85rem; min-height: 1.1em; margin-top: 3px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.theme { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.theme h3 { display: flex; gap: 8px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .82rem; padding: 4px 10px; border-radius: 999px; background: var(--saffron-l); color: var(--saffron-d); text-decoration: none; border: 1px solid transparent; }
a.chip:hover { border-color: var(--saffron); }
.steps { counter-reset: s; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.step::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--saffron); color: #fff; font-weight: 700; margin-bottom: 8px; }
.cta { background: var(--saffron); color: #fff; border-radius: var(--r); padding: 32px 20px; text-align: center; }
.cta .btn { background: #fff; color: var(--saffron-d); border-color: #fff; }

.form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 18px; box-shadow: var(--shadow); max-width: 680px; margin: 0 auto; }
.row2 { display: grid; gap: 0 16px; grid-template-columns: 1fr; } @media (min-width: 620px) { .row2 { grid-template-columns: 1fr 1fr; } }
.banner { padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; } .banner.err { background: rgba(179, 38, 30, .12); color: var(--err); } .banner.ok { background: rgba(31, 122, 61, .12); color: var(--ok); }

.results h2.grp { margin-top: 28px; font-size: 1.15rem; display: flex; gap: 8px; align-items: center; }
.results h2.grp small { font: 400 .85rem var(--font); color: var(--muted); }
.helper { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.helper-photo { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; }
.helper-photo-placeholder { width: 100%; height: 140px; border-radius: 10px; background: var(--saffron-l); color: var(--saffron-d); display: flex; align-items: center; justify-content: center; font: 700 2.5rem var(--font); }
.helper .top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.helper h3 { margin: 0; }
.badge { font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge.v { background: rgba(31, 122, 61, .14); color: var(--ok); } .badge.u { background: var(--saffron-l); color: var(--muted); }
.helper .meta { color: var(--muted); font-size: .92rem; }
.helper .meta a { color: var(--saffron-d); text-decoration: underline; }
.helper .actions { display: flex; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.helper .actions .btn { flex: 1; min-height: 44px; padding: 0 14px; }
.state { text-align: center; padding: 40px 16px; color: var(--muted); }
.skeleton { height: 150px; border-radius: var(--r); background: linear-gradient(90deg, var(--line), var(--saffron-l), var(--line)); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }

footer.site { border-top: 1px solid var(--line); padding: 24px 0; color: var(--muted); font-size: .9rem; text-align: center; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

/* Search bar: keep inline error from pushing the PIN field out of line with its neighbours */
.searchbox .field { position: relative; }
.searchbox .field .err { position: absolute; top: 100%; left: 0; min-height: 0; margin: 2px 0 0; }

/* Hamburger menu (mobile) */
.menu-btn { display: none; width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; }
.menu-btn span { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--ink); transition: transform .2s, opacity .2s; }
header.site.open .menu-btn span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
header.site.open .menu-btn span:nth-child(2) { opacity: 0; }
header.site.open .menu-btn span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
@media (max-width: 640px) {
  .menu-btn { display: flex; }
  header.site .wrap { position: relative; }
  nav.main { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 4px; padding: 10px 16px 14px; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  header.site.open nav.main { display: flex; }
  nav.main a { border-radius: 10px; padding: 12px 14px; }
}

/* Category picker: searchable dialog replacing the plain <select> */
.sr-only-select { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cat-picker { position: relative; }
.cat-trigger { width: 100%; min-height: 46px; padding: 10px 40px 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; text-align: left; cursor: pointer; display: flex; align-items: center; position: relative; }
.cat-trigger span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-trigger .ph { color: var(--muted); }
.cat-trigger .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.cat-trigger:hover { border-color: var(--saffron); }
.cat-trigger:focus-visible { border-color: var(--saffron); outline: none; box-shadow: 0 0 0 3px rgba(232, 115, 12, .25); }

.cat-dialog-backdrop { position: fixed; inset: 0; background: rgba(30, 16, 6, .45); display: none; align-items: flex-end; justify-content: center; z-index: 100; }
.cat-dialog-backdrop.open { display: flex; }
.cat-dialog { background: var(--card); width: 100%; max-width: 480px; max-height: 82vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: cat-up .18s ease-out; }
@keyframes cat-up { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@media (min-width: 640px) { .cat-dialog-backdrop { align-items: center; } .cat-dialog { border-radius: var(--r); } }
.cat-dialog-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 10px; border-bottom: 1px solid var(--line); flex: none; }
.cat-search { flex: 1; display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bg); }
.cat-search input { border: none; background: transparent; min-height: 44px; padding: 0; flex: 1; font: inherit; color: var(--ink); width: auto; }
.cat-search input:focus { outline: none; box-shadow: none; }
.cat-close { border: none; background: transparent; font-size: 1rem; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; color: var(--muted); flex: none; }
.cat-close:hover { background: var(--saffron-l); color: var(--ink); }
.cat-list { overflow-y: auto; padding: 6px 0 14px; }
.cat-group { padding: 12px 16px 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; font-size: 1rem; }
.cat-row:hover, .cat-row:focus-visible { background: var(--saffron-l); }
.cat-row .radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; position: relative; }
.cat-row.sel .radio { border-color: var(--saffron); }
.cat-row.sel .radio::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--saffron); }
.cat-row.sel { color: var(--saffron-d); font-weight: 600; }
.cat-empty { padding: 30px 16px; text-align: center; color: var(--muted); }

/* Admin */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.admin-head small { font: 500 .9rem var(--font); }
.searchbox.admin-filters { max-width: none; margin: 0; }
@media (min-width: 720px) { .searchbox.admin-filters { grid-template-columns: 1fr 200px; } }
.switch { display: flex; align-items: center; gap: 10px; margin: auto 0 0; padding-top: 6px; cursor: pointer; font-weight: 600; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid #2b6cff; outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }
