/* ---------- search button + Spotlight ---------- */
.bar-search{width:28px;height:26px;display:grid;place-items:center;border-radius:7px;color:var(--ink)}
.bar-search svg{width:15px;height:15px}
.bar-search:hover{background:var(--acc-soft)}
.bar-r{gap:8px}
.sp{position:fixed;inset:0;z-index:2700;display:grid;justify-items:center;align-content:start;padding:min(16vh,140px) 14px 14px;background:rgba(10,14,20,.34);animation:lbin .2s ease}
.sp.out{opacity:0;transition:opacity .18s}
.sp-box{width:min(640px,100%);max-height:min(70vh,560px);display:flex;flex-direction:column;border-radius:18px;overflow:hidden;background:var(--glass);border:1px solid var(--glass-line);
  -webkit-backdrop-filter:blur(34px) saturate(1.8);backdrop-filter:blur(34px) saturate(1.8);box-shadow:0 40px 100px -20px rgba(var(--shade),.55),inset 0 1px 0 rgba(255,255,255,.4)}
:root[data-glass="off"] .sp-box{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none}
.sp-top{display:flex;align-items:center;gap:12px;padding:0 16px;height:58px;border-bottom:1px solid var(--line)}
.sp-ic{width:20px;height:20px;color:var(--ink-3);flex:none}.sp-ic svg{width:100%;height:100%}
.sp-in{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--ink);font:inherit;font-size:18px;outline:0}
.sp-in::-webkit-search-cancel-button{display:none}
.sp-top kbd{padding:3px 7px;border-radius:6px;border:1px solid var(--line-2);color:var(--ink-3)}
.sp-list{overflow:auto;padding:6px}
.sp-h{padding:10px 12px 4px;color:var(--ink-3)}
.sp-it{display:flex;width:100%;justify-content:space-between;align-items:center;gap:16px;padding:10px 12px;border-radius:10px;text-align:left;font-size:15px}
.sp-it em{font-style:normal;color:var(--ink-3);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}
[role=option][aria-selected="true"] .sp-it{background:var(--acc);color:var(--on-acc)}
[role=option][aria-selected="true"] .sp-it em{color:inherit;opacity:.8}
.sp-none{padding:22px;text-align:center;color:var(--ink-3)}
@media (max-width:700px){.sp{padding-top:12vh}.sp-in{font-size:16px}.sp-top kbd{display:none}.sp-it{padding:13px 12px}}

/* ---------- quick note (bottom-right page curl) ---------- */
.nc{position:fixed;right:0;bottom:0;z-index:930;width:0;height:0;padding:0;border:0;background:none;pointer-events:none;filter:drop-shadow(-3px -3px 6px rgba(0,0,0,.26))}
.nc-under,.nc-flap{position:absolute;inset:0;display:block}
.nc-under{background:repeating-linear-gradient(transparent 0 11px,rgba(60,50,0,.08) 11px 12px),#f6efc6;clip-path:polygon(100% 0,100% 100%,0 100%)}
.nc-flap{background:linear-gradient(135deg,#ffffff 0,#eef0f4 50%,#cfd4de 100%);clip-path:polygon(0 0,100% 0,0 100%)}
.nc-pen{position:absolute;right:12%;bottom:8%;font-size:0;color:#6b5d1a;opacity:0;transition:opacity .2s}
.nc.big .nc-pen{font-size:22px;opacity:.8}
.note{position:fixed;right:24px;bottom:24px;z-index:935;width:min(340px,calc(100vw - 48px));display:flex;flex-direction:column;border-radius:14px;overflow:hidden;background:#fbf6dc;color:#2a2618;border:1px solid rgba(70,60,10,.18);box-shadow:0 30px 70px -20px rgba(var(--shade),.5),0 8px 20px -8px rgba(var(--shade),.3)}
.note[hidden]{display:none}
.nt-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;height:38px;padding:0 12px;background:#efe7b8;border-bottom:1px solid rgba(70,60,10,.15)}
.nt-dots{display:flex;gap:7px}
.note .tl,.rd .tl{width:12px;height:12px;border-radius:50%;position:relative}
.note .tl::before,.rd .tl::before{content:"";position:absolute;inset:-7px}
.tl-close{background:#ff5f57}.tl-min{background:#febc2e}
.nt-segs{display:flex;padding:2px;border-radius:8px;background:rgba(70,60,10,.12)}
.nt-seg{padding:3px 11px;border-radius:6px;font-family:var(--f-mono);font-size:11px;letter-spacing:.06em;text-transform:uppercase}
.nt-seg[aria-pressed="true"]{background:#fffdf0;box-shadow:0 1px 3px rgba(0,0,0,.18)}
.nt-tools{display:flex;align-items:center;gap:7px;flex-wrap:wrap;padding:8px 12px;background:#f3ecc0;border-bottom:1px solid rgba(70,60,10,.12)}
.nt-tools[hidden]{display:none}
.nt-sw{width:20px;height:20px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.2)}
.nt-sw[aria-pressed="true"]{box-shadow:0 0 0 2px #f3ecc0,0 0 0 4px #2a2618}
.nt-t{padding:3px 9px;border-radius:7px;border:1px solid rgba(70,60,10,.25);font-family:var(--f-mono);font-size:10.5px;letter-spacing:.05em;text-transform:uppercase;color:#2a2618}
.nt-t[aria-pressed="true"],.nt-t:hover{background:#2a2618;color:#fbf6dc}
.nt-body{position:relative;height:300px;background:repeating-linear-gradient(transparent 0 27px,rgba(60,50,0,.1) 27px 28px)}
.note-text{position:absolute;inset:0;width:100%;height:100%;padding:6px 16px;border:0;resize:none;background:transparent;color:#2a2618;font:inherit;font-size:16px;line-height:28px;outline:0}
.note-text::placeholder{color:rgba(42,38,24,.4)}
.note-canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;touch-action:none}
.note[data-mode="draw"] .note-canvas{pointer-events:auto;cursor:crosshair}
.note[data-mode="draw"] .note-text{pointer-events:none}
.note :focus-visible{outline-color:#2a2618}

/* ---------- Space Raiders ---------- */
.sr-peek{position:fixed;left:26px;bottom:-26px;z-index:930;width:44px;height:44px;padding:0;color:var(--ink);transition:bottom .5s var(--spring),transform .5s var(--spring);opacity:.9}
.sr-peek[hidden]{display:none}
.sr-peek svg{width:100%;height:100%;fill:currentColor;shape-rendering:crispEdges}
.sr-peek.near{bottom:6px;animation:srwave 1s steps(2) infinite}
@keyframes srwave{50%{transform:translateX(5px)}}
.rd{position:fixed;left:24px;bottom:24px;z-index:935;width:max-content;border-radius:14px;overflow:hidden;background:#0e1013;color:#e8eaee;border:1px solid rgba(255,255,255,.14);box-shadow:0 30px 70px -20px rgba(var(--shade),.6)}
.rd[hidden]{display:none}
.rd .nt-bar{background:#1a1d23;border-bottom:1px solid rgba(255,255,255,.1)}
.sr-title{font-family:var(--f-mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#aeb4c0;margin-right:auto;margin-left:12px}
.sr-body{padding:10px;display:grid;gap:8px;justify-items:center}
.sr-cv{display:block;width:320px;height:400px;image-rendering:pixelated;background:#0e1013;border-radius:6px;outline:0;cursor:none;touch-action:none}
.sr-cv:focus-visible{outline:2px solid var(--acc)}
.sr-help{margin:0;color:#8a919e;font-size:10px}
.rd.collapsed .sr-body{display:none}
@media (max-width:899px),(pointer:coarse){.nc,.note,.rd,.sr-peek{display:none!important}}
@media (prefers-reduced-motion:reduce){.sr-peek.near{animation:none}}

