:root{
  --s-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.searchbar{
  flex: 1;
  max-width: 720px;
  margin: 0 16px;
  position: relative;
  display:flex;
  align-items:center;
}
.searchbar input{
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 52px 0 40px;
  outline: none;
}
.searchbar input:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.searchbar .sbtn{
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display:grid;
  place-items:center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  z-index: 2;
  font-size: 16px;
  padding: 0;
}
.searchbar .sbtn:hover{
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}
.searchbar .sbtn:focus-visible,
.sclose:focus-visible,
.sselect:focus-visible,
.sinput:focus-visible,
.scheck input:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

.sdropdown{
  position:absolute;
  top: 50px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow:hidden;
  box-shadow: var(--s-shadow);
  z-index: 999;
}
.shead, .sfoot{
  padding: 10px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.sfoot{
  border-top: 1px solid var(--border);
  border-bottom: 0;
}
.stitle{ font-weight: 800; }
.smuted{ color: var(--muted); font-size: 12px; }
.slist{ padding: 6px; display:flex; flex-direction:column; gap: 6px; max-height: 320px; overflow:auto; }

.sitem{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  text-decoration:none;
  color: var(--text);
}
.sitem:hover{
  background: var(--surface-2);
  border-color: var(--border);
}
.sitem mark{
  background: rgba(245,158,11,.25);
  color: inherit;
  padding: 0 2px;
  border-radius: 4px;
}
.sitem .meta{ display:flex; gap:8px; flex-wrap:wrap; }
.sitem .ttl{ font-weight: 400; line-height:1.2; }
.sitem .cat{ color: var(--muted); font-size: 12px; }
.sbadge{
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.sbadge.draft{ background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.35); }
.sbadge.pending{ background: rgba(59,130,246,.12); border-color: rgba(59,130,246,.35); }
.sbadge.needs{ background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.35); }

.ssettings{
  position:absolute;
  top: 50px;
  right: 0;
  width: min(520px, 95vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--s-shadow);
  z-index: 1000;
  overflow:hidden;
  padding-bottom: 12px;
}
.ssettings .shead{ border-bottom: 1px solid var(--border); }
.sclose{
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 32px;
  height: 32px;
  display:grid;
  place-items:center;
  padding: 0;
  cursor:pointer;
}
.scheck{
  display:flex;
  gap:10px;
  padding: 12px;
  align-items:flex-start;
  font-size: 13px;
  line-height: 1.35;
}
.scheck input{
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 16px;
  height: 16px;
  min-width: 16px;
  margin: 2px 0 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--accent);
  background: initial;
  border: 0;
  box-shadow: none;
}
.scheck span{ flex:1; }

.srow{ display:flex; gap:10px; padding: 0 12px 12px; }
.scol{ flex:1; min-width: 0; }
.sselect, .sinput{
  width: 100%;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}
.sselect:focus, .sinput:focus{
  border-color: rgba(59,130,246,.55);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}
.small{ font-size: 12px; }

@media (max-width: 720px){
  .searchbar{ margin: 10px 0 0; max-width: none; }
  header.topbar{ flex-wrap: wrap; gap: 10px; }
  .ssettings{
    left: 0;
    right: 0;
    width: auto;
  }
  .srow{ flex-direction: column; }
}

/* Global search strip under top menu */
.gsearch{ padding-top: 14px; }
.searchbar.is-global{ max-width: none; margin: 0; }
.searchbar.is-global .gicon{
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .65;
  pointer-events: none;
  z-index: 1;
  font-size: 14px;
}
