/* Site search (button in the header + overlay). Colours come from the page's theme variables. */
#searchToggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
#searchToggle:hover,#searchToggle:focus-visible{border-color:var(--green-500);color:var(--green-500)}
section[id],div[id]{scroll-margin-top:84px}
.sx{position:fixed;inset:0;z-index:2000;display:none;align-items:flex-start;justify-content:center;padding:6vh 16px 16px;background:rgba(10,14,8,.58);backdrop-filter:blur(4px)}
.sx.open{display:flex}
.sx-box{width:min(780px,100%);max-height:88vh;display:flex;flex-direction:column;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:20px;box-shadow:0 30px 80px rgba(0,0,0,.45);overflow:hidden}
.sx-bar{display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid var(--line);background:linear-gradient(90deg,var(--tint),var(--surface))}
.sx-ico{flex:none;width:44px;height:44px;border-radius:50%;background:var(--green-700);color:#fff;display:grid;place-items:center}
.sx-ico svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
#sxInput{flex:1;min-width:0;font:inherit;font-size:1.08rem;color:var(--ink);background:transparent;border:0;outline:0;padding:.5rem .2rem}
#sxInput::placeholder{color:var(--ink-2);opacity:.8}
#sxInput::-webkit-search-cancel-button{display:none}
.sx-close{flex:none;width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;font-size:24px;line-height:1;background:#fdece9;color:#c0392b}
.sx-close:hover,.sx-close:focus-visible{background:#f8cdc6}
.sx-res{overflow-y:auto;padding:14px 18px 18px;flex:1;min-height:120px}
.sx-label{display:flex;align-items:center;justify-content:center;gap:.4rem;font-size:.74rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--green-700);margin:6px 0 16px}
.sx-label svg{width:16px;height:16px}
.sx-chips{display:flex;flex-wrap:wrap;gap:9px;justify-content:center}
.sx-chip{font:inherit;font-size:.92rem;font-weight:600;cursor:pointer;padding:.38rem .95rem;border-radius:99px;background:var(--cb);color:var(--ct);border:1px solid color-mix(in srgb,var(--ct) 28%,transparent);transition:transform .12s}
.sx-chip:hover,.sx-chip:focus-visible{transform:translateY(-1px);outline:2px solid color-mix(in srgb,var(--ct) 45%,transparent)}
.sx-item{display:block;padding:12px 14px;border-radius:12px;color:inherit;text-decoration:none;border:1px solid transparent}
.sx-item+.sx-item{margin-top:2px}
.sx-item.active,.sx-item:hover{background:var(--tint);border-color:var(--line)}
.sx-top{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:5px}
.sx-cat{font-size:.7rem;font-weight:800;letter-spacing:.03em;padding:.16rem .6rem;border-radius:99px;background:var(--cb);color:var(--ct)}
.sx-src{font-size:.72rem;color:var(--ink-2);white-space:nowrap}
.sx-src.ext{color:var(--green-500);font-weight:700}
.sx-title{font-weight:700;font-size:1rem;line-height:1.35}
.sx-ex{font-size:.88rem;color:var(--ink-2);line-height:1.5;margin-top:3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sx mark{background:rgba(156,205,5,.38);color:inherit;border-radius:3px;padding:0 2px}
.sx-empty,.sx-msg{padding:28px 10px;text-align:center;color:var(--ink-2)}
.sx-all{display:block;width:100%;margin-top:10px;font:inherit;font-weight:700;cursor:pointer;padding:.7rem;border-radius:12px;border:1px dashed var(--green-500);background:transparent;color:var(--green-500)}
.sx-all:hover{background:var(--tint)}
.sx-foot{flex:none;display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;padding:11px 16px;background:var(--green-700);color:#e7f1da;font-size:.8rem}
.sx-foot kbd{font:inherit;font-size:.74rem;padding:.08rem .42rem;border-radius:5px;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.28);margin:0 .12rem}
/* category colours (light) */
.sx-c0{--cb:#e8f5e9;--ct:#2d5016}.sx-c1{--cb:#e0f2f1;--ct:#00695c}.sx-c2{--cb:#fff8e1;--ct:#8a5a00}.sx-c3{--cb:#e3f2fd;--ct:#0d47a1}
.sx-c4{--cb:#fdece9;--ct:#a13a1f}.sx-c5{--cb:#f1e9fb;--ct:#5b21a6}.sx-c6{--cb:#fff3e0;--ct:#b45309}
/* category colours (dark) */
:root[data-theme="dark"] .sx-c0{--cb:rgba(156,205,5,.16);--ct:#c9e98a}:root[data-theme="dark"] .sx-c1{--cb:rgba(38,198,170,.16);--ct:#7fe0cf}
:root[data-theme="dark"] .sx-c2{--cb:rgba(255,193,7,.16);--ct:#ffd873}:root[data-theme="dark"] .sx-c3{--cb:rgba(66,165,245,.18);--ct:#9cccf8}
:root[data-theme="dark"] .sx-c4{--cb:rgba(255,112,67,.18);--ct:#ffb199}:root[data-theme="dark"] .sx-c5{--cb:rgba(171,130,255,.2);--ct:#cdb6ff}
:root[data-theme="dark"] .sx-c6{--cb:rgba(255,152,0,.18);--ct:#ffc27a}
:root[data-theme="dark"] .sx-close{background:rgba(255,112,67,.18);color:#ffb199}
@media(prefers-color-scheme:dark){
 :root:not([data-theme="light"]) .sx-c0{--cb:rgba(156,205,5,.16);--ct:#c9e98a}:root:not([data-theme="light"]) .sx-c1{--cb:rgba(38,198,170,.16);--ct:#7fe0cf}
 :root:not([data-theme="light"]) .sx-c2{--cb:rgba(255,193,7,.16);--ct:#ffd873}:root:not([data-theme="light"]) .sx-c3{--cb:rgba(66,165,245,.18);--ct:#9cccf8}
 :root:not([data-theme="light"]) .sx-c4{--cb:rgba(255,112,67,.18);--ct:#ffb199}:root:not([data-theme="light"]) .sx-c5{--cb:rgba(171,130,255,.2);--ct:#cdb6ff}
 :root:not([data-theme="light"]) .sx-c6{--cb:rgba(255,152,0,.18);--ct:#ffc27a}
 :root:not([data-theme="light"]) .sx-close{background:rgba(255,112,67,.18);color:#ffb199}
}
@media(max-width:560px){.sx{padding:0}.sx-box{max-height:100vh;height:100vh;border-radius:0;border:0}.sx-foot{display:none}}
