/* Homepage tool finder. Kept independent from the tool pages and workspace UI. */
#toolFinderForm.hsearch{
  position:relative;
  width:min(760px,100%);
  max-width:760px;
  padding-right:.42rem;
  margin-bottom:.75rem;
  box-shadow:0 20px 70px -38px rgba(124,58,237,.75),inset 0 1px rgba(255,255,255,.035);
}
#toolFinderForm.hsearch input{font-size:clamp(.96rem,1.6vw,1.08rem)}
#toolFinderForm.hsearch input::-webkit-search-cancel-button{display:none}
.tf-browse{
  min-height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.42rem;
  flex:0 0 auto;
  border:1px solid var(--line2);
  border-radius:999px;
  padding:.55rem .82rem;
  background:var(--wisp2);
  color:var(--text);
  font:700 .76rem/1 Inter,sans-serif;
  cursor:pointer;
  white-space:nowrap;
  transition:background .18s,border-color .18s,transform .18s;
}
.tf-browse:hover,.tf-browse[aria-expanded="true"]{background:rgba(124,58,237,.2);border-color:var(--acc)}
.tf-browse:active{transform:scale(.97)}
.tf-browse>span:first-child{font-size:1rem;line-height:1;color:var(--acc2)}
.tf-prompts{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:.42rem;
  margin:0 auto .55rem;
  color:var(--muted2);
  font:600 .72rem/1 'JetBrains Mono',ui-monospace,monospace;
}
.tf-prompts>span{text-transform:uppercase;letter-spacing:.12em;margin-right:.1rem}
.tf-prompts button{
  min-height:30px;
  border:1px solid var(--line);
  border-radius:999px;
  padding:.34rem .65rem;
  background:rgba(255,255,255,.025);
  color:var(--muted);
  font:600 .76rem/1 Inter,sans-serif;
  cursor:pointer;
  transition:color .18s,border-color .18s,background .18s,transform .18s;
}
.tf-prompts button:hover,.tf-prompts button:focus-visible{color:var(--text);border-color:var(--line2);background:var(--wisp2);transform:translateY(-1px)}
.tf-backdrop{
  position:fixed;
  inset:0;
  z-index:11990;
  background:rgba(2,4,12,.58);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  opacity:0;
  transition:opacity .18s ease;
}
.tf-backdrop.is-open{opacity:1}
.tf-panel{
  --tf-row:64px;
  position:fixed;
  z-index:12000;
  left:var(--tf-left,50%);
  top:var(--tf-top,30%);
  width:var(--tf-width,min(760px,calc(100vw - 24px)));
  max-height:min(530px,calc(100svh - var(--tf-top,30%) - 18px));
  display:grid;
  grid-template-rows:auto auto minmax(82px,1fr) auto;
  overflow:hidden;
  color:var(--text);
  text-align:left;
  border:1px solid color-mix(in srgb,var(--acc) 42%,var(--line));
  border-radius:20px;
  background:color-mix(in srgb,var(--bg2) 92%,transparent);
  box-shadow:0 34px 100px -28px rgba(0,0,0,.88),0 0 0 1px rgba(255,255,255,.035) inset,0 0 54px -32px var(--acc);
  backdrop-filter:blur(22px) saturate(1.25);
  -webkit-backdrop-filter:blur(22px) saturate(1.25);
  opacity:0;
  transform:translateY(-7px) scale(.992);
  transform-origin:top center;
  pointer-events:none;
  transition:opacity .16s ease,transform .2s cubic-bezier(.2,.75,.2,1);
}
.tf-panel.is-open{opacity:1;transform:none;pointer-events:auto}
.tf-panel[data-placement="top"]{transform:translateY(7px) scale(.992);transform-origin:bottom center}
.tf-panel[data-placement="top"].is-open{transform:none}
.tf-panel[hidden],.tf-backdrop[hidden]{display:none!important}
.tf-panel-head{
  min-height:66px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.82rem 1rem .7rem 1.05rem;
  border-bottom:1px solid var(--line);
  background:linear-gradient(115deg,rgba(124,58,237,.12),rgba(34,211,238,.055) 68%,transparent);
}
.tf-panel-head>div{display:grid;gap:.25rem}
.tf-panel-head strong{font:750 1rem/1.15 'Space Grotesk',Inter,sans-serif;letter-spacing:-.01em}
.tf-panel-head span{color:var(--muted2);font:600 .68rem/1.2 'JetBrains Mono',ui-monospace,monospace;letter-spacing:.04em}
.tf-close{
  width:40px;height:40px;display:grid;place-items:center;flex:0 0 auto;
  border:1px solid var(--line);border-radius:11px;background:var(--wisp);color:var(--muted);
  font:400 1.35rem/1 sans-serif;cursor:pointer;transition:color .18s,background .18s,border-color .18s;
}
.tf-close:hover{color:var(--text);background:var(--wisp2);border-color:var(--line2)}
.tf-cats{
  display:flex;
  gap:.42rem;
  padding:.65rem .75rem;
  overflow-x:auto;
  overscroll-behavior-inline:contain;
  scrollbar-width:none;
  border-bottom:1px solid var(--line);
}
.tf-cats::-webkit-scrollbar{display:none}
.tf-cat{
  min-height:34px;
  flex:0 0 auto;
  border:1px solid var(--line);
  border-radius:999px;
  padding:.42rem .72rem;
  background:transparent;
  color:var(--muted);
  font:650 .74rem/1 Inter,sans-serif;
  cursor:pointer;
  white-space:nowrap;
}
.tf-cat:hover{color:var(--text);border-color:var(--line2)}
.tf-cat[aria-pressed="true"]{color:#fff;background:linear-gradient(120deg,#6d28d9,#2563eb);border-color:transparent;box-shadow:0 8px 24px -13px rgba(124,58,237,.9)}
.tf-list{
  min-height:82px;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:.45rem;
  scrollbar-width:thin;
  scrollbar-color:var(--line2) transparent;
  scroll-padding:.45rem;
}
.tf-option{
  min-height:var(--tf-row);
  display:grid;
  grid-template-columns:42px minmax(0,1fr) auto;
  align-items:center;
  gap:.72rem;
  padding:.5rem .62rem;
  border:1px solid transparent;
  border-radius:13px;
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.tf-option+.tf-option{margin-top:2px}
.tf-option:hover,.tf-option[aria-selected="true"]{
  background:linear-gradient(115deg,rgba(124,58,237,.15),rgba(34,211,238,.065));
  border-color:color-mix(in srgb,var(--acc) 36%,var(--line));
  outline:none;
}
.tf-icon{
  width:42px;height:42px;display:grid;place-items:center;border-radius:12px;
  background:var(--tf-tint,rgba(124,58,237,.15));
  color:var(--tf-accent,var(--acc2));
  border:1px solid color-mix(in srgb,var(--tf-accent,var(--acc2)) 30%,transparent);
  font:800 .68rem/1 'JetBrains Mono',ui-monospace,monospace;letter-spacing:.04em;
}
.tf-copy{min-width:0;display:grid;gap:.24rem}
.tf-copy strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:700 .9rem/1.15 Inter,sans-serif}
.tf-copy span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted2);font:500 .74rem/1.2 Inter,sans-serif}
.tf-meta{display:flex;align-items:center;gap:.45rem;color:var(--muted2);font:650 .64rem/1 'JetBrains Mono',ui-monospace,monospace;white-space:nowrap}
.tf-meta::after{content:'\2197';font-size:.86rem;color:var(--acc2)}
.tf-empty{min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:1.5rem;color:var(--muted)}
.tf-empty[hidden]{display:none!important}
.tf-empty strong{color:var(--text);font-size:1rem;margin-bottom:.35rem}
.tf-empty span{max-width:42ch;font-size:.82rem;line-height:1.5}
.tf-empty a{margin-top:.9rem;color:var(--acc2);font-weight:700;font-size:.82rem}
.tf-foot{
  min-height:43px;
  display:flex;
  align-items:center;
  gap:.8rem;
  padding:.55rem .8rem;
  border-top:1px solid var(--line);
  color:var(--muted2);
  background:rgba(0,0,0,.065);
  font:600 .63rem/1.2 'JetBrains Mono',ui-monospace,monospace;
}
.tf-foot span{display:inline-flex;align-items:center;gap:.25rem;white-space:nowrap}
.tf-foot kbd{padding:.16rem .3rem;border:1px solid var(--line);border-radius:5px;background:var(--wisp);font:inherit;color:var(--muted)}
.tf-foot a{margin-left:auto;color:var(--acc2);font:700 .72rem/1 Inter,sans-serif;text-decoration:none;white-space:nowrap}
.tf-foot a:hover{text-decoration:underline}
html[data-theme='light'] .tf-panel{background:rgba(253,252,255,.96);box-shadow:0 30px 90px -32px rgba(50,30,100,.38),0 0 0 1px rgba(255,255,255,.7) inset}
html[data-theme='light'] .tf-prompts button{background:rgba(255,255,255,.78)}

@media(max-width:720px){
  #toolFinderForm.hsearch{width:100%;padding:.3rem .34rem .3rem 1rem;border-radius:18px;gap:.45rem}
  #toolFinderForm.hsearch input{padding:.6rem 0;font-size:.92rem}
  #toolFinderForm.hsearch kbd{display:none}
  .tf-browse{width:42px;height:42px;min-height:42px;padding:0;border-radius:13px}
  .tf-browse-label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
  .tf-prompts{justify-content:flex-start;flex-wrap:nowrap;max-width:100%;overflow-x:auto;padding:.15rem .05rem .35rem;scrollbar-width:none}
  .tf-prompts::-webkit-scrollbar{display:none}
  .tf-prompts button{min-height:36px;flex:0 0 auto;padding:.42rem .7rem}
  .tf-prompts>span{flex:0 0 auto}
  .tf-backdrop{display:block}
  .tf-panel{
    --tf-row:68px;
    left:0!important;
    right:0;
    top:auto!important;
    bottom:0;
    width:auto!important;
    max-height:min(74dvh,650px);
    border-radius:22px 22px 0 0;
    border-left:0;border-right:0;border-bottom:0;
    padding-bottom:env(safe-area-inset-bottom,0px);
    transform:translateY(18px);
    transform-origin:bottom center;
  }
  .tf-panel[data-placement="top"]{transform:translateY(18px);transform-origin:bottom center}
  .tf-panel::before{content:'';width:42px;height:4px;border-radius:4px;background:var(--line2);position:absolute;top:7px;left:50%;transform:translateX(-50%)}
  .tf-panel-head{padding-top:1rem}
  .tf-cats{padding:.62rem .72rem}
  .tf-cat{min-height:40px;padding:.55rem .82rem}
  .tf-list{padding:.35rem .42rem .65rem}
  .tf-option{grid-template-columns:44px minmax(0,1fr);gap:.7rem;padding:.52rem .58rem}
  .tf-icon{width:44px;height:44px}
  .tf-copy strong{font-size:.92rem}
  .tf-copy span{font-size:.76rem}
  .tf-meta{display:none}
  .tf-foot{justify-content:space-between;min-height:48px;padding:.62rem .75rem}
  .tf-foot span{display:none}
  .tf-foot a{margin:0 0 0 auto;font-size:.76rem}
  html.tf-sheet-open,html.tf-sheet-open body{overflow:hidden;overscroll-behavior:none}
}
@media(max-width:390px){
  #toolFinderForm.hsearch{padding-left:.82rem}
  #toolFinderForm.hsearch input{font-size:.86rem}
  .tf-panel{max-height:min(78dvh,640px)}
}
@media(max-height:560px) and (max-width:720px){
  .tf-panel{max-height:88dvh}
  .tf-panel-head{min-height:54px;padding:.8rem .9rem .55rem}
  .tf-cats{padding:.45rem .6rem}
  .tf-cat{min-height:34px;padding:.4rem .7rem}
  .tf-foot{display:none}
}
@media(prefers-reduced-motion:reduce){
  .tf-panel,.tf-backdrop,.tf-browse,.tf-prompts button{transition:none!important}
}
@media(forced-colors:active){
  .tf-panel,.tf-option,.tf-cat,.tf-browse{border:1px solid ButtonText}
  .tf-option[aria-selected="true"],.tf-cat[aria-pressed="true"]{outline:2px solid Highlight}
}
